/* Sales dashboard UI V4.2: PPVI-inspired restrained visual system */

:root {
    color-scheme: light;
    --font-sans: "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system, sans-serif;

    --fs-xs: 12px;
    --fs-sm: 17px;
    --fs-md: 24px;
    --fs-lg: 34px;
    --fs-xl: 48px;

    --lh-tight: 1.12;
    --lh-body: 1.52;
    --lh-loose: 1.72;

    --bg: #f4f5f7;
    --bg-elevated: rgba(255, 255, 255, 0.78);
    --bg-solid: #ffffff;
    --bg-muted: rgba(248, 250, 252, 0.86);
    --bg-header: rgba(255, 255, 255, 0.82);
    --ink: #111827;
    --ink-soft: #334155;
    --ink-muted: #64748b;
    --ink-faint: #98a2b3;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);
    --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.07);
    --shadow-card: 0 12px 34px rgba(15, 23, 42, 0.08);
    --blur: blur(18px);

    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.11);
    --accent-ink: #1d4ed8;
    --good: #15803d;
    --bad: #dc2626;
    --warn: #b45309;
    --purple: #6d28d9;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0f141c;
        --bg-elevated: rgba(23, 28, 38, 0.72);
        --bg-solid: #171c26;
        --bg-muted: rgba(30, 36, 48, 0.76);
        --bg-header: rgba(17, 24, 39, 0.78);
        --ink: #f8fafc;
        --ink-soft: #d8dee9;
        --ink-muted: #9aa6b8;
        --ink-faint: #697386;
        --line: rgba(226, 232, 240, 0.1);
        --line-strong: rgba(226, 232, 240, 0.18);
        --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.28);
        --shadow-card: 0 14px 42px rgba(0, 0, 0, 0.34);
        --accent: #60a5fa;
        --accent-soft: rgba(96, 165, 250, 0.13);
        --accent-ink: #93c5fd;
        --good: #4ade80;
        --bad: #f87171;
        --warn: #fbbf24;
        --purple: #c4b5fd;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f141c;
    --bg-elevated: rgba(23, 28, 38, 0.72);
    --bg-solid: #171c26;
    --bg-muted: rgba(30, 36, 48, 0.76);
    --bg-header: rgba(17, 24, 39, 0.78);
    --ink: #f8fafc;
    --ink-soft: #d8dee9;
    --ink-muted: #9aa6b8;
    --ink-faint: #697386;
    --line: rgba(226, 232, 240, 0.1);
    --line-strong: rgba(226, 232, 240, 0.18);
    --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.28);
    --shadow-card: 0 14px 42px rgba(0, 0, 0, 0.34);
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.13);
    --accent-ink: #93c5fd;
    --good: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --purple: #c4b5fd;
}

html[data-theme="light"] {
    color-scheme: light;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system, sans-serif;
    background: #f3f5f7;
    color: #334155;
    font-size: 16px;
    overflow-x: hidden;
}

header {
    background: #ffffff;
    border-bottom: 1px solid rgba(15,23,42,0.06);
    padding: 20px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-eyebrow {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
    letter-spacing: 0;
}

#header-sub {
    color: #64748b;
}

nav {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px; /* F010: 与上方日期行留白，避免挤在一起 */
}

nav button {
    padding: 8px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.03);
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

nav button:hover {
    background: rgba(0,0,0,0.06);
}

nav button.active {
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 600;
    border-color: #0ea5e9;
}

.nav-export {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.28);
    font-weight: 700;
}

.nav-admin {
    background: rgba(2,132,199,0.12);
    color: #0369a1;
    border-color: rgba(2,132,199,0.28);
}

.nav-back {
    background: rgba(15,23,42,0.04);
    border-color: rgba(15,23,42,0.12);
}

.breadcrumb {
    font-size: 15px;
    color: #64748b;
    margin-right: auto; 
    font-weight: 500;
}

main {
    padding: 24px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 16px;
    max-width: 1760px;
    margin: 0 auto;
    padding: 24px 32px;
    align-items: start;
}

.dashboard-shell main {
    padding: 0;
    max-width: none;
    width: 100%;
    min-width: 0;
}

.dashboard-sidebar {
    position: sticky;
    top: 126px;
    display: grid;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.06);
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15,23,42,0.07);
}

.dashboard-sidebar label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-top: 4px;
}

.dashboard-sidebar select,
.dashboard-sidebar button {
    width: 100%;
    min-width: 0;
    border-radius: 6px;
    border: 1px solid rgba(15,23,42,0.12);
    background: #ffffff;
    color: #334155;
    font-size: 13px;
}

.dashboard-sidebar select {
    padding: 7px 8px;
}

.dashboard-sidebar button {
    padding: 7px 8px;
    cursor: pointer;
    font-weight: 600;
}

.dashboard-sidebar button:hover {
    border-color: rgba(14,165,233,0.45);
    color: #0369a1;
    background: #f0f9ff;
}

.dashboard-sidebar .sidebar-home {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0ea5e9;
}

.dashboard-sidebar .sidebar-marketing {
    background: #f8fafc;
    color: #334155;
    border-color: rgba(15,23,42,0.12);
}

