:root {
  --ink: #15243a;
  --muted: #64748b;
  --soft: #f4f7fb;
  --line: #e2e8f0;
  --navy: #102a43;
  --blue: #2f6bff;
  --blue-soft: #eaf0ff;
  --teal: #0f9f8f;
  --amber: #e69b25;
  --red: #d95757;
  --white: #fff;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.07);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--soft); font-size: 15px; line-height: 1.65; }
button, select { font: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 246px; padding: 30px 22px;
  display: flex; flex-direction: column; color: #d9e5f2;
  background: linear-gradient(180deg, #102a43 0%, #0b1f33 100%);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 6px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-weight: 700; color: white; background: linear-gradient(135deg, #4f7cff, #20b8a5); box-shadow: 0 8px 20px rgba(47,107,255,.28); }
.brand strong { display: block; color: white; font-size: 16px; letter-spacing: .03em; }
.brand span { display: block; color: #8fa6bc; font-size: 10px; letter-spacing: .08em; }
.side-nav { display: grid; gap: 7px; margin-top: 28px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 9px; color: #9fb3c8; text-decoration: none; transition: .2s ease; }
.nav-link span { font-size: 11px; opacity: .65; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.09); transform: translateX(2px); }
.nav-link.active { box-shadow: inset 3px 0 #56c9bb; }
.sidebar-status { margin-top: auto; padding: 15px 11px 0; border-top: 1px solid rgba(255,255,255,.1); display: flex; gap: 10px; align-items: flex-start; }
.status-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: #56c9bb; box-shadow: 0 0 0 4px rgba(86,201,187,.12); }
.sidebar-status strong, .sidebar-status span { display: block; }
.sidebar-status strong { font-size: 12px; color: #dce8f4; }
.sidebar-status span { font-size: 11px; color: #8198ad; }

.main-content { margin-left: 246px; padding: 34px 42px 58px; max-width: 1680px; }
.page-header { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; max-width: 1380px; margin: 0 auto 24px; }
.eyebrow, .section-index { margin: 0 0 6px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 38px); line-height: 1.25; letter-spacing: -.025em; color: var(--navy); }
.page-intro { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 15px; }
.header-meta { flex: 0 0 auto; padding: 10px 14px; text-align: right; border-left: 2px solid var(--teal); }
.header-meta span { display: block; color: var(--muted); font-size: 11px; }
.header-meta strong { color: var(--navy); font-size: 14px; }

.control-bar { position: sticky; top: 12px; z-index: 15; max-width: 1380px; margin: 0 auto 28px; padding: 15px 17px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; border: 1px solid rgba(215,225,237,.9); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.control-group { min-width: 190px; }
.date-range-control { min-width: 330px; }
.control-group label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
select, input[type="date"] { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #d7e0eb; border-radius: 8px; color: var(--ink); background: white; outline: none; cursor: pointer; }
select { padding-right: 34px; }
select:focus, input[type="date"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
select:disabled, input[type="date"]:disabled { color: #9aa9ba; cursor: not-allowed; background: #f7f9fc; }
.date-range-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; }
.date-range-inputs span { color: var(--muted); font-size: 11px; }
.refresh-button { height: 39px; padding: 0 16px; border: 0; border-radius: 8px; color: white; background: var(--navy); cursor: pointer; transition: .2s; }
.refresh-button:hover { background: #183b5c; transform: translateY(-1px); }
.refresh-button:disabled { opacity: .5; cursor: wait; transform: none; }
.basis-chip { margin-left: auto; align-self: center; padding: 7px 11px; border-radius: 999px; color: #315a7d; background: #edf4fa; font-size: 11px; white-space: nowrap; }

.dashboard-section { max-width: 1380px; margin: 0 auto; padding: 38px 0 8px; scroll-margin-top: 105px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 0; color: var(--navy); font-size: 25px; line-height: 1.3; }
.section-heading > p { max-width: 500px; margin-bottom: 2px; color: var(--muted); font-size: 12px; text-align: right; }
.subsection-heading { display: flex; justify-content: space-between; margin: 30px 0 14px; }
.subsection-heading h3 { margin-bottom: 3px; font-size: 17px; color: var(--navy); }
.subsection-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.kpi-card { min-height: 128px; padding: 18px 19px; border: 1px solid #e1e8f0; border-radius: 13px; background: white; box-shadow: 0 5px 18px rgba(16,42,67,.045); }
.kpi-card.featured { color: white; border-color: transparent; background: linear-gradient(135deg, #255fdc, #3d7cff); box-shadow: 0 12px 28px rgba(47,107,255,.21); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; }
.featured .kpi-label, .featured .kpi-note { color: rgba(255,255,255,.76); }
.kpi-value { margin-top: 11px; color: var(--navy); font-size: 29px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.featured .kpi-value { color: white; }
.kpi-value small { margin-left: 2px; font-size: 13px; font-weight: 500; }
.kpi-note { margin-top: 9px; color: #8796a8; font-size: 10px; line-height: 1.45; }
.decision-card { margin-top: 14px; padding: 17px 20px; display: flex; align-items: center; gap: 14px; border: 1px solid #dfe8f2; border-radius: 13px; background: linear-gradient(90deg, #f7faff, #fff); }
.decision-icon { flex: 0 0 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); font-weight: 800; background: var(--blue-soft); }
.decision-card span { color: var(--blue); font-size: 11px; font-weight: 700; }
.decision-card p { margin: 2px 0 0; color: #344b64; font-size: 14px; }

.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.route-card { position: relative; overflow: hidden; padding: 19px; border: 1px solid #e0e8f1; border-radius: 13px; background: white; box-shadow: 0 5px 18px rgba(16,42,67,.04); }
.route-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--route-color, var(--blue)); }
.route-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.route-card h4 { margin: 0; color: var(--navy); font-size: 16px; }
.date-tag { padding: 3px 8px; border-radius: 999px; color: #587088; background: #f0f4f8; font-size: 9px; white-space: nowrap; }
.pressure-tag { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.pressure-high { color: #a24343; background: #fff0ef; }
.pressure-mid { color: #976615; background: #fff7e8; }
.pressure-low { color: #317363; background: #eaf8f4; }
.route-price { margin: 16px 0 13px; display: flex; align-items: baseline; gap: 6px; }
.route-price strong { color: var(--navy); font-size: 26px; line-height: 1; }
.route-price span { color: var(--muted); font-size: 11px; }
.route-progress { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.route-progress span { display: block; height: 100%; border-radius: inherit; background: var(--route-color, var(--blue)); }
.route-meta { margin-top: 10px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.route-stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #edf1f5; border-bottom: 1px solid #edf1f5; color: var(--muted); font-size: 10px; }
.route-stat-row b { margin-left: 3px; color: #344b64; font-weight: 700; }

.chart-grid { display: grid; min-width: 0; gap: 16px; }
.panel { border: 1px solid #e0e8f1; border-radius: 14px; background: white; box-shadow: 0 7px 24px rgba(16,42,67,.045); }
.chart-panel, .competition-panel, .tracker-panel, .coverage-panel { min-width: 0; padding: 20px 22px; }
.detail-panel, .data-range-panel { min-width: 0; margin-top: 16px; padding: 20px 22px; }
.panel-header, .tracker-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-header > *, .tracker-toolbar > * { min-width: 0; }
.panel-header h3, .tracker-toolbar h3 { margin-bottom: 3px; color: var(--navy); font-size: 16px; }
.panel-header p, .tracker-toolbar p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.chart { min-height: 330px; margin-top: 10px; }
.airfare-chart { min-height: 365px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #e9eef4; stroke-width: 1; }
.chart .axis-text { fill: #7b8da1; font-size: 10px; }
.chart .data-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .data-point { stroke: white; stroke-width: 1.5; transition: r .15s; }
.chart .data-point:hover { r: 5; }
.chart .incomplete-point { stroke-dasharray: 3 3; opacity: .55; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 3px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.legend-swatch { width: 16px; height: 3px; border-radius: 99px; }

.competition-bars { display: grid; gap: 17px; margin: 24px 0 22px; }
.competition-row { display: grid; grid-template-columns: 105px 1fr 60px; gap: 13px; align-items: center; }
.competition-route { color: #344b64; font-size: 12px; font-weight: 700; }
.competition-track { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #edf5f3 0 40%, #fff5e6 40% 70%, #fff0ef 70%); }
.competition-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6bff, #4d87ff); box-shadow: 0 2px 8px rgba(47,107,255,.18); }
.competition-value { color: var(--navy); font-size: 15px; font-weight: 750; text-align: right; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf1f5; text-align: left; }
th { color: #78899c; font-size: 10px; font-weight: 700; background: #fbfcfe; }
td { color: #3d526a; font-size: 12px; }
td strong { color: var(--navy); }
.table-tag { padding: 3px 8px; border-radius: 999px; font-size: 10px; }

.tracker-toolbar { align-items: flex-end; margin-bottom: 12px; }
.control-group.compact { min-width: 210px; }
.tracker-chart { min-height: 300px; }
.compact-table { margin-top: 10px; max-height: 340px; overflow: auto; }
.detail-table { max-height: 460px; margin-top: 17px; overflow: auto; border: 1px solid #edf1f5; border-radius: 9px; }
.detail-table thead { position: sticky; top: 0; z-index: 2; }
.detail-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 7px; color: #4b647d; background: #f0f4f8; font-size: 10px; }
.empty-state { min-height: 170px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }

.method-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 14px; }
.method-card { padding: 17px 18px; border: 1px solid #e0e8f1; border-radius: 12px; background: white; }
.method-card span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.method-card h3 { margin: 7px 0 5px; color: var(--navy); font-size: 14px; }
.method-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.coverage-panel { margin-top: 14px; }
.coverage-summary { padding: 5px 9px; border-radius: 7px; color: #4b647d; background: #f0f4f8; font-size: 10px; }
.coverage-strip { display: flex; gap: 5px; align-items: flex-end; margin-top: 20px; min-height: 55px; overflow-x: auto; padding-bottom: 4px; }
.coverage-cell { flex: 1 0 20px; min-width: 20px; height: var(--height, 40px); border-radius: 4px 4px 2px 2px; background: #b7d0ff; cursor: help; }
.coverage-cell.complete { background: #386fdd; }
.coverage-cell.latest { outline: 2px solid #102a43; outline-offset: 2px; }
.coverage-empty { width: 100%; min-height: 52px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.data-range-panel { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; }
.data-range-panel > div { min-width: 0; padding: 4px 18px; border-right: 1px solid #e8edf3; }
.data-range-panel > div:first-child { padding-left: 0; }
.data-range-panel > div:last-child { padding-right: 0; border-right: 0; }
.data-range-panel span, .data-range-panel strong { display: block; }
.data-range-panel span { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.data-range-panel strong { color: var(--navy); font-size: 12px; overflow-wrap: anywhere; }

.loading-state { max-width: 1380px; min-height: 320px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.loader { width: 18px; height: 18px; border: 2px solid #dce5ef; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-banner { max-width: 1380px; margin: 0 auto 16px; padding: 13px 16px; border: 1px solid #ffd0cc; border-radius: 10px; color: #93433d; background: #fff3f1; font-size: 13px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 2px 0; color: #8191a3; font-size: 10px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .method-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .control-group { min-width: 150px; }
  .data-range-panel { grid-template-columns: repeat(2, minmax(0,1fr)); row-gap: 18px; }
  .data-range-panel > div:nth-child(2) { border-right: 0; }
  .basis-chip { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; padding: 16px 20px; flex-direction: row; align-items: center; }
  .brand { padding: 0; border: 0; }
  .brand span, .sidebar-status { display: none; }
  .side-nav { margin: 0 0 0 auto; display: flex; gap: 3px; }
  .nav-link { padding: 8px 10px; }
  .nav-link span { display: none; }
  .main-content { margin-left: 0; padding: 26px 22px 45px; }
  .control-bar { top: 8px; }
  .route-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .sidebar { overflow-x: auto; }
  .brand-mark { width: 36px; height: 36px; font-size: 12px; }
  .brand strong { white-space: nowrap; font-size: 14px; }
  .side-nav { display: none; }
  .main-content { padding: 22px 14px 38px; }
  .page-header { align-items: flex-start; }
  .header-meta { display: none; }
  .page-intro { font-size: 13px; }
  .control-bar { flex-wrap: wrap; padding: 12px; }
  .control-group { min-width: calc(50% - 7px); flex: 1; }
  .date-range-control { min-width: 100%; }
  .refresh-button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .section-heading > p { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi-card { min-height: 115px; padding: 15px; }
  .kpi-value { font-size: 24px; }
  .chart-panel, .competition-panel, .tracker-panel, .coverage-panel { padding: 17px 14px; }
  .panel-header { display: block; }
  .legend { justify-content: flex-start; margin-top: 8px; }
  .chart { width: 100%; min-width: 0; min-height: 260px; overflow-x: auto; }
  .chart svg { width: 620px; max-width: none; }
  .competition-row { grid-template-columns: 80px 1fr 48px; gap: 8px; }
  .tracker-toolbar { display: block; }
  .control-group.compact { margin-top: 12px; min-width: 100%; }
  .method-grid { grid-template-columns: 1fr; }
  .data-range-panel { grid-template-columns: 1fr; }
  .data-range-panel > div { padding: 11px 0; border-right: 0; border-bottom: 1px solid #e8edf3; }
  .data-range-panel > div:last-child { border-bottom: 0; }
  footer { display: block; }
}
