@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;800&display=swap');

:root {
    --brand: #2563eb;
    --brand-soft: #dbeafe;
    --card-border: #dbe3ef;
    --bg: #f6f8fc;
    --text-muted: #64748b;
    --focus-ring: rgba(37, 99, 235, 0.22);
    --panel-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body {
    font-family: 'Noto Sans SC', system-ui, sans-serif;
    background: radial-gradient(circle at 14% 0%, #eef4ff 0%, #f8faff 34%, #f7f9fc 100%);
    color: #0f172a;
    line-height: 1.55;
}

.layout-shell { max-width: 1480px; margin: 0 auto; padding: 18px; }
.panel {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--panel-shadow);
}
.panel-header { font-weight: 800; letter-spacing: .01em; color: #111827; }
.stat-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
}
.interactive-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.interactive-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.1);
    transform: translateY(-2px);
}
.chip-btn { border: 1px solid #c7d2e3; background: #fff; border-radius: 10px; padding: 8px 13px; font-size: 12px; font-weight: 600; color: #334155; transition: border-color .16s ease, color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.chip-btn:hover { border-color: var(--brand); color: #1d4ed8; background: #eff6ff; }
.chip-btn.active { border-color: #1d4ed8; background: #e9f1ff; color: #1e3a8a; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
.toolbar {
    position: static;
    top: auto;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
    backdrop-filter: blur(6px);
}
.toolbar-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}
.toolbar-block {
    background: #f8fbff;
    border: 1px solid #e1e9f6;
    border-radius: 12px;
    padding: 10px 12px;
}
.toolbar-block #toolbar_primary,
.toolbar-block #toolbar_secondary {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.toolbar-block #toolbar_primary .chip-btn {
    width: auto;
    text-align: center;
}
.toolbar-block-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    letter-spacing: .02em;
}
.filter-disclosure {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
}
.filter-summary {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    list-style: none;
}
.filter-summary::-webkit-details-marker {
    display: none;
}
.filter-summary::after {
    content: '▾';
    float: right;
    color: #64748b;
}
.filter-disclosure:not([open]) .filter-summary::after {
    content: '▸';
}
.course-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    position: sticky;
    top: 8px;
    z-index: 45;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.course-nav-link {
    border: 1px solid #c7d2e3;
    background: #ffffff;
    color: #334155;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.course-nav-link:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}
.course-nav-link.active {
    border-color: #1d4ed8;
    background: #e9f1ff;
    color: #1e3a8a;
}

.toolbar-multi-select {
    position: relative;
}
.toolbar-multi-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c7d2e3;
    border-radius: 10px;
    background: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}
.toolbar-multi-summary::-webkit-details-marker {
    display: none;
}
.toolbar-multi-summary::after {
    content: '▾';
    color: #64748b;
    margin-left: 2px;
}
.toolbar-multi-select[open] .toolbar-multi-summary {
    border-color: #1d4ed8;
    background: #e9f1ff;
    color: #1e3a8a;
}
.toolbar-multi-select[open] .toolbar-multi-summary::after {
    content: '▴';
}
.toolbar-multi-count {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1.6;
    color: #64748b;
    background: #f8fafc;
}
.toolbar-multi-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 80;
    width: min(360px, calc(100vw - 36px));
    max-height: 260px;
    overflow: auto;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
    padding: 8px;
}
.toolbar-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #c7d2e3;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    margin: 2px;
}
.toolbar-filter-chip input {
    margin: 0;
}
.toolbar-filter-chip:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}
.toolbar-filter-chip:has(input:checked) {
    border-color: #1d4ed8;
    background: #e9f1ff;
    color: #1e3a8a;
}
.toolbar-filter-chip.checked {
    border-color: #1d4ed8;
    background: #e9f1ff;
    color: #1e3a8a;
}

.header-hero {
    background: linear-gradient(130deg, #eff6ff 0%, #eefbf7 100%);
    color: #0f172a;
    border-radius: 14px;
    padding: 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid #dbe3ef;
}
.header-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 18% 20%, rgba(37, 99, 235, 0.1), transparent 36%);
    pointer-events: none;
    opacity: .8;
}

.header-hero #company_count,
.header-hero #last_update_label,
.header-hero #timezone_badge,
.header-hero p {
    color: #334155 !important;
}

.header-hero #last_update {
    color: #0f172a;
}

.header-hero select {
    color: #111827 !important;
    background: #ffffff !important;
    border: 1px solid #a8a29e !important;
}

