:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #10233f;
  --muted: #6b7a90;
  --primary: #0e6ac7;
  --primary-dark: #0857a6;
  --accent: #11a9a0;
  --line: #dfe7f0;
  --soft: #eef5fb;
  --warn: #fff7df;
  --shadow: 0 14px 38px rgba(40, 72, 110, .10);
}

* { box-sizing: border-box; }
body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif; color:var(--ink); background:var(--bg); }
button, input, select { font: inherit; }
button { cursor:pointer; }
.hero { background:linear-gradient(135deg,#073d74,#0c72c8 58%,#12a79c); color:#fff; padding:44px 20px 72px; }
.hero-inner { max-width:1180px; margin:auto; display:flex; justify-content:space-between; gap:24px; align-items:flex-end; }
.eyebrow { font-size:12px; font-weight:800; letter-spacing:.18em; opacity:.75; }
.hero h1 { margin:9px 0 10px; font-size:38px; line-height:1.15; }
.hero p { margin:0; opacity:.86; font-size:15px; }
.data-badge { padding:10px 14px; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.12); border-radius:999px; white-space:nowrap; backdrop-filter:blur(10px); font-size:13px; }
.container { max-width:1180px; margin:-38px auto 50px; padding:0 20px; }
.main-tabs { display:flex; gap:8px; margin-bottom:14px; }
.tab { border:0; background:#e8eef6; color:#53647b; padding:12px 20px; border-radius:13px; font-weight:700; }
.tab.active { background:#fff; color:var(--primary); box-shadow:var(--shadow); }
.panel { display:none; }
.panel.active { display:block; }
.search-card,.table-card { background:var(--card); border:1px solid rgba(214,226,239,.8); box-shadow:var(--shadow); border-radius:22px; padding:24px; }
.segmented { display:inline-flex; background:#edf3f9; padding:4px; border-radius:12px; margin-bottom:20px; }
.segmented button { border:0; background:transparent; color:#63748a; padding:9px 22px; border-radius:9px; font-weight:700; }
.segmented button.active { color:var(--primary); background:#fff; box-shadow:0 2px 10px rgba(34,73,113,.10); }
.search-grid { display:grid; gap:16px; }
.route-row { grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr); align-items:end; }
.options-row { grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:16px; }
.advanced-grid { grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:14px; }
.overview-filter-grid { grid-template-columns:repeat(6,minmax(0,1fr)); margin-top:14px; }
.aggregate-tag { margin-left:6px; vertical-align:middle; }
.field { display:flex; flex-direction:column; gap:7px; }
.field span { font-size:13px; color:#5e7086; font-weight:700; }
.field input,.field select { width:100%; height:46px; border:1px solid var(--line); border-radius:12px; padding:0 13px; background:#fff; color:var(--ink); outline:none; }
.field input:focus,.field select:focus { border-color:#64a7e5; box-shadow:0 0 0 3px rgba(14,106,199,.09); }


.select-hidden { display:none !important; }

.airport-picker { position:relative; width:100%; }

.airport-input {
  width:100%; height:46px; border:1px solid var(--line); border-radius:12px;
  padding:0 40px 0 13px; background:#fff; color:var(--ink); outline:none; cursor:text;
}
.airport-input:focus {
  border-color:#64a7e5; box-shadow:0 0 0 3px rgba(14,106,199,.09);
}
.airport-picker::after {
  content:"⌄"; position:absolute; right:13px; top:12px; color:#7a8ba0;
  pointer-events:none; font-size:15px; transition:transform .18s ease;
}
.airport-picker.open::after { transform:rotate(180deg); }

.airport-dropdown {
  position:absolute; left:0; top:52px; z-index:120;
  width:min(620px, calc(100vw - 32px)); background:#fff;
  border:1px solid #dbe4ed; border-radius:14px;
  box-shadow:0 18px 48px rgba(28,52,82,.20); overflow:hidden;
  contain:layout paint;
}
.airport-picker.align-right .airport-dropdown { left:auto; right:0; }

.airport-modal-head {
  display:none; align-items:center; justify-content:space-between;
  height:54px; padding:0 16px; border-bottom:1px solid #edf1f5; font-size:18px;
}
.airport-close {
  width:30px; height:30px; border:0; border-radius:50%;
  background:#f1f3f5; color:#8793a1; font-size:22px; line-height:1;
}

.airport-search-wrap { position:relative; margin:14px 16px 10px; }
.airport-search {
  width:100%; height:42px; padding:0 38px;
  border:1px solid #dce5ee; border-radius:9px;
  background:#f8fafc; outline:none; color:var(--ink);
}
.airport-search:focus {
  background:#fff; border-color:#4f9be3; box-shadow:0 0 0 3px rgba(14,106,199,.08);
}
.airport-search-icon {
  position:absolute; left:13px; top:10px; color:#8b98a7; font-size:18px; pointer-events:none;
}
.airport-search-clear {
  position:absolute; right:9px; top:8px; width:26px; height:26px;
  border:0; border-radius:50%; background:#e9edf1; color:#7c8897;
}

.airport-tabs {
  display:flex; padding:0 10px; border-bottom:1px solid #e9eef4;
  overflow-x:auto; scrollbar-width:none;
}
.airport-tabs::-webkit-scrollbar { display:none; }
.airport-tab {
  position:relative; flex:1 0 auto; min-width:82px; height:44px;
  padding:0 10px; border:0; background:#fff; color:#677488;
  font-size:13px; font-weight:650; white-space:nowrap;
}
.airport-tab:hover { color:var(--primary); background:#fbfdff; }
.airport-tab.active { color:var(--primary); font-weight:800; }
.airport-tab.active::after {
  content:""; position:absolute; left:12px; right:12px; bottom:-1px;
  height:2px; background:var(--primary); border-radius:2px 2px 0 0;
}

.airport-content { max-height:340px; overflow:auto; padding:16px 18px 18px; contain:layout paint; }
.airport-result-title {
  margin:0 0 8px; color:#6b7788; font-size:12px; font-weight:700;
}
.airport-result-title:empty { display:none; }

.airport-grid {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
  gap:4px 8px; align-items:start;
}
.airport-grid.grouped { grid-template-columns:repeat(5,minmax(0,1fr)); }
.airport-letter-row {
  grid-column:1 / -1; color:#687482; font-size:13px; font-weight:800;
  border-top:1px solid #f0f3f6; padding:12px 4px 5px; margin-top:5px;
}
.airport-letter-row:first-child { border-top:0; padding-top:2px; margin-top:0; }

.airport-city {
  min-width:0; min-height:42px; border:0; border-radius:7px;
  padding:8px 7px; background:#fff; color:#26384d; text-align:center;
  display:flex; align-items:center; justify-content:center; gap:4px; line-height:1.2;
}
.airport-city:hover,.airport-city:focus {
  background:#edf6ff; color:var(--primary); outline:none;
}
.airport-city-name {
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600;
}
.airport-city-code {
  flex:0 0 auto; color:#8c98a6; font-size:11px; font-weight:700;
}
.airport-city:hover .airport-city-code,.airport-city:focus .airport-city-code { color:#4b8dcc; }
.airport-empty {
  grid-column:1 / -1; padding:54px 12px; text-align:center; color:#8b98a8;
}

.swap-btn { width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--primary); font-size:20px; }
.advanced { margin-top:16px; border-top:1px dashed var(--line); padding-top:13px; }
.advanced summary { color:var(--primary); font-weight:700; cursor:pointer; }
.primary-btn { margin-top:20px; width:100%; border:0; border-radius:13px; padding:14px 18px; color:#fff; background:linear-gradient(90deg,var(--primary),#168ed2); font-weight:800; box-shadow:0 8px 18px rgba(14,106,199,.20); }
.primary-btn:hover { background:linear-gradient(90deg,var(--primary-dark),#087dbc); }
.primary-btn.secondary { width:auto; padding-left:28px; padding-right:28px; }
.rule-tip { margin-top:12px; background:var(--warn); color:#795f17; padding:10px 12px; border-radius:10px; font-size:12px; line-height:1.7; }
.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:16px 0; }
.stat { background:#fff; border:1px solid var(--line); border-radius:16px; padding:17px; }
.stat strong { display:block; font-size:23px; color:var(--primary); margin-top:5px; }
.stat span { color:var(--muted); font-size:12px; }
.results-section { margin-top:22px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; padding:0 4px 10px; }
.section-heading h2 { margin:0; font-size:20px; }
.section-heading p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.return-heading { margin-top:26px; }
.results-list { display:grid; gap:14px; }
.empty-state { min-height:120px; border:1px dashed #cbd8e5; border-radius:16px; color:#8190a4; display:flex; justify-content:center; align-items:center; background:rgba(255,255,255,.65); }
.flight-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:19px; box-shadow:0 8px 24px rgba(41,70,104,.06); }
.flight-card-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding-bottom:13px; border-bottom:1px solid #edf1f5; }
.tags { display:flex; flex-wrap:wrap; gap:7px; }
.tag { background:var(--soft); color:#38658f; border-radius:999px; padding:5px 9px; font-size:11px; font-weight:700; }
.tag.product { background:#e8f8f4; color:#08776f; }
.tag.stop { background:#fff2e7; color:#9a5618; }
.flight-summary { font-size:12px; color:var(--muted); }
.segment { display:grid; grid-template-columns:115px 1fr 115px; gap:16px; align-items:center; padding:17px 0; }
.time-block strong { display:block; font-size:26px; letter-spacing:-.03em; }
.time-block span { display:block; font-size:12px; color:var(--muted); margin-top:3px; }
.time-block.right { text-align:right; }
.timeline { position:relative; display:flex; align-items:center; gap:9px; color:#7a8ba0; font-size:12px; }
.timeline::before,.timeline::after { content:""; height:1px; background:#cfd9e4; flex:1; }
.timeline .plane { font-size:17px; color:var(--primary); }
.segment-meta { grid-column:1/-1; display:flex; gap:12px; flex-wrap:wrap; color:#66788e; font-size:11px; margin-top:-8px; }
.connection { text-align:center; margin:-3px 0; color:#8a6617; background:#fff8e5; border-radius:9px; padding:7px 10px; font-size:11px; }
.hidden { display:none !important; }
.overview-title { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.overview-title h2 { margin:0; }
.overview-title p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.route-count { font-size:26px; font-weight:800; color:var(--primary); }
.table-card { margin-top:16px; padding:0; overflow:auto; }
.routes-table { width:100%; border-collapse:collapse; min-width:860px; }
.routes-table th { background:#eef5fb; color:#45627f; font-size:12px; text-align:left; padding:13px 14px; position:sticky; top:0; }
.routes-table td { border-top:1px solid #edf1f5; padding:13px 14px; font-size:13px; vertical-align:top; }
.routes-table tr:hover td { background:#fafcff; }
.routes-table .dest strong { display:block; }
.routes-table .sub { color:var(--muted); font-size:11px; margin-top:3px; }
.routes-table .mono { font-variant-numeric:tabular-nums; }
footer { text-align:center; color:#7b8999; font-size:12px; padding:16px 20px 34px; }

@media (max-width: 820px) {
  .hero { padding:32px 16px 58px; }
  .hero-inner { display:block; }
  .hero h1 { font-size:30px; }
  .data-badge { display:inline-block; margin-top:18px; }
  .container { padding:0 12px; margin-top:-28px; }
  .search-card { padding:18px; border-radius:18px; }
  .route-row { grid-template-columns:1fr 38px 1fr; gap:8px; }
  .swap-btn { width:38px; height:38px; }
  .options-row,.advanced-grid,.overview-filter-grid { grid-template-columns:1fr 1fr; }
  .stats-grid { grid-template-columns:1fr; }
  .segment { grid-template-columns:90px 1fr 90px; gap:8px; }
  .time-block strong { font-size:21px; }
  .flight-card-head { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 520px) {
  .options-row,.advanced-grid,.overview-filter-grid { grid-template-columns:1fr; }
  .route-row { grid-template-columns:1fr; }
  .swap-btn { justify-self:center; transform:rotate(90deg); }
  .segment { grid-template-columns:78px 1fr 78px; }
  .timeline { font-size:10px; }
}




/* 海航式城市选择器：桌面弹层，移动端底部大面板 */
@media (max-width: 720px) {
  .airport-dropdown {
    position:fixed; left:10px !important; right:10px !important; top:auto; bottom:10px;
    width:auto; max-height:88vh; border-radius:18px;
    box-shadow:0 22px 70px rgba(18,37,58,.28);
  }
  .airport-modal-head { display:flex; }
  .airport-search-wrap { margin:12px 14px 8px; }
  .airport-tabs { padding:0 4px; }
  .airport-tab { min-width:74px; height:42px; padding:0 8px; font-size:12px; }
  .airport-content { max-height:58vh; padding:14px 12px 18px; }
  .airport-grid,.airport-grid.grouped {
    grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px;
  }
  .airport-city { min-height:44px; padding:8px 5px; }
}
@media (max-width: 390px) {
  .airport-tab { min-width:68px; font-size:11px; }
  .airport-city { font-size:13px; }
  .airport-city-code { font-size:10px; }
}


/* 航线总览：实际运行日期 */
.schedule-warning {
  color:#a16712 !important;
  font-weight:650;
}
.date-detail-btn {
  margin-top:7px;
  padding:5px 10px;
  border:1px solid #bcd9f3;
  border-radius:7px;
  background:#f1f8ff;
  color:var(--primary);
  font-size:11px;
  font-weight:750;
}
.date-detail-btn:hover { background:#e2f1ff; }

.route-date-row td {
  padding:0 !important;
  background:#f8fbfe !important;
}
.route-date-panel {
  padding:18px 20px 22px;
  border-top:1px solid #dce7f1;
}
.route-date-summary {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:14px 22px;
  margin-bottom:16px;
  font-size:12px;
  color:#5e6f82;
}
.route-date-summary > div {
  display:flex;
  align-items:center;
  gap:7px;
}
.route-date-summary .calendar-note {
  flex:1 1 360px;
  font-size:11px;
  line-height:1.6;
  color:#7a8999;
}
.legend-dot {
  width:10px; height:10px; border-radius:3px; display:inline-block;
}
.legend-dot.operating { background:#15966f; }
.legend-dot.b-candidate { background:#15966f; }
.legend-dot.running-only { background:#e9a23b; }
.legend-dot.inactive { background:#e4e9ee; border:1px solid #ced6de; }

.route-calendars {
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:16px;
}
.route-calendar-month {
  padding:14px;
  background:#fff;
  border:1px solid #e0e8f0;
  border-radius:13px;
}
.calendar-month-title {
  margin-bottom:10px;
  color:#213a55;
  font-weight:800;
  font-size:14px;
}
.calendar-weekdays,
.calendar-days {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:5px;
}
.calendar-weekdays {
  margin-bottom:5px;
  color:#8a97a5;
  font-size:10px;
  text-align:center;
  font-weight:700;
}
.calendar-day {
  aspect-ratio:1 / 1;
  min-height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  font-size:11px;
  font-variant-numeric:tabular-nums;
}
.calendar-day.operating,
.calendar-day.b-candidate {
  background:#daf4e9;
  color:#087452;
  border:1px solid #a9dfca;
  font-weight:800;
}
.calendar-day.running-only {
  background:#fff1dc;
  color:#a45b00;
  border:1px solid #f0c783;
  font-weight:800;
}
.calendar-day.inactive {
  background:#f0f2f4;
  color:#a1aab4;
  border:1px solid #e1e5e9;
}
.calendar-day.outside,
.calendar-day.blank {
  background:transparent;
  color:#d2d7dd;
  border:0;
}
.inactive-date-list {
  margin-top:14px;
  border-top:1px dashed #d8e1ea;
  padding-top:12px;
}
.inactive-date-list summary {
  cursor:pointer;
  color:#58718b;
  font-size:12px;
  font-weight:700;
}
.date-list-content {
  margin-top:10px;
  display:grid;
  gap:7px;
  color:#65768a;
  font-size:12px;
}
.date-list-line {
  display:flex;
  gap:12px;
  line-height:1.7;
}
.date-list-line strong {
  min-width:32px;
  color:#344d67;
}

@media (max-width: 760px) {
  .route-calendars { grid-template-columns:1fr; }
  .route-date-panel { padding:14px 12px 18px; }
}

.legend-dot.outside-window {
  background:#fff;
  border:1px dashed #d4dce4;
}
.calendar-day.outside-window {
  background:#fbfcfd;
  color:#c8cfd7;
  border:1px dashed #e3e8ed;
}

/* 航线总览的目的地与记录数保持在同一行。 */
.dest-title-line {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:24px;
  white-space:nowrap;
}
.routes-table .dest .dest-title-line strong { display:inline; }
.route-flight-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#eef5fb;
  color:#38658f;
  font-size:11px;
  font-weight:800;
  line-height:1;
}

.simple-route-legend {
  gap:18px;
  margin-bottom:14px;
  font-size:13px;
}
.legend-dot.route-on { background:#15966f; }
.legend-dot.route-off { background:#e4e9ee; border:1px solid #ced6de; }
.calendar-day.route-on {
  background:#daf4e9;
  color:#087452;
  border:1px solid #a9dfca;
  font-weight:800;
}
.calendar-day.route-off {
  background:#f0f2f4;
  color:#9ca6b1;
  border:1px solid #e1e5e9;
}

/* mobile compact overview v1 */
@media (max-width: 520px) {
  .hero {
    padding: 22px 14px 44px;
  }
  .hero h1 {
    margin: 7px 0 6px;
    font-size: 27px;
    line-height: 1.12;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: .16em;
  }
  .data-badge {
    margin-top: 11px;
    padding: 7px 11px;
    font-size: 11px;
  }
  .container {
    padding: 0 10px;
    margin-top: -27px;
  }
  .main-tabs {
    gap: 6px;
    margin-bottom: 10px;
  }
  .tab {
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 14px;
  }

  .route-overview-controls {
    padding: 14px 14px 15px;
    border-radius: 16px;
  }
  .overview-title {
    gap: 10px;
  }
  .overview-title h2 {
    font-size: 21px;
  }
  .route-count {
    font-size: 23px;
    white-space: nowrap;
  }

  .overview-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 8px;
    margin-top: 10px;
  }
  .overview-filter-grid .field {
    min-width: 0;
    gap: 4px;
  }
  .overview-filter-grid .field > span {
    font-size: 11px;
    line-height: 1.2;
  }
  .overview-filter-grid .field input,
  .overview-filter-grid .field select,
  .route-overview-controls .airport-input {
    height: 40px;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 10px;
    font-size: 14px;
  }
  .route-overview-controls .airport-input {
    padding-right: 30px;
  }
  .route-overview-controls .airport-picker::after {
    right: 10px;
    top: 9px;
  }
  .route-overview-controls .primary-btn.secondary {
    margin-top: 12px;
    min-height: 40px;
    padding: 10px 18px;
    border-radius: 11px;
    font-size: 14px;
  }

  .table-card {
    margin-top: 12px;
  }
}

/* HNA burgundy & gold visual refresh + compact mobile forms v2 */
:root {
  --bg: #f5f1ed;
  --card: #fffdfb;
  --ink: #2d1d22;
  --muted: #796b6f;
  --primary: #a20b2a;
  --primary-dark: #7f081f;
  --accent: #c69a4b;
  --line: #eaded9;
  --soft: #f7ece9;
  --shadow: 0 14px 38px rgba(87, 35, 40, .10);
}
body { background:linear-gradient(180deg,#f3eee9 0,#f7f4f1 55%,#f3eee9 100%); }
.hero {
  background:linear-gradient(135deg,#570816 0%,#8d1026 64%,#b0792f 100%);
  box-shadow:inset 0 -1px 0 rgba(255,220,157,.24);
}
.eyebrow { color:#f4d6a1; opacity:.95; }
.data-badge {
  border-color:rgba(239,204,142,.55);
  background:rgba(255,245,225,.10);
}
.tab.active { color:var(--primary); }
.primary-btn {
  background:linear-gradient(90deg,#941027,#bd1836);
  box-shadow:0 8px 18px rgba(151,16,42,.20);
}
.primary-btn:hover { background:linear-gradient(90deg,#79091f,#a90f2d); }
.field input:focus,.field select:focus,.airport-input:focus,.airport-search:focus {
  border-color:#ba6f7e;
  box-shadow:0 0 0 3px rgba(162,11,42,.08);
}
.tag.product { background:#f7ece1; color:#8b5b16; }

@media (max-width: 520px) {
  .hero { padding:20px 14px 42px; }
  .hero h1 { margin:6px 0 5px; font-size:25px; line-height:1.12; letter-spacing:-.02em; }
  .eyebrow { font-size:9px; letter-spacing:.16em; }
  .data-badge { margin-top:10px; padding:6px 10px; font-size:10px; }
  .container { padding:0 9px; margin-top:-26px; }
  .main-tabs { gap:5px; margin-bottom:9px; }
  .tab { padding:9px 14px; border-radius:10px; font-size:13px; }

  /* 航班搜索也使用紧凑布局，避免只优化航线总览。 */
  #searchPanel .search-card {
    padding:13px;
    border-radius:16px;
  }
  #searchPanel .segmented {
    margin-bottom:11px;
    padding:3px;
    border-radius:10px;
  }
  #searchPanel .segmented button {
    padding:7px 17px;
    border-radius:8px;
    font-size:13px;
  }
  #searchPanel .search-grid { gap:8px; }
  #searchPanel .route-row {
    position:relative;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    align-items:end;
  }
  #searchPanel .route-row > .field:first-child { grid-column:1; }
  #searchPanel .route-row > .field:last-child { grid-column:2; }
  #searchPanel .route-row .swap-btn {
    position:absolute;
    left:50%;
    top:31px;
    transform:translateX(-50%);
    width:30px;
    height:30px;
    z-index:4;
    background:#fffaf4;
    border-color:#dfc5b3;
    color:var(--primary);
    font-size:15px;
    box-shadow:0 3px 10px rgba(83,30,35,.08);
  }
  #searchPanel .field { min-width:0; gap:4px; }
  #searchPanel .field > span { font-size:11px; line-height:1.2; }
  #searchPanel .field input,
  #searchPanel .field select,
  #searchPanel .airport-input {
    height:40px;
    min-width:0;
    padding-left:9px;
    padding-right:9px;
    border-radius:10px;
    font-size:13px;
  }
  #searchPanel .airport-input { padding-right:28px; text-overflow:ellipsis; }
  #searchPanel .airport-picker::after { right:9px; top:9px; }
  #searchPanel .options-row,
  #searchPanel .advanced-grid {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px;
    margin-top:9px;
  }
  #searchPanel .advanced {
    margin-top:10px;
    padding-top:9px;
  }
  #searchPanel .advanced summary { font-size:12px; }
  #searchPanel .primary-btn {
    margin-top:11px;
    min-height:41px;
    padding:10px 14px;
    border-radius:11px;
    font-size:14px;
  }
  #searchPanel .stats-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin:9px 0;
  }
  #searchPanel .stat { padding:9px 7px; border-radius:11px; text-align:center; }
  #searchPanel .stat strong { margin-top:2px; font-size:17px; }
  #searchPanel .stat span { font-size:9px; }
  #searchPanel .results-section { margin-top:11px; }

  /* 航线总览继续保持两列紧凑筛选。 */
  .route-overview-controls { padding:13px; border-radius:16px; }
  .overview-title h2 { font-size:20px; }
  .route-count { font-size:22px; }
  .overview-filter-grid {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px;
    margin-top:9px;
  }
  .overview-filter-grid .field { min-width:0; gap:4px; }
  .overview-filter-grid .field > span { font-size:11px; line-height:1.2; }
  .overview-filter-grid .field input,
  .overview-filter-grid .field select,
  .route-overview-controls .airport-input {
    height:40px;
    min-width:0;
    padding-left:9px;
    padding-right:9px;
    border-radius:10px;
    font-size:13px;
  }
  .route-overview-controls .airport-input { padding-right:28px; }
  .route-overview-controls .airport-picker::after { right:9px; top:9px; }
  .route-overview-controls .primary-btn.secondary {
    margin-top:11px;
    min-height:40px;
    padding:9px 17px;
    border-radius:10px;
    font-size:13px;
  }
  .table-card { margin-top:10px; }
}

/* route overview table centered presentation */
.routes-table th,
.routes-table td {
  text-align: center;
}
.routes-table .dest .dest-title-line {
  justify-content: center;
}
.routes-table .dest .sub,
.routes-table .sub {
  text-align: center;
}
.routes-table td .date-detail-btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.routes-table td .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* route rows: vertically centered + compact date disclosure */
.routes-table .route-main-row > td {
  vertical-align: middle;
}
.routes-table .route-main-row .dest,
.routes-table .route-main-row .dest-title-line {
  align-items: center;
}
.date-toggle-btn {
  display: block;
  width: 22px;
  height: 18px;
  margin: 4px auto 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}
.date-toggle-btn:hover,
.date-toggle-btn:focus-visible {
  background: rgba(162, 11, 42, .08);
  outline: none;
}

/* inline route date triangle */
.route-days-line {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  line-height:1.2;
}
.route-days-line .date-toggle-btn {
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  background:transparent;
  color:var(--primary);
  font-size:10px;
  line-height:1;
  vertical-align:middle;
}
.route-days-line .date-toggle-btn:hover {
  background:var(--soft);
  border-radius:4px;
}

/* compact mobile route calendar sheet v1 */
.mobile-route-calendar-overlay {
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:rgba(31,22,26,.36);
  opacity:0;
  transition:opacity .18s ease;
  overscroll-behavior:contain;
}
.mobile-route-calendar-overlay[hidden] { display:none !important; }
.mobile-route-calendar-overlay.open { opacity:1; }
.mobile-route-calendar-sheet {
  width:100%;
  max-width:640px;
  max-height:min(78vh,680px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fffdfb;
  border-radius:18px 18px 0 0;
  box-shadow:0 -14px 42px rgba(62,21,29,.18);
  transform:translateY(100%);
  transition:transform .18s ease;
}
.mobile-route-calendar-overlay.open .mobile-route-calendar-sheet { transform:translateY(0); }
.mobile-route-calendar-head {
  flex:0 0 auto;
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 14px 9px 16px;
  border-bottom:1px solid #eee4df;
  background:#fffdfb;
}
.mobile-route-calendar-head > div {
  min-width:0;
  display:flex;
  align-items:baseline;
  gap:8px;
  overflow:hidden;
}
.mobile-route-calendar-head strong {
  flex:0 0 auto;
  font-size:15px;
  color:var(--ink);
}
.mobile-route-calendar-subtitle {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  color:var(--muted);
}
.mobile-route-calendar-close {
  flex:0 0 auto;
  width:32px;
  height:32px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#f4ece8;
  color:#725c61;
  font-size:22px;
  line-height:1;
}
.mobile-route-calendar-scroll {
  flex:1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  background:#fff;
}
body.mobile-calendar-open { overflow:hidden; }

@media (max-width:640px) {
  /* 手机上展开详情使用独立底部月历，表格里的详情行始终不展开。 */
  .routes-table .route-date-row { display:none !important; }

  .mobile-route-calendar-scroll .route-date-panel {
    padding:0;
    background:#fff;
  }
  .mobile-route-calendar-scroll .simple-route-legend {
    display:none;
  }
  .mobile-route-calendar-scroll .route-calendars {
    display:block;
  }
  .mobile-route-calendar-scroll .route-calendar-month {
    padding:12px 12px 14px;
    border:0;
    border-radius:0;
    background:#fff;
  }
  .mobile-route-calendar-scroll .route-calendar-month + .route-calendar-month {
    border-top:7px solid #f5f1ed;
  }
  .mobile-route-calendar-scroll .calendar-month-title {
    margin:1px 0 8px;
    text-align:center;
    color:#35272b;
    font-size:14px;
    font-weight:800;
  }
  .mobile-route-calendar-scroll .calendar-weekdays,
  .mobile-route-calendar-scroll .calendar-days {
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:0;
  }
  .mobile-route-calendar-scroll .calendar-weekdays {
    margin:0 0 2px;
    color:#91858a;
    font-size:10px;
    font-weight:650;
  }
  .mobile-route-calendar-scroll .calendar-weekdays span {
    height:24px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .mobile-route-calendar-scroll .calendar-day {
    position:relative;
    aspect-ratio:auto;
    min-height:31px;
    height:31px;
    padding:0;
    border:0 !important;
    border-radius:0;
    background:transparent !important;
    font-size:12px;
    line-height:31px;
  }
  .mobile-route-calendar-scroll .calendar-day.route-on {
    color:var(--primary);
    font-weight:800;
  }
  .mobile-route-calendar-scroll .calendar-day.route-on::after {
    content:"";
    position:absolute;
    left:50%;
    bottom:2px;
    width:4px;
    height:4px;
    margin-left:-2px;
    border-radius:50%;
    background:var(--primary);
  }
  .mobile-route-calendar-scroll .calendar-day.route-off {
    color:#a8a0a3;
    font-weight:500;
  }
  .mobile-route-calendar-scroll .calendar-day.outside,
  .mobile-route-calendar-scroll .calendar-day.blank {
    color:#ded9db;
    font-weight:400;
  }
}

/* Bind each flight number to its own time row; dashed separators make each pair scanable. */
.flight-time-cell {
  min-width: 220px;
}
.flight-time-pairs {
  display: inline-flex;
  flex-direction: column;
  min-width: 205px;
  max-width: 100%;
  vertical-align: middle;
}
.flight-time-pair {
  display: grid;
  grid-template-columns: 72px minmax(118px, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 28px;
  padding: 4px 5px;
  white-space: nowrap;
}
.flight-time-pair + .flight-time-pair {
  border-top: 1px dashed #dccfc9;
}
.flight-pair-no {
  color: var(--ink);
  text-align: right;
  font-size: 12px;
  letter-spacing: .01em;
}
.flight-pair-time {
  padding-left: 9px;
  border-left: 1px solid #eaded9;
  color: var(--ink);
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
@media (max-width: 640px) {
  .flight-time-cell { min-width: 195px; }
  .flight-time-pairs { min-width: 182px; }
  .flight-time-pair {
    grid-template-columns: 62px minmax(108px, 1fr);
    gap: 6px;
    min-height: 25px;
    padding: 3px 2px;
  }
  .flight-pair-no,
  .flight-pair-time { font-size: 11px; }
  .flight-pair-time { padding-left: 7px; }
}

/* mobile information-density optimization v3 */
@media (max-width: 520px) {
  /* Search form: keep all fields, reduce chrome and vertical dead space. */
  #searchPanel .search-card {
    padding: 10px 11px 11px;
    border-radius: 14px;
  }
  #searchPanel .segmented {
    margin-bottom: 7px;
    padding: 2px;
    border-radius: 9px;
  }
  #searchPanel .segmented button {
    min-height: 30px;
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 12px;
  }
  #searchPanel .search-grid { gap: 6px; }
  #searchPanel .route-row {
    gap: 6px;
  }
  #searchPanel .field { gap: 3px; }
  #searchPanel .field > span {
    font-size: 10px;
    line-height: 1.15;
  }
  #searchPanel .field input,
  #searchPanel .field select,
  #searchPanel .airport-input {
    height: 36px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 9px;
    font-size: 12px;
  }
  #searchPanel .airport-input { padding-right: 25px; }
  #searchPanel .airport-picker::after {
    right: 8px;
    top: 7px;
    font-size: 13px;
  }
  #searchPanel .route-row .swap-btn {
    top: 25px;
    width: 26px;
    height: 26px;
    font-size: 13px;
    border-width: 1px;
  }
  #searchPanel .options-row,
  #searchPanel .advanced-grid {
    gap: 6px;
    margin-top: 6px;
  }
  #searchPanel .advanced {
    margin-top: 7px;
    padding-top: 6px;
  }
  #searchPanel .advanced summary {
    font-size: 11px;
    line-height: 1.2;
  }
  #searchPanel .primary-btn {
    margin-top: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
  }

  /* KPI strip: shallower cards, same information. */
  #searchPanel .stats-grid {
    gap: 5px;
    margin: 7px 0;
  }
  #searchPanel .stat {
    min-height: 48px;
    padding: 6px 4px 5px;
    border-radius: 10px;
  }
  #searchPanel .stat strong {
    margin-top: 1px;
    font-size: 16px;
    line-height: 1.05;
  }
  #searchPanel .stat span {
    font-size: 8px;
    line-height: 1.05;
  }

  /* Result heading: remove oversized gaps between query summary and cards. */
  #searchPanel .results-section {
    margin-top: 8px;
  }
  #searchPanel .section-heading {
    padding: 0 3px 5px;
  }
  #searchPanel .section-heading h2 {
    font-size: 18px;
    line-height: 1.2;
  }
  #searchPanel .section-heading p {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.25;
  }
  #searchPanel .return-heading {
    margin-top: 13px;
  }
  #searchPanel .results-list {
    gap: 8px;
  }

  /* Flight cards: horizontal header + tighter time axis, without dropping data. */
  #searchPanel .flight-card {
    padding: 11px 12px 10px;
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(73, 31, 38, .05);
  }
  #searchPanel .flight-card-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding-bottom: 7px;
  }
  #searchPanel .flight-card-head > div:first-child {
    min-width: 0;
  }
  #searchPanel .flight-card-head > div:first-child > strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.2;
  }
  #searchPanel .flight-summary {
    margin-top: 1px;
    font-size: 9px;
    line-height: 1.2;
  }
  #searchPanel .tags {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
  }
  #searchPanel .tag {
    padding: 3px 6px;
    font-size: 9px;
    line-height: 1.1;
  }
  #searchPanel .segment {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    gap: 6px;
    padding: 10px 0 7px;
  }
  #searchPanel .time-block strong {
    font-size: 20px;
    line-height: 1.05;
  }
  #searchPanel .time-block span {
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.2;
  }
  #searchPanel .timeline {
    gap: 5px;
    font-size: 9px;
    white-space: nowrap;
  }
  #searchPanel .timeline .plane {
    font-size: 14px;
  }
  #searchPanel .segment-meta {
    gap: 3px 7px;
    margin-top: -2px;
    font-size: 9px;
    line-height: 1.25;
  }
  #searchPanel .connection {
    margin: -1px 0;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 9px;
  }
}