.dashboard-sidebar .sidebar-marketing:hover {
    color: #0369a1;
    background: #f0f9ff;
}

.dashboard-sidebar .sidebar-home:hover {
    color: #ffffff;
    background: #0284c7;
}

.loading {
    text-align: center;
    padding: 80px;
    color: #0284c7;
    font-size: 17px;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* SECTION WIDGETS */
.widget-section {
    margin-bottom: 32px;
}

.sec-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.sec-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, #0ea5e9, #6366f1);
    margin-right: 12px;
    border-radius: 4px;
}

/* PROCESS ANALYSIS CARDS (统一于 widget-section 视觉风格) */
.card {
    margin-bottom: 32px;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.card-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, #0ea5e9, #6366f1);
    margin-right: 12px;
    border-radius: 4px;
}

/* GLASSMORPHISM CARDS */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(14, 165, 233, 0.3);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(to right, #0ea5e9, #6366f1);
    opacity: 0.9;
}

.kpi-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
}

.kpi-value {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.kpi-value.primary { color: #0284c7; }
.kpi-value.success { color: #10b981; }
.kpi-value.warning { color: #f59e0b; }
.kpi-value.danger { color: #ef4444; }

.kpi-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* UTILS */
.up-green { color: #10b981; font-weight: 600; }
.down-red { color: #ef4444; font-weight: 600; }
/* 同比幅度分档(±20%)：强档深、弱档浅，降低"满屏红"对视觉层级的干扰 */
.up-strong   { color: #15803d; font-weight: 700; }
.up-mild     { color: #6cae8a; font-weight: 600; }
.down-strong { color: #dc2626; font-weight: 700; }
.down-mild   { color: #e09b9b; font-weight: 600; }

/* DATA TABLES */
.full-panel {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    min-width: 700px;
    color: #334155;
}

table th {
    padding: 12px 10px;
    color: #64748b;
    font-weight: 600;
    font-size: 15px;
    text-align: right;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table th.bg-blue, table th.bg-green, table th.bg-darkblue {
    background: transparent;
    color: #475569;
}

table td {
    padding: 16px 12px;
    text-align: right;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table th:first-child, table td:first-child { text-align: left; }

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover td {
    background-color: rgba(0,0,0,0.02);
}

.td-bold {
    font-weight: 600;
    color: #0f172a;
}

/* Process table resets */
.process-table th {
    font-size: 15px !important;
}
.process-table td.num {
    font-family: "JetBrains Mono", "Consolas", monospace;
    font-size: 16px;
    text-align: center;
}

/* SPLIT LISTS */
.split-list-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* CHARTS */
.chart-container {
    height: 400px;
    width: 100%;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
.analysis-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-height: 320px;
    padding: 20px;
}

.muted {
    color: #94a3b8;
    font-weight: 500;
}

.core-v21-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 1fr) minmax(360px, 1.45fr) minmax(300px, 1.05fr);
    gap: 16px;
}

.core-v21-card {
    display: flex;
    flex-direction: column;
    gap: 13px;
    width: 100%;
    min-height: 248px;
    padding: 18px 20px;
    text-align: left;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15,23,42,0.06);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15,23,42,0.06);
    cursor: pointer;
    color: #334155;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    min-width: 0;
}

.core-v21-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14,165,233,0.28);
    box-shadow: 0 14px 28px rgba(15,23,42,0.09);
}

.core-v21-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(15,23,42,0.07);
}

.core-v21-card-head span {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.core-v21-card-head strong {
    font-size: 36px;
    color: #0ea5e9;
    line-height: 1;
    white-space: nowrap;
}

.core-v21-card-head em {
    font-style: normal;
    font-size: 14px;
    color: #64748b;
    text-align: right;
}

.core-v21-ranks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.core-v21-rank {
    display: inline-flex;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
}

.core-v21-main {
    display: grid;
    gap: 10px;
}

.core-v21-main div,
.core-v21-line,
.core-v21-process-item {
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.05);
    border-radius: 6px;
    padding: 10px;
}

.core-v21-main label {
    display: block;
    font-size: 15px;
    color: #64748b;
    margin-bottom: 4px;
}

.core-v21-main b {
    font-size: 26px;
    color: #0f172a;
}

.core-v21-main small {
    display: block;
    margin-top: 4px;
    font-size: 15px;
}

.core-v21-card.sales .core-v21-main small {
    font-size: 17px;
    font-weight: 800;
}

.core-v21-lines {
    display: grid;
    gap: 10px;
}

.core-v21-line > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.core-v21-line > div:first-child span {
    font-size: 15px;
    color: #64748b;
}

.core-v21-line > div:last-child {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    font-size: 15px;
}

.core-v21-four {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.core-v21-product {
    padding: 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.05);
}

.core-v21-product strong,
.core-v21-product span,
.core-v21-product small {
    display: block;
}

.core-v21-product strong {
    color: #0f172a;
    font-size: 17px;
    margin-bottom: 4px;
}

.core-v21-product span {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 5px;
}

.core-v21-product small {
    color: #475569;
    font-size: 14px;
    line-height: 1.65;
}

.core-v21-product .up-green,
.core-v21-line .up-green,
.core-v21-main .up-green {
    color: #10b981 !important;
}

.core-v21-product .down-red,
.core-v21-line .down-red,
.core-v21-main .down-red {
    color: #ef4444 !important;
}

.core-v21-process {
    display: grid;
    gap: 8px;
}

.core-v21-process-item {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 6px 10px;
    align-items: baseline;
}

.core-v21-process-item span {
    color: #475569;
    font-size: 16px;
}

.core-v21-process-item b {
    color: #0f172a;
    font-size: 22px;
}

.core-v21-process-item small {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 14px;
}

.four-product-table th,
.four-product-table td {
    font-size: 14px;
}

@media (max-width: 1600px) {
    .dashboard-shell {
        grid-template-columns: 132px minmax(0, 1fr);
    }
    .core-v21-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .core-v21-four {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 1200px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    .split-list-container {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   移动端适配 (P0-2)
   ══════════════════════════════════════════════════════════ */

/* ── 平板适配 (768px ~ 1024px) ── */
@media (max-width: 1024px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }
    .sidebar-title {
        width: 100%;
        border-bottom: none;
        padding-bottom: 4px;
    }
    .dashboard-sidebar label {
        display: none;
    }
    .dashboard-sidebar select {
        flex: 1 1 140px;
    }
    .dashboard-sidebar button {
        flex: 1 1 100px;
    }
    .core-v21-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── 手机适配 (≤768px) ── */
@media (max-width: 768px) {
    /* 手机端改为专题报告式阅读流 */
    html,
    body,
    #app,
    .dashboard-shell,
    .dashboard-shell main,
    .overview,
    .widget-section {
        max-width: 100%;
        min-width: 0;
    }

    body {
        font-size: 14px;
        background: #f2f4f6;
    }

    header {
        position: relative;
        padding: 24px 18px 26px;
        background: #17233d;
        color: #ffffff;
        border-bottom: none;
        border-radius: 0;
    }
    .header-eyebrow {
        color: rgba(226,232,240,0.62);
        font-size: 12px;
        margin-bottom: 6px;
    }
    header h1 {
        font-size: 29px;
        line-height: 1.18;
        margin-bottom: 8px;
        color: #ffffff;
        letter-spacing: 0;
    }
    #header-sub {
        display: block;
        max-width: 320px;
        font-size: 13px !important;
        line-height: 1.45;
        color: rgba(203,213,225,0.72) !important;
        margin-top: 0 !important;
    }

    nav {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 18px;
    }
    nav > div:first-child {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    nav button {
        flex: 0 0 auto;
        padding: 8px 13px;
        font-size: 12px;
        line-height: 1;
        color: rgba(226,232,240,0.92);
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.14);
        border-radius: 999px;
        box-shadow: none;
        transition: none;
    }
    nav button.active {
        background: rgba(96,165,250,0.72);
        border-color: rgba(147,197,253,0.5);
        color: #ffffff;
    }
    .nav-back,
    .nav-export,
    .nav-admin {
        background: rgba(255,255,255,0.1);
        color: rgba(226,232,240,0.92);
        border-color: rgba(255,255,255,0.14);
    }
    .breadcrumb {
        flex: 1 1 100%;
        width: 100%;
        font-size: 13px;
        color: rgba(226,232,240,0.8);
        font-weight: 700;
        margin-right: 0;
    }

    .dashboard-shell {
        padding: 0 14px 28px;
        gap: 14px;
    }
    .dashboard-shell main {
        padding: 0;
    }

    .dashboard-sidebar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        width: calc(100% + 28px);
        max-width: calc(100% + 28px);
        min-width: 0;
        padding: 12px 14px;
        margin: -1px -14px 6px;
        background: #ffffff;
        border: none;
        border-bottom: 1px solid rgba(15,23,42,0.06);
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 18px rgba(15,23,42,0.05);
        scrollbar-width: none;
    }
    .dashboard-sidebar::-webkit-scrollbar {
        display: none;
    }
    .sidebar-title {
        display: none;
    }
    .dashboard-sidebar label {
        display: none;
    }
    .dashboard-sidebar select,
    .dashboard-sidebar button {
        flex: 0 0 auto;
        max-width: 150px;
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 12px;
        border-radius: 999px;
        border-color: rgba(15,23,42,0.1);
        background: #f8fafc;
        color: #334155;
    }
    .dashboard-sidebar .sidebar-home {
        order: -1;
        max-width: none;
        background: #17233d;
        border-color: #17233d;
        color: #ffffff;
    }

    .overview {
        display: block;
    }

    .kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .kpi-card {
        min-height: 100px;
        padding: 14px 10px;
        text-align: center;
        border: 1px solid rgba(15,23,42,0.04);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(15,23,42,0.06);
        transition: none;
    }
    .kpi-card:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(15,23,42,0.06);
    }
    .kpi-label {
        font-size: 12px;
        margin-bottom: 8px;
        color: #9ca3af;
        font-weight: 700;
    }
    .kpi-value {
        font-size: 22px;
        line-height: 1.15;
    }
    .kpi-sub {
        font-size: 12px;
        margin-top: 8px;
        padding-top: 8px;
        line-height: 1.35;
    }

    .sec-title, .card-title {
        font-size: 16px;
        margin-bottom: 12px;
        color: #9ca3af;
        font-weight: 800;
    }
    .sec-title::before,
    .card-title::before {
        display: none;
    }

    .widget-section {
        margin: 24px 0 0;
    }
    .full-panel {
        max-width: 100%;
        min-width: 0;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid rgba(15,23,42,0.05);
        box-shadow: 0 4px 14px rgba(15,23,42,0.06);
    }

    table {
        min-width: 560px;
        font-size: 13px;
        background: #ffffff;
    }
    table th {
        padding: 10px 8px;
        font-size: 12px;
        background: #17233d;
        color: rgba(226,232,240,0.76);
        border-bottom: none;
        text-transform: none;
        letter-spacing: 0;
    }
    table td {
        padding: 12px 8px;
        border-bottom: 1px solid rgba(15,23,42,0.06);
    }
    table th.bg-blue, table th.bg-green, table th.bg-darkblue {
        background: #17233d;
        color: rgba(226,232,240,0.76);
    }
    table tbody tr:hover td {
        background-color: transparent;
    }

    .core-v21-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .core-v21-card {
        min-height: auto;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 4px 14px rgba(15,23,42,0.06);
        transition: none;
    }
    .core-v21-card:hover {
        transform: none;
        box-shadow: 0 4px 14px rgba(15,23,42,0.06);
    }
    .core-v21-card-head span {
        font-size: 15px;
    }
    .core-v21-card-head strong {
        font-size: 30px;
    }
    .core-v21-card.sales .core-v21-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .core-v21-card.sales .core-v21-main div {
        min-height: 92px;
    }
    .core-v21-card.sales .core-v21-main div:first-child {
        grid-column: 1 / -1;
        min-height: 84px;
    }
    .core-v21-card.sales .core-v21-main b {
        font-size: 25px;
    }
    .core-v21-card.sales .core-v21-main small {
        font-size: 14px;
        line-height: 1.25;
    }
    .core-v21-card.sales .core-v21-main .down-red,
    .core-v21-card.sales .core-v21-main .up-green {
        display: block;
        margin-top: 6px;
        font-size: 16px;
    }
    .core-v21-rank {
        font-size: 15px;
        padding: 4px 10px;
        background: #e8f2ff;
        color: #2563eb;
    }
    .core-v21-main b {
        font-size: 22px;
    }
    .core-v21-main label {
        font-size: 13px;
    }
    .core-v21-main small {
        font-size: 13px;
    }
    .core-v21-process-item span {
        font-size: 13px;
    }
    .core-v21-process-item b {
        font-size: 18px;
    }
    .core-v21-main div,
    .core-v21-line,
    .core-v21-process-item,
    .core-v21-product {
        background: #f8fafc;
        border-color: rgba(15,23,42,0.05);
    }

    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .analysis-card {
        min-height: 200px;
        padding: 14px;
    }

    /* 图表缩小高度 */
    .chart-container {
        height: 280px;
    }

    .split-list-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 进度条和状态徽章缩小 */
    .muted {
        font-size: 12px;
    }
}

/* ── 小屏手机 (≤480px) ── */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    header {
        padding: 24px 18px 26px;
    }
    header h1 {
        font-size: 28px;
    }
    .dashboard-shell {
        padding: 0 14px 26px;
    }
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .kpi-card {
        padding: 13px 9px;
    }
    .kpi-value {
        font-size: 21px;
    }
    .sec-title, .card-title {
        font-size: 16px;
    }
    .full-panel {
        padding: 0;
    }
    table {
        min-width: 540px;
        font-size: 12px;
    }
    .chart-container {
        height: 240px;
    }
    .core-v21-card-head strong {
        font-size: 24px;
    }
    .core-v21-line > div:last-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .core-v21-line > div:first-child {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .core-v21-four {
        grid-template-columns: 1fr;
    }
    nav button {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* ══════════════════════════════════════════════════════════
   V4.2 PPVI 视觉系统覆盖层
   ══════════════════════════════════════════════════════════ */

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 18% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
        linear-gradient(180deg, color-mix(in srgb, var(--bg) 86%, #ffffff 14%) 0%, var(--bg) 52%);
    color: var(--ink-soft);
    line-height: var(--lh-body);
}

header {
    background: var(--bg-header);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset;
    padding: 18px 32px 16px;
}

.header-eyebrow {
    color: var(--ink-faint);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0;
}

header h1 {
    color: var(--ink);
    font-size: var(--fs-lg);
    font-weight: 800;
    line-height: var(--lh-tight);
    margin-bottom: 6px;
}

#header-sub {
    color: var(--ink-muted) !important;
    font-size: var(--fs-xs) !important;
    line-height: 1.45;
}

nav {
    gap: 10px;
}

nav button,
.dashboard-sidebar button,
.dashboard-sidebar select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--bg-solid) 82%, transparent);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 700;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

nav button:hover,
.dashboard-sidebar button:hover {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 36%, var(--line-strong));
    color: var(--accent-ink);
    transform: translateY(-1px);
}

nav button.active,
.dashboard-sidebar .sidebar-home {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.dashboard-sidebar .sidebar-marketing {
    background: var(--bg-muted);
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.nav-export {
    background: color-mix(in srgb, var(--warn) 9%, var(--bg-solid));
    border-color: color-mix(in srgb, var(--warn) 24%, var(--line));
    color: var(--warn);
}

.nav-admin {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
    color: var(--accent-ink);
}

.nav-icon {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 6px;
    vertical-align: -2px;
    color: currentColor;
}

.nav-back .nav-icon::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(2px, -1px);
}

.nav-export .nav-icon {
    position: relative;
    border: 1.8px solid currentColor;
    border-top: 0;
    border-radius: 0 0 2px 2px;
}

.nav-export .nav-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    top: -5px;
    height: 8px;
    border-left: 1.8px solid currentColor;
}

.nav-export .nav-icon::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 1px;
    width: 6px;
    height: 6px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
}

.nav-admin .nav-icon {
    position: relative;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.nav-admin .nav-icon::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: currentColor;
}

.breadcrumb {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.dashboard-shell {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 18px;
    max-width: 1760px;
    padding: 24px 32px 36px;
}

.dashboard-sidebar,
.kpi-card,
.full-panel,
.analysis-card,
.core-v21-card {
    background: var(--bg-elevated);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.dashboard-sidebar {
    top: 122px;
    padding: 12px;
}

.sidebar-title {
    color: var(--ink);
    font-size: var(--fs-xs);
    letter-spacing: 0;
    border-bottom-color: var(--line);
}

.dashboard-sidebar label {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
}

.dashboard-sidebar select {
    background: var(--bg-solid);
    color: var(--ink-soft);
}

.widget-section,
.card {
    margin-bottom: 30px;
}

.sec-title,
.card-title {
    color: var(--ink);
    font-size: var(--fs-md);
    line-height: var(--lh-tight);
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 16px;
}

.sec-title::before,
.card-title::before {
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 999px;
    opacity: .78;
}

.kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.kpi-card,
.core-v21-card,
.analysis-card {
    box-shadow: var(--shadow-card);
}

.kpi-card {
    padding: 18px;
}

.kpi-card::before {
    height: 2px;
    background: var(--line-strong);
}

.kpi-card:hover,
.core-v21-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
    box-shadow: var(--shadow-card);
}

.kpi-label {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.kpi-value {
    color: var(--ink);
    font-size: var(--fs-lg);
    line-height: var(--lh-tight);
}

.kpi-value.primary,
.core-v21-card-head strong {
    color: var(--accent);
}

.kpi-value.success,
.up-green {
    color: var(--good) !important;
}

.kpi-value.warning {
    color: var(--warn);
}

.kpi-value.danger,
.down-red {
    color: var(--bad) !important;
}

.kpi-sub {
    color: var(--ink-muted);
    border-top-color: var(--line);
}

.full-panel {
    padding: 18px;
    width: 100%;
    max-width: 100%;
}

table {
    color: var(--ink-soft);
    font-size: var(--fs-xs);
}

table th {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    border-bottom-color: var(--line);
}

table td {
    border-bottom-color: var(--line);
}

table th.bg-blue,
table th.bg-green,
table th.bg-darkblue {
    background: transparent;
    color: var(--ink-muted);
}

table tbody tr:hover td {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.branch-completion-table thead th {
    text-align: center;
    vertical-align: middle;
    line-height: 1.25;
}

.branch-completion-table thead th:first-child {
    text-align: left;
}

.branch-completion-table thead tr:first-child th {
    padding-top: 13px;
    padding-bottom: 13px;
}

.branch-completion-table thead tr:nth-child(2) th {
    padding-top: 8px;
    padding-bottom: 10px;
}

.table-action {
    min-width: 44px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: var(--fs-xs);
    font-weight: 800;
    cursor: pointer;
}

.table-action:hover {
    background: var(--accent);
    color: #ffffff;
}

.table-note {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    line-height: 1.5;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 800;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--ink-faint);
}

.status-badge.good::before {
    background: var(--good);
}

.status-badge.warn::before {
    background: var(--warn);
}

.status-badge.bad::before {
    background: var(--bad);
}

.progress-cell {
    display: inline-grid;
    grid-template-columns: minmax(56px, var(--progress-width)) auto;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    color: var(--ink-muted);
    font-size: var(--fs-xs);
}

.progress-track {
    position: relative;
    height: 6px;
    overflow: visible;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink-faint) 16%, transparent);
}

.progress-fill {
    width: var(--bar);
    height: 100%;
    border-radius: inherit;
    background: var(--bad);
}

.progress-track.good .progress-fill {
    background: var(--good);
}

.progress-marker {
    position: absolute;
    top: -2px;
    left: var(--marker);
    width: 2px;
    height: 10px;
    border-radius: 999px;
    background: var(--ink-muted);
}

.chart-filter-panel {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.chart-filter-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.chart-filter-title {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 800;
    display: grid;
    gap: 6px;
    line-height: 1.25;
}

.chart-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.chart-filter-actions button {
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-solid) 72%, transparent);
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 800;
    cursor: pointer;
}

.chart-filter-actions button:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
    color: var(--accent-ink);
    background: var(--accent-soft);
}

.chart-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chart-filter-options.branch-options {
    max-height: 68px;
    overflow-y: auto;
    padding-right: 4px;
}

.chart-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-solid) 72%, transparent);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
}

