/* 数据统计 BI 页 - Pantone 2026 Atmospheric 色盘 */
.stats-page {
    background: var(--color-canvas);
    min-height: 100vh;
}

.stats-page .stats-main {
    overflow-y: auto;
    overflow-x: hidden;
}

.stats-content {
    padding: 32px 40px 56px;
    max-width: none;
    margin: 0;
}

/* ----- 导航 ----- */
.stats-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.stats-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.2s ease;
}

.stats-nav-item:hover {
    background: var(--color-sidebar-active);
    color: var(--color-text-main);
}

.stats-nav-item.active {
    background: var(--color-sidebar-active);
    color: var(--color-text-main);
    font-weight: 600;
}

.stats-nav-icon {
    font-size: 18px;
}

.stats-page .menu-list li {
    cursor: pointer;
}

.stats-page .menu-list li:hover {
    background: var(--color-sidebar-active);
    color: var(--color-text-main);
}

/* ----- KPI 卡片 ----- */
.stats-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}

.stats-kpi-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(72, 122, 183, 0.08);
    border: 1px solid rgba(72, 122, 183, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: statsCardEnter 0.6s ease backwards;
}

.stats-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(72, 122, 183, 0.15);
}

.stats-kpi-icon {
    font-size: 28px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stats-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stats-kpi-card.stats-kpi--knowledge .stats-kpi-value { color: #91cc75; }
.stats-kpi-card.stats-kpi--ability .stats-kpi-value { color: #fac858; }
.stats-kpi-card.stats-kpi--quality .stats-kpi-value { color: #9a60b4; }

.stats-kpi-label {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

@keyframes statsCardEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- 图表区 ----- */
.stats-charts {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr);
    gap: 28px;
    margin-bottom: 36px;
}

.stats-chart-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(72, 122, 183, 0.08);
    border: 1px solid rgba(72, 122, 183, 0.12);
    animation: statsCardEnter 0.6s ease 0.15s backwards;
}

.stats-chart-card--wide {
    grid-column: 1;
}

.stats-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(72, 122, 183, 0.1);
}

.stats-chart {
    width: 100%;
    height: 320px;
}

.stats-chart-card:last-child .stats-chart {
    height: 280px;
}

/* ----- 表格 ----- */
.stats-table-section {
    animation: statsCardEnter 0.6s ease 0.25s backwards;
}

.stats-table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 16px;
}

.stats-table-wrap {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(72, 122, 183, 0.08);
    border: 1px solid rgba(72, 122, 183, 0.12);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(72, 122, 183, 0.08);
}

.stats-table th {
    background: rgba(72, 122, 183, 0.06);
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 13px;
}

.stats-table tbody tr {
    animation: statsRowEnter 0.4s ease backwards;
    transition: background 0.2s ease;
}

.stats-table tbody tr:hover {
    background: rgba(183, 208, 234, 0.2);
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table td {
    color: var(--color-text-main);
    font-size: 14px;
}

.stats-table-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.stats-table-link:hover {
    color: #355f8f;
    text-decoration: underline;
}

@keyframes statsRowEnter {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stats-error {
    text-align: center;
    color: var(--color-text-muted);
    padding: 48px 24px;
}

/* ----- 使用指南布局 ----- */
.guide-header {
    margin-bottom: 8px;
}

.guide-header-main h2 {
    margin-bottom: 4px;
    color: var(--color-primary);
}

.guide-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}

.guide-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 4px;
}

.guide-toc {
    background: rgba(183, 208, 234, 0.45);
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.guide-toc-item {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--color-text-main);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.guide-toc-item:hover {
    background: rgba(72, 122, 183, 0.16);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.guide-toc-item.active {
    background: var(--color-primary);
    color: #fff;
}

.guide-content {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 24px 26px 32px;
    box-shadow: 0 2px 12px rgba(72, 122, 183, 0.08);
    border: 1px solid rgba(72, 122, 183, 0.12);
}

.guide-section + .guide-section {
    margin-top: 32px;
}

.guide-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text-main);
}

.guide-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--color-text-main);
}

.guide-section p {
    font-size: 14px;
    color: var(--color-text-main);
    line-height: 1.7;
    margin-bottom: 6px;
}

.guide-section ul,
.guide-section ol {
    padding-left: 20px;
    margin: 4px 0 8px;
    font-size: 14px;
    color: var(--color-text-main);
    line-height: 1.7;
}

.guide-section li + li {
    margin-top: 2px;
}

/* ----- 响应式 ----- */
@media (max-width: 1200px) {
    .stats-kpi {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-charts {
        grid-template-columns: 1fr;
    }
    .stats-chart-card--wide {
        grid-column: auto;
    }
    .guide-toc {
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .stats-content {
        padding: 16px 20px 32px;
    }
    .stats-kpi {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-bottom: 24px;
    }
    .stats-kpi-value {
        font-size: 26px;
    }
    .stats-chart {
        height: 260px;
    }
    .stats-table th,
    .stats-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-kpi {
        grid-template-columns: 1fr;
    }
}