/* mobile visual hierarchy & round-trip clarity v4 */
@media (max-width: 520px) {
  body {
    color:#493a3e;
    background:linear-gradient(180deg,#f7f2ee 0,#faf7f4 54%,#f4efeb 100%);
  }

  #searchPanel .search-card {
    background:#fffdfb;
    border-color:#eadfda;
    box-shadow:0 7px 20px rgba(92,44,51,.07);
    padding:11px 12px 12px;
  }
  #searchPanel .field > span {
    color:#7f6e73;
    font-weight:650;
  }
  #searchPanel .field input,
  #searchPanel .field select,
  #searchPanel .airport-input {
    height:38px;
    color:#493a3e;
    background:#fff;
    border-color:#eaded8;
    font-size:12.5px;
  }
  #searchPanel .route-row .swap-btn {
    top:27px;
    background:#fffaf6;
    border-color:#e5cfc7;
    color:#a20b2a;
  }
  #searchPanel .advanced {
    border-color:#ead9d5;
  }
  #searchPanel .advanced summary {
    color:#a20b2a;
    font-weight:750;
  }
  #searchPanel .primary-btn {
    background:linear-gradient(90deg,#a20b2a,#c52042);
    box-shadow:0 7px 15px rgba(162,11,42,.17);
  }

  #searchPanel .stats-grid {
    margin:8px 0 9px;
  }
  #searchPanel .stat {
    min-height:50px;
    background:#fffdfb;
    border-color:#eadfda;
    box-shadow:0 3px 10px rgba(90,48,52,.035);
  }
  #searchPanel .stat span {
    color:#9a8a8e;
    font-size:8.5px;
  }
  #searchPanel .stat strong {
    color:#a20b2a;
    font-size:16px;
    font-weight:800;
  }

  #searchPanel .section-heading {
    padding:1px 4px 6px;
  }
  #searchPanel .section-heading h2 {
    color:#4a383d;
    font-size:18px;
    font-weight:800;
    letter-spacing:-.015em;
  }
  #searchPanel .section-heading p {
    color:#97878b;
    font-size:10px;
  }
  #searchPanel .return-heading {
    margin-top:14px;
    padding-top:2px;
  }

  #searchPanel .results-list {
    gap:9px;
  }
  #searchPanel .flight-card {
    padding:12px 13px 11px;
    border-color:#eadfda;
    background:#fffdfb;
    box-shadow:0 5px 16px rgba(76,39,45,.045);
  }
  #searchPanel .flight-card-head {
    gap:8px;
    padding-bottom:8px;
    border-bottom-color:#f0e8e4;
  }
  #searchPanel .flight-card-head > div:first-child > strong {
    color:#49373c;
    font-size:14px;
    font-weight:780;
  }
  #searchPanel .flight-summary {
    color:#9a8b8e;
    font-size:9px;
  }
  #searchPanel .tag {
    background:#f2f4f6;
    color:#6f7b86;
    padding:3px 6px;
    font-size:9px;
    font-weight:700;
  }
  #searchPanel .tag.product {
    background:#f8ecdf;
    color:#956118;
  }
  #searchPanel .tag.stop {
    background:#f8efea;
    color:#a05d44;
  }

  #searchPanel .segment {
    grid-template-columns:74px minmax(0,1fr) 74px;
    gap:7px;
    padding:11px 0 8px;
  }
  #searchPanel .time-block strong {
    color:#821127;
    font-size:20px;
    font-weight:780;
  }
  #searchPanel .time-block span {
    color:#8e8285;
    font-size:9px;
    line-height:1.28;
  }
  #searchPanel .timeline {
    color:#8290a0;
    font-size:9px;
  }
  #searchPanel .timeline::before,
  #searchPanel .timeline::after {
    background:#d9e0e7;
  }
  #searchPanel .timeline .plane {
    color:#b21735;
  }
  #searchPanel .segment-meta {
    color:#8190a0;
    font-size:9px;
    line-height:1.3;
    gap:4px 8px;
  }
  #searchPanel .connection {
    color:#91651f;
    background:#fbf3e7;
  }
}