.chart-filter-chip input {
    width: 12px;
    height: 12px;
    accent-color: var(--accent);
}

.chart-filter-swatch {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.42) inset;
}

.marketing-section .full-panel {
    overflow-x: auto;
}

.marketing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.marketing-summary-card {
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.marketing-summary-card span,
.marketing-summary-card em {
    display: block;
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-style: normal;
    font-weight: 700;
}

.marketing-summary-card strong {
    display: block;
    margin: 8px 0 6px;
    color: var(--ink);
    font-size: var(--fs-lg);
    line-height: var(--lh-tight);
}

.marketing-summary-card.good strong {
    color: var(--good);
}

.marketing-summary-card.bad strong {
    color: var(--bad);
}

.marketing-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.marketing-focus-panel {
    padding: 16px;
}

.marketing-panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--ink);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.marketing-panel-title span {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.marketing-extreme-list {
    display: grid;
    gap: 8px;
}

.marketing-extreme-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-solid) 68%, transparent);
}

.marketing-extreme-item > span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 900;
}

.marketing-extreme-item strong,
.marketing-extreme-item em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-extreme-item strong {
    color: var(--ink);
    font-size: var(--fs-xs);
}

.marketing-extreme-item em {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-style: normal;
}

.marketing-extreme-item b {
    color: var(--ink);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.marketing-extreme-item.good b {
    color: var(--good);
}

.marketing-extreme-item.bad b {
    color: var(--bad);
}

.marketing-detail {
    margin-top: 12px;
    color: var(--ink-soft);
}

.marketing-detail summary {
    width: fit-content;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-weight: 800;
    cursor: pointer;
}

.marketing-detail-panel {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
}

.marketing-focus-table {
    min-width: 620px;
}

.marketing-product-placeholder p,
.marketing-empty {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    line-height: 1.6;
}

.marketing-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.marketing-product-tags span {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    font-weight: 800;
}

.td-bold,
.core-v21-card-head span,
.core-v21-main b,
.core-v21-product strong,
.core-v21-process-item b {
    color: var(--ink);
}

.core-v21-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.core-v21-card {
    min-height: 236px;
    padding: 18px;
    color: var(--ink-soft);
    min-width: 0;
}

.core-v21-card-head {
    border-bottom-color: var(--line);
}

.core-v21-card-head span {
    font-size: var(--fs-sm);
}

.core-v21-card-head strong {
    font-size: var(--fs-lg);
}

.core-v21-card-head em,
.core-v21-main label,
.core-v21-main small,
.core-v21-line > div:first-child span,
.core-v21-product span,
.core-v21-product small,
.core-v21-process-item span,
.core-v21-process-item small,
.muted {
    color: var(--ink-muted);
}

.core-v21-rank {
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: var(--fs-sm);
    border-radius: 999px;
}

.core-v43-insight {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-elevated) 76%, var(--bg-muted));
    color: var(--ink-soft);
}