.positive { color: #059669; }
.negative { color: #dc2626; }

.chart-grid-two { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1200px) {
    .chart-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #charts_row_2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .toolbar-grid {
        grid-template-columns: 1fr;
    }
    .toolbar-multi-panel { width: 360px; }
}
.section-subtitle { color: #64748b; font-size: 12px; margin-bottom: 8px; }
.decision-support-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.decision-card {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    padding: 12px;
}
.decision-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #475569;
    margin-bottom: 4px;
}
.decision-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.decision-main {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    color: #0f172a;
    margin-top: 4px;
}
.decision-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}
.signal-pill {
    display: inline-flex;
    margin-top: 8px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #f8fafc;
}
.signal-positive {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}
.signal-neutral {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}
.signal-risk {
    color: #b45309;
    border-color: #fcd34d;
    background: #fffbeb;
}
.onboarding-panel {
    border: 2px dashed #cbd5e1;
    background: #fff;
}
.onboarding-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.onboarding-card {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.onboarding-card:hover {
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 rgba(37, 99, 235, 0.12);
}
.onboarding-step {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #0ea5e9;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}
.onboarding-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.onboarding-desc { font-size: 12px; color: #475569; margin-top: 2px; line-height: 1.45; }
.lesson-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #93c5fd;
    background: #dbeafe;
    color: #1e3a8a;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.chart-container { min-height: 280px; position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #fff; border: 1px solid #d6d3d1; }
.chart-fallback { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #94a3b8; text-align: center; width: 100%; pointer-events: none; }
.chart-container .js-plotly-plot, .chart-container .plot-container, .chart-container .svg-container { width: 100% !important; }

.industry-basics-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 10px; }
.industry-basic-item { border: 1px solid #d6d3d1; border-radius: 8px; background: #fff; padding: 10px 12px; }
.industry-basic-item .term { font-size: 12px; font-weight: 700; color: #0f766e; }
.industry-basic-item .desc { font-size: 12px; color: #475569; margin-top: 4px; line-height: 1.45; }

@media (min-width: 960px) {
    .industry-basics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .onboarding-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .decision-support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1320px) {
    .onboarding-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .decision-support-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.compact-table td, .compact-table th { padding-top: 10px !important; padding-bottom: 10px !important; }
.table-head { background: #f5f5f4; color: #111827; }
#dataTable { border-collapse: separate; border-spacing: 0; }
#dataTable th { white-space: nowrap; }
#dataTable th:nth-child(1), #dataTable td:nth-child(1) {
    position: sticky;
    left: 0;
    background: #fffefb;
    z-index: 6;
}
#dataTable th:nth-child(2), #dataTable td:nth-child(2) {
    position: sticky;
    left: 92px;
    background: #fffefb;
    z-index: 5;
}
#dataTable thead th:nth-child(1), #dataTable thead th:nth-child(2) {
    background: #f5f5f4;
    z-index: 8;
}

/* 单列浏览布局（避免左右栏造成空白） */
#report_root {
    display: block;
    position: relative;
}
#report_root > * {
    width: 100%;
    margin-bottom: 14px;
    min-width: 0;
}

#summary_cards { border-top: 4px solid #1d4ed8; padding-top: 2px; }
#decision_support_section { border-top: 4px solid #15803d; }
#limit_up_section { border-top: 4px solid #be123c; }
#methodology_section { border-top: 4px solid #334155; }
#pick_section { border-top: 4px solid #1d4ed8; }
#charts_row_1, #charts_row_2 { border-top: 4px solid #0f766e; padding-top: 2px; }
#industry_section { border-top: 4px solid #6d28d9; }
#supply_risk_section { border-top: 4px solid #b45309; }
#news_section { border-top: 4px solid #0e7490; }
#table_section { border-top: 4px solid #52525b; }

#summary_cards,
#onboarding_section,
#methodology_section,
#filter_section,
#decision_support_section,
#limit_up_section,
#pick_section,
#action_section,
#charts_row_1,
#charts_row_2,
#industry_section,
#supply_risk_section,
#news_section,
#table_section {
    scroll-margin-top: 68px;
}

.lane-resizer,
#left_lane_header,
#right_lane_header {
    display: none !important;
}

.floating-toc {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    width: 176px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    touch-action: none;
}
.floating-toc.floater-left {
    right: auto;
    left: 16px;
}
.floating-toc.dragging {
    opacity: 0.92;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}
.floating-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    cursor: grab;
    user-select: none;
}
.floating-toc.dragging .floating-toc-header {
    cursor: grabbing;
}
.floating-toc-toggle {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 11px;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
}
.floating-toc-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 52vh;
    overflow: auto;
}
.floating-toc-link {
    width: 100%;
    text-align: left;
    border: 1px solid #dbe3ef;
    background: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}