/* overview direction / roundtrip presentation */
.overview-filter-grid { grid-template-columns:repeat(7,minmax(0,1fr)); }
.roundtrip-flight-times { display:flex; flex-direction:column; gap:5px; }
.roundtrip-direction-line {
  display:grid; grid-template-columns:24px minmax(0,1fr); align-items:center; gap:5px;
}
.route-dir-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:6px;
  background:#f7ece9; color:var(--primary); font-size:10px; font-weight:800;
}
.roundtrip-direction-line + .roundtrip-direction-line { border-top:1px dashed #dccfc9; padding-top:5px; }
.roundtrip-direction-line .flight-time-pair + .flight-time-pair { border-top:1px dashed #eaded9; }
.roundtrip-schedule { display:flex; flex-direction:column; gap:4px; line-height:1.3; }
.roundtrip-schedule b { color:var(--primary); margin-right:3px; }
.roundtrip-calendar-wrap { display:grid; gap:14px; }
.roundtrip-calendar-side > h4 {
  margin:0; padding:8px 12px; border-bottom:1px solid #eaded9;
  color:var(--primary); background:#fffaf7; font-size:13px;
}
.roundtrip-calendar-side .route-date-panel { border-top:0; }
@media (max-width: 520px) {
  .overview-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .roundtrip-direction-line { grid-template-columns:20px minmax(0,1fr); gap:3px; }
  .route-dir-badge { width:19px; height:19px; font-size:9px; }
  .roundtrip-calendar-wrap { gap:8px; }
}