.core-v43-insight span {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
}

.core-v43-insight strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: var(--fs-sm);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.core-v43-insight em {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    font-style: normal;
    white-space: nowrap;
}

.core-v43-insight.good {
    border-color: color-mix(in srgb, var(--good) 22%, var(--line));
}

.core-v43-insight.good em {
    color: var(--good);
    font-weight: 700;
}

.core-v43-insight.bad {
    border-color: color-mix(in srgb, var(--bad) 22%, var(--line));
}

.core-v43-insight.bad em {
    color: var(--bad);
    font-weight: 700;
}

.core-v21-main div,
.core-v21-line,
.core-v21-process-item,
.core-v21-product {
    background: var(--bg-muted);
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

.panel-title {
    color: var(--ink) !important;
    font-size: var(--fs-sm);
    letter-spacing: 0;
}

.core-v42-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.core-v42-section-head .sec-title {
    margin-bottom: 0;
}

.core-v42-caption {
    max-width: 460px;
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    line-height: 1.45;
    text-align: right;
}

.core-v42-level-regional .core-v21-card[data-core-role="process"],
.core-v42-level-branch .core-v21-card[data-core-role="process"],
.core-v42-level-group .core-v21-card[data-core-role="process"] {
    border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.core-v42-level-branch .core-v21-card[data-core-role="four"],
.core-v42-level-group .core-v21-card[data-core-role="four"] {
    border-color: color-mix(in srgb, var(--warn) 16%, var(--line));
}

.trend-narrative {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.trend-narrative-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-elevated) 82%, var(--bg-muted));
}

