/* 芯晶采SPO联动中台系统 - 样式表 */

/* 登录页动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

/* 子系统切换标签 */
.subsystem-tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subsystem-tab:hover {
    color: #334155;
    background-color: #e2e8f0;
}

.subsystem-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.subsystem-tab[data-subsystem="sales"].active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.subsystem-tab[data-subsystem="procurement"].active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.subsystem-tab[data-subsystem="operation"].active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.subsystem-tab[data-subsystem="product"].active {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

/* 侧边栏菜单 */
.menu-section {
    margin-bottom: 20px;
}

.menu-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.menu-item i {
    width: 20px;
    font-size: 14px;
    margin-right: 10px;
    color: #94a3b8;
}

.menu-item:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.menu-item:hover i {
    color: #64748b;
}

.menu-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.menu-item.active i {
    color: #2563eb;
}

/* 销售端激活样式 */
#menu-sales .menu-item.active {
    background-color: #ecfdf5;
    color: #059669;
}
#menu-sales .menu-item.active i {
    color: #059669;
}

/* 采购端激活样式 */
#menu-procurement .menu-item.active {
    background-color: #fffbeb;
    color: #d97706;
}
#menu-procurement .menu-item.active i {
    color: #d97706;
}

/* 运营端激活样式 */
#menu-operation .menu-item.active {
    background-color: #f5f3ff;
    color: #7c3aed;
}
#menu-operation .menu-item.active i {
    color: #7c3aed;
}

/* 商品中台激活样式 */
#menu-product .menu-item.active {
    background-color: #ecfeff;
    color: #0891b2;
}
#menu-product .menu-item.active i {
    color: #0891b2;
}

/* 卡片组件 */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 8px;
    color: #64748b;
}

.card-body {
    padding: 20px;
}

/* 统计卡片 */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-icon.sales {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
}

.stat-icon.procurement {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
}

.stat-icon.operation {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
}

.stat-icon.product {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    color: #0891b2;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
}

.stat-icon.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.stat-trend.up {
    color: #059669;
}

.stat-trend.down {
    color: #dc2626;
}

.stat-trend i {
    margin-right: 4px;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background-color: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.success {
    background-color: #ecfdf5;
    color: #059669;
}

.status-tag.warning {
    background-color: #fffbeb;
    color: #d97706;
}

.status-tag.danger {
    background-color: #fef2f2;
    color: #dc2626;
}

.status-tag.info {
    background-color: #eff6ff;
    color: #2563eb;
}

.status-tag.neutral {
    background-color: #f1f5f9;
    color: #64748b;
}

/* 等级标签 */
.level-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.level-tag.s {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
}

.level-tag.a {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
    color: #fff;
}

.level-tag.b {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
}

.level-tag.c {
    background-color: #e2e8f0;
    color: #64748b;
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar .progress.sales {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-bar .progress.procurement {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-bar .progress.operation {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.progress-bar .progress.product {
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 搜索筛选区 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-input {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.filter-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select {
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* 漏斗图样式 */
.funnel-stage {
    position: relative;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.funnel-stage:hover {
    transform: scale(1.02);
}

.funnel-bar {
    height: 48px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    font-weight: 500;
    margin: 0 auto;
}

.funnel-label {
    font-size: 14px;
}

.funnel-value {
    font-size: 16px;
    font-weight: 700;
}

/* 任务项样式 */
.task-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.task-item:hover {
    background-color: #f8fafc;
}

.task-item:last-child {
    border-bottom: none;
}

.task-priority {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    margin-right: 14px;
}

.task-priority.high {
    background-color: #ef4444;
}

.task-priority.medium {
    background-color: #f59e0b;
}

.task-priority.low {
    background-color: #3b82f6;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.task-meta {
    font-size: 12px;
    color: #94a3b8;
}

/* 客户画像标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    background-color: #f1f5f9;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background-color: #e2e8f0;
}

.tag-item.active {
    background-color: #3b82f6;
    color: #fff;
}

/* 时间轴样式 */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #3b82f6;
}

.timeline-item.success::before {
    background-color: #10b981;
    box-shadow: 0 0 0 2px #10b981;
}

.timeline-item.warning::before {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b;
}

.timeline-time {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 13px;
    color: #475569;
}

/* 页面标题 */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: #64748b;
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.pagination button.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab:hover {
    color: #1e293b;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background-color: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    background-color: #1e293b;
    color: #fff;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #94a3b8;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    #sidebar {
        width: 200px;
    }
    #main-content {
        margin-left: 200px;
    }
}

@media (max-width: 992px) {
    #sidebar {
        width: 60px;
    }
    #main-content {
        margin-left: 60px;
    }
    .menu-title,
    .menu-item span {
        display: none;
    }
    .menu-item {
        justify-content: center;
    }
    .menu-item i {
        margin-right: 0;
    }
}

/* 头像样式 */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid #fff;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* 数字指标样式 */
.metric {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.metric-label {
    font-size: 12px;
    color: #64748b;
}

/* 网格布局辅助 */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* 任务驱动标识 */
.task-driven-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

.task-driven-badge i {
    margin-right: 4px;
}

/* 数据同源标识 */
.data-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

/* 闭环管理标识 */
.loop-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}