.floating-toc-link:hover { border-color: #2563eb; color: #1e3a8a; }
.floating-toc-top {
    border-color: #bfdbfe;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 700;
}
.floating-toc-link.active {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 700;
}
.floating-toc.collapsed .floating-toc-list { display: none; }

.quick-search-floater {
    position: fixed;
    right: 14px;
    top: 96px;
    z-index: 58;
    width: 220px;
    pointer-events: auto;
}
.quick-search-toggle {
    width: 100%;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}
.quick-search-panel {
    margin-top: 6px;
    border: 1px solid #dbe3ef;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    padding: 10px;
    display: none;
}
.quick-search-floater:hover .quick-search-panel,
.quick-search-floater.open .quick-search-panel {
    display: block;
}

.chart-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
}
.chart-zoom-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.chart-zoom-content {
    position: relative;
    width: min(1220px, calc(100vw - 30px));
    margin: 24px auto;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
    padding: 10px;
}
.chart-zoom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 10px;
}
.chart-zoom-container {
    min-height: 420px;
}

a,
button,
input,
select {
    transition: box-shadow .16s ease, border-color .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.chip-btn:focus-visible,
.floating-toc-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
    border-color: #14b8a6 !important;
}

#dataTable tbody tr {
    transition: background-color .16s ease;
}

#dataTable tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

#dataTable tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.06);
}

body.reading-compact .layout-shell { max-width: 1680px; padding: 10px; }
body.reading-compact #report_root > * { margin-bottom: 8px; }
body.reading-compact .panel { border-radius: 12px; }
body.reading-compact .panel.p-5 { padding: 12px !important; }
body.reading-compact .toolbar { top: auto; }
body.reading-compact .section-subtitle { margin-bottom: 4px; font-size: 11px; }
body.reading-compact #pick_cards { max-height: 34vh; }
body.reading-compact #news_grid { max-height: 34vh; }
body.floater-hidden #floating_toc { display: none !important; }

@media (max-width: 1100px) {
    .chart-grid-two { grid-template-columns: 1fr; }
    .floating-toc {
        right: 10px;
        bottom: 10px;
        width: 156px;
    }
    .floating-toc.floater-left {
        left: 10px;
    }
    .quick-search-floater {
        right: 10px;
        top: 84px;
        width: 196px;
    }
}

@media (max-width: 900px) {
    .layout-shell { padding: 10px; }
    body { padding-bottom: 156px; }
    .header-hero { padding: 16px; border-radius: 16px; }
    .toolbar { position: static; top: auto; }
    .toolbar-block { padding: 10px; }
    #toolbar_primary,
    #toolbar_secondary {
        width: 100%;
        justify-content: flex-start !important;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    #quick_search {
        min-width: 180px;
        width: auto;
        max-width: 100%;
    }
    #table_section .overflow-auto { max-height: none; }
    #floating_toc { display: none !important; }
    #quick_search_floater {
        display: block !important;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 10px;
        width: auto;
        z-index: 78;
    }
    #quick_search_floater .quick-search-toggle {
        text-align: center;
        min-height: 40px;
    }
    #quick_search_floater .quick-search-panel {
        max-height: 40vh;
        overflow: auto;
        margin-top: 8px;
    }
    #quick_search_floater:not(.open) .quick-search-panel {
        display: none;
    }
    #quick_search_floater.open .quick-search-panel {
        display: block;
    }
    .course-nav { gap: 6px; }
    .course-nav-link { font-size: 11px; padding: 7px 10px; }
    .toolbar-multi-summary { min-height: 36px; padding: 7px 10px; }
    .toolbar-multi-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        width: auto;
        top: 84px;
        max-height: calc(100vh - 220px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .decision-main { font-size: 22px; }
    .onboarding-grid,
    .decision-support-grid {
        grid-template-columns: 1fr !important;
    }
    #charts_row_2 {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .panel.p-5 { padding: 12px !important; }
    .chip-btn { padding: 6px 10px; font-size: 11px; }
    .toolbar-block #toolbar_primary .chip-btn { min-height: 36px; }
    #toolbar_secondary select, #toolbar_secondary input { min-height: 38px; }
    #dataTable { min-width: 0 !important; border-spacing: 0 6px; }
    #dataTable thead { display: none; }
    #dataTable tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    #dataTable tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    }
    #dataTable td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        text-align: right !important;
        padding: 8px 10px !important;
        border-bottom: 1px dashed #e2e8f0;
        white-space: normal;
    }
    #dataTable td:last-child { border-bottom: none; }
    #dataTable td::before {
        content: attr(data-label);
        font-size: 11px;
        color: #64748b;
        font-weight: 700;
        text-align: left;
        flex: 0 0 45%;
        max-width: 45%;
    }
    #dataTable td:nth-child(1),
    #dataTable td:nth-child(2),
    #dataTable th:nth-child(1),
    #dataTable th:nth-child(2) {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
        background: transparent !important;
    }
}