.trend-narrative-title {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.trend-narrative-list {
    display: grid;
    gap: 8px;
}

.trend-narrative-item {
    position: relative;
    padding-left: 13px;
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    line-height: 1.55;
}

.trend-narrative-item::before {
    content: "";
    position: absolute;
    top: .72em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--ink-faint);
}

.trend-narrative-item.good::before {
    background: var(--good);
}

.trend-narrative-item.bad::before {
    background: var(--bad);
}

.chart-container {
    min-height: 340px;
}

.dashboard-shell,
#main-content,
.overview,
.widget-section {
    min-width: 0;
}

.overview,
.widget-section {
    max-width: 100%;
}

.widget-section {
    overflow-x: clip;
}

.widget-section > div:not(.sec-title):not(.split-list-container),
.card > div:not(.card-title) {
    max-width: 100%;
}

.widget-section > table,
.card > table {
    display: block;
    overflow-x: auto;
}

.widget-section > div:not(.sec-title):not(.split-list-container):has(table),
.card > div:not(.card-title):has(table) {
    overflow-x: auto;
}

@media (max-width: 1199px) {
    header {
        padding: 16px 24px 14px;
    }

    .dashboard-shell {
        grid-template-columns: 1fr;
        padding: 18px 22px 32px;
    }

    .dashboard-sidebar {
        position: static;
        display: grid;
        grid-template-columns: auto repeat(3, minmax(140px, 1fr)) auto auto auto;
        align-items: end;
        gap: 8px;
        overflow-x: auto;
    }

    .dashboard-sidebar label,
    .sidebar-title {
        display: none;
    }

    .core-v21-grid,
    .analysis-grid,
    .split-list-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sec-title,
    .card-title {
        font-size: var(--fs-sm);
    }
}

@media (max-width: 768px) {
    body {
        background: var(--bg);
    }

    header {
        position: relative;
        padding: 24px 18px 26px;
        background: color-mix(in srgb, #111827 88%, var(--accent) 12%);
        border-bottom: 0;
        box-shadow: none;
    }

    .header-eyebrow {
        color: rgba(226, 232, 240, .58);
    }

    header h1 {
        color: #ffffff;
        font-size: var(--fs-lg);
        line-height: 1.08;
        max-width: 350px;
    }

    #header-sub {
        color: rgba(226, 232, 240, .72) !important;
        font-size: var(--fs-xs) !important;
        max-width: 330px;
    }

    nav {
        margin-top: 18px;
        gap: 8px;
    }

    nav button,
    .nav-export,
    .nav-admin,
    .nav-back {
        border-radius: 999px;
        background: rgba(255,255,255,.08);
        border-color: rgba(255,255,255,.14);
        color: rgba(248,250,252,.88);
    }

    nav button.active {
        background: rgba(96,165,250,.68);
        border-color: rgba(147,197,253,.42);
        color: #ffffff;
    }

    .breadcrumb {
        color: rgba(226,232,240,.82);
        font-size: var(--fs-sm);
        line-height: 1.3;
    }

    .dashboard-shell {
        padding: 0 14px 28px;
        gap: 16px;
    }

    .dashboard-sidebar {
        display: flex;
        flex-wrap: nowrap;
        width: calc(100% + 28px);
        max-width: calc(100% + 28px);
        margin: -1px -14px 8px;
        padding: 12px 14px;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        background: var(--bg-elevated);
        box-shadow: var(--shadow-soft);
        scrollbar-width: none;
    }

    .dashboard-sidebar::-webkit-scrollbar {
        display: none;
    }

    .dashboard-sidebar select,
    .dashboard-sidebar button {
        flex: 0 0 auto;
        max-width: 150px;
        border-radius: 999px;
        padding: 9px 13px;
    }

    .dashboard-sidebar .sidebar-home {
        max-width: none;
        background: color-mix(in srgb, #111827 90%, var(--accent) 10%);
        border-color: transparent;
    }

    .widget-section,
    .card {
        margin: 26px 0 0;
    }

    .sec-title,
    .card-title {
        color: var(--ink-faint);
        font-size: var(--fs-sm);
        margin-bottom: 12px;
    }

    .sec-title::before,
    .card-title::before {
        display: none;
    }

    .core-v21-grid,
    .analysis-grid,
    .split-list-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .core-v21-grid {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
    }

    .core-v42-section-head {
        display: block;
    }

    .core-v42-caption {
        max-width: none;
        margin-top: 7px;
        text-align: left;
    }

    .core-v21-card,
    .kpi-card,
    .full-panel,
    .analysis-card {
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-soft);
    }

    .core-v21-card {
        min-height: auto;
        padding: 16px;
        max-width: 100%;
    }

    .core-v21-card-head {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        min-width: 0;
    }

    .core-v21-card-head span {
        font-size: var(--fs-sm);
    }

    .core-v21-card-head strong {
        font-size: var(--fs-lg);
        min-width: 0;
        justify-self: start;
    }

    .core-v21-card-head em {
        text-align: left;
    }

    .core-v43-insight {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .core-v43-insight span {
        grid-column: auto;
    }

    .core-v43-insight strong {
        white-space: normal;
    }

    .core-v43-insight em {
        white-space: normal;
    }

    .core-v21-card.sales .core-v21-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .core-v21-card.sales .core-v21-main div:first-child {
        grid-column: 1 / -1;
    }

    .core-v21-card.sales .core-v21-main b {
        font-size: var(--fs-md);
    }

    .core-v21-main div,
    .core-v21-line,
    .core-v21-process-item,
    .core-v21-product {
        padding: 13px;
    }

    .core-v21-line > div:last-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .core-v21-four,
    .kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .full-panel {
        max-width: 100%;
        padding: 0;
        overflow-x: auto;
    }

    .overview,
    .widget-section {
        overflow-x: clip;
    }

    table {
        min-width: 540px;
        font-size: var(--fs-xs);
        background: transparent;
    }

    table th {
        background: color-mix(in srgb, #111827 92%, var(--accent) 8%) !important;
        color: rgba(226,232,240,.72) !important;
        padding: 10px 8px;
    }

    table td {
        padding: 12px 8px;
    }

    .chart-container {
        height: 280px;
        min-height: 260px;
    }

    .chart-filter-panel {
        padding: 12px;
    }

    .chart-filter-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .chart-filter-title {
        line-height: 1.35;
    }

    .chart-filter-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .chart-filter-options::-webkit-scrollbar {
        display: none;
    }

    .chart-filter-options.branch-options {
        max-height: none;
        overflow-y: hidden;
    }

    .chart-filter-chip {
        flex: 0 0 auto;
    }

    .marketing-summary-grid,
    .marketing-split {
        grid-template-columns: 1fr;
    }

    .marketing-summary-card {
        min-height: 92px;
        padding: 14px;
    }

    .marketing-summary-card strong {
        font-size: 30px;
    }

    .marketing-panel-title {
        font-size: 15px;
    }

    .progress-cell {
        grid-template-columns: minmax(52px, 1fr);
        gap: 4px;
    }

    .table-action {
        padding: 5px 8px;
    }

    .trend-narrative {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 12px;
    }

    .trend-narrative-group {
        padding: 13px;
        border-radius: var(--radius-lg);
    }

    .trend-narrative-title {
        font-size: var(--fs-sm);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 32px;
    }

    .dashboard-shell {
        padding-inline: 14px;
    }

    .core-v21-card.sales .core-v21-main {
        grid-template-columns: 1fr;
    }

    .core-v21-card.sales .core-v21-main div:first-child {
        grid-column: auto;
    }

    .core-v21-card-head strong {
        font-size: 30px;
    }

    .core-v21-main b {
        font-size: var(--fs-sm);
    }

    .core-v21-card.sales .core-v21-main b {
        font-size: var(--fs-md);
    }
}

/* ── 手机端补丁：散点图竖排 + 宽表首列冻结 ── */
@media (max-width: 768px) {
    /* 活动散点分析：两图在窄屏改为上下竖排，避免横向挤压 */
    .scatter-flex {
        flex-direction: column;
    }
    .scatter-flex > div {
        width: 100%;
    }

    /* 宽表横向滚动时冻结第一列（分析主题/名称列），方便对照右侧靠后数据 */
    table th:first-child,
    table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--bg-solid, #ffffff);
    }
    /* 表头首列层级更高，避免被单元格覆盖 */
    table thead th:first-child {
        z-index: 3;
    }

    /* 排名表（首列为 # 序号）：固定 # 列宽并把第二列（名称列）也冻结 */
    table.rank-frozen th:first-child,
    table.rank-frozen td:first-child {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        padding-left: 6px;
        padding-right: 6px;
    }
    table.rank-frozen th:nth-child(2),
    table.rank-frozen td:nth-child(2) {
        position: sticky;
        left: 42px;
        z-index: 2;
        background: var(--bg-solid, #ffffff);
    }
    table.rank-frozen thead th:nth-child(2) {
        z-index: 3;
    }

    /* 层级直达（手机端顶部横向条）随页面下滑始终吸顶 */
    .dashboard-sidebar {
        position: sticky;
        top: 0;
        z-index: 60;
    }
}

/* ════════ 反馈气泡 + 提报弹窗 ════════ */
#feedback-bubble {
    position: fixed;
    right: 24px;
    bottom: 28px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4338ca);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
#feedback-bubble:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45); }
.fb-bubble-icon { font-size: 16px; line-height: 1; }

.fb-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fb-modal {
    width: 460px;
    max-width: 100%;
    background: var(--bg-solid, #fff);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    animation: fb-pop 0.16s ease-out;
}
@keyframes fb-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fb-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.fb-close { border: none; background: none; font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; }
.fb-close:hover { color: #475569; }
.fb-modal-body { padding: 16px 20px; }
.fb-ctx { font-size: 12px; color: #64748b; background: #f1f5f9; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.fb-label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin: 10px 0 5px; }
.fb-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    box-sizing: border-box;
}
.fb-input:focus { border-color: #2563eb; }
.fb-textarea { resize: vertical; min-height: 96px; }
.fb-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.fb-btn { padding: 9px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.fb-btn-ghost { background: #fff; border-color: #e2e8f0; color: #475569; }
.fb-btn-ghost:hover { background: #f1f5f9; }
.fb-btn-primary { background: linear-gradient(135deg, #2563eb, #4338ca); color: #fff; }
.fb-btn-primary:hover { opacity: 0.92; }
.fb-btn-primary:disabled { opacity: 0.6; cursor: default; }

.fb-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    animation: fb-fade 3s forwards;
}
.fb-toast-ok { background: #16a34a; }
.fb-toast-err { background: #dc2626; }
@keyframes fb-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 768px) {
    #feedback-bubble { right: 16px; bottom: 18px; padding: 10px 14px; font-size: 13px; }
    .fb-modal { width: 100%; border-radius: 14px 14px 0 0; align-self: flex-end; }
    .fb-overlay { padding: 0; align-items: flex-end; }
}
