:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #1f2933;
  --muted: #657080;
  --line: #ded6c8;
  --rail: #7f1d1d;
  --forest: #1f5d50;
  --gold: #b8872d;
  --blue: #285b8f;
  --shadow: 0 18px 44px rgba(31, 41, 51, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 999;
  transform: translateY(-140%);
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  padding: 22px 18px;
  color: #fff;
  background: #15211f;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #efe0b4);
  color: #1a1610;
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: #c8d1cc; }
.nav {
  display: grid;
  gap: 6px;
}
.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d8e0dc;
  font-weight: 700;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
}
.side-note b, .side-note span { display: block; }
.side-note span { color: #d8e0dc; font-size: 13px; margin-top: 6px; }

main {
  margin-left: 252px;
  padding: 28px;
}
.hero, .section {
  max-width: 1280px;
  margin: 0 auto 24px;
}
.hero {
  min-height: 56vh;
  display: grid;
  align-content: end;
  gap: 22px;
  padding: 48px;
  border-radius: 0 0 8px 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(21,33,31,.9), rgba(21,33,31,.58), rgba(21,33,31,.28)),
    url("https://images.unsplash.com/photo-1474487548417-781cb71495f3?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.hero-copy { max-width: 760px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
  letter-spacing: 0;
}
h2 { margin-bottom: 8px; font-size: 28px; }
h3 { margin-bottom: 8px; font-size: 19px; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 220px 220px;
  gap: 10px;
}
.overview-toolbar { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.catalog-toolbar { grid-template-columns: minmax(240px, 1fr); margin-bottom: 18px; }
.toolbar input, .toolbar select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface-solid);
}
.toolbar input::placeholder { color: var(--muted); }
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric, .card, .schedule-card, .feature-card, .source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(31,41,51,.06);
}
.metric {
  padding: 14px;
  color: var(--ink);
}
.metric b { display: block; font-size: 28px; }
.metric span { color: var(--muted); font-size: 13px; }

.section {
  padding: 28px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(222,214,200,.72);
  border-radius: 8px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}
.catalog-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.catalog-controls select {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}
.train-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-head {
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--rail), #273b37);
}
.card-body {
  padding: 16px;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.drawer-trigger {
  width: 100%;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(248,250,252,.82);
  cursor: pointer;
  text-align: left;
}
.drawer-trigger span,
.drawer-trigger small {
  display: block;
}
.drawer-trigger span {
  font-weight: 900;
}
.drawer-trigger small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.drawer-trigger:hover {
  border-color: var(--brand);
  background: var(--brand-dim);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(15,23,42,.38);
  backdrop-filter: blur(3px);
}
.train-side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1900;
  width: min(460px, 92vw);
  padding: 28px;
  overflow-y: auto;
  background: var(--surface-solid);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(15,23,42,.18);
  transform: translateX(100%);
  transition: transform .24s ease;
}
.train-side-drawer[aria-hidden="false"] {
  transform: translateX(0);
}
.drawer-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.drawer-kicker {
  margin-top: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.drawer-subtitle {
  margin-top: -2px;
  color: var(--muted);
}
.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.drawer-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.drawer-section h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}
.drawer-section p,
.drawer-section ul {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.drawer-section ul {
  padding-left: 18px;
}
.drawer-section li {
  margin-bottom: 6px;
}
.official-link {
  color: var(--brand);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.drawer-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.drawer-specs div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(248,250,252,.82);
}
.drawer-specs b,
.drawer-specs span {
  display: block;
}
.drawer-specs b {
  margin-bottom: 3px;
  font-size: 12px;
}
.drawer-specs span {
  color: var(--muted);
  font-size: 12px;
}
body.drawer-open {
  overflow: hidden;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f0eadf;
  color: #485260;
  font-size: 12px;
  font-weight: 800;
}
.tag.warn {
  background: #fff1cc;
  color: #8a5a00;
}
.route-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.spec {
  padding: 9px;
  border-radius: 8px;
  background: #f7f3eb;
}
.spec b, .spec span { display: block; }
.spec span { color: var(--muted); font-size: 12px; }

.split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}
.section-copy { color: var(--muted); }
.schedule-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.schedule-card { padding: 14px; }
.schedule-card ul { margin: 10px 0 0 18px; padding: 0; }
.schedule-card li { margin-bottom: 6px; }
.timetable {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.map {
  width: 100%;
  height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #e8efe8;
}
.map-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.swatch { width: 14px; height: 4px; border-radius: 4px; }
.feature-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.feature-card, .source-item { padding: 14px; }
.feature-card p, .source-item p { color: var(--muted); margin-bottom: 0; }
.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.source-item a { color: var(--blue); font-weight: 800; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  main { padding: 12px; }
  .hero, .section { padding: 20px; }
  .metrics, .train-grid, .schedule-board, .feature-grid, .insight-grid, .source-list { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .catalog-controls { width: 100%; flex-wrap: wrap; }
  .map { height: 520px; }
}

/* G9WIKI aviation-style visual unification */
:root {
  --bg: #f8fafc;
  --bg-2: #eef3f8;
  --panel: rgba(255,255,255,.92);
  --surface: rgba(255,255,255,.78);
  --surface-strong: rgba(255,255,255,.92);
  --surface-solid: #fff;
  --ink: #172033;
  --text: #172033;
  --muted: #64748b;
  --line: rgba(15,23,42,.10);
  --rail: #2563eb;
  --forest: #0f766e;
  --gold: #b45309;
  --blue: #2563eb;
  --brand: #2563eb;
  --brand-2: #0f766e;
  --brand-dim: rgba(37,99,235,.11);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(15,23,42,.10);
  --shadow-lg: 0 18px 52px rgba(15,23,42,.16);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

body {
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% -8%, rgba(37,99,235,.13), transparent 30%),
    radial-gradient(circle at 96% 10%, rgba(14,165,233,.10), transparent 26%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-2) 100%);
}

.sidebar {
  width: 200px;
  padding: 24px 18px;
  background: var(--surface-strong);
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.brand {
  padding: 10px 8px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.54);
}
.brand:hover { background: rgba(255,255,255,.74); }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg,var(--brand),#1d4ed8);
  color: #fff;
  box-shadow: var(--shadow);
}
.brand strong {
  font-family: "Noto Serif SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",serif;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.nav { gap: 2px; }
.nav a {
  color: var(--muted);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: all var(--transition);
}
.nav a.active,
.nav a:hover {
  background: rgba(37,99,235,.08);
  color: var(--ink);
  transform: translateX(2px);
}
.side-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.48);
}
.side-note b { color: var(--brand); }
.side-note span { color: var(--muted); }

main { margin-left: 200px; padding: 28px min(4vw,52px) 64px; }
.hero,
.section { max-width: 1440px; }
.hero {
  min-height: 330px;
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-lg);
  background:
    linear-gradient(135deg,rgba(15,23,42,.86),rgba(37,99,235,.52)),
    url("https://images.unsplash.com/photo-1474487548417-781cb71495f3?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.hero .eyebrow { color: #fde68a; letter-spacing: 0; }
.hero-copy p { color: rgba(255,255,255,.86); }
h1 { font-size: clamp(30px,4.6vw,58px); line-height: 1.04; }
h2 { color: var(--text); font-size: 22px; }

.section {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.metric,
.card,
.schedule-card,
.feature-card,
.source-item,
.table-wrap,
.status-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.metric b { color: var(--brand); }
.metric span,
.feature-card p,
.source-item p,
.section-copy,
.route-copy,
.map-note,
.legend span,
.timetable { color: var(--muted); }
.card-head { background: linear-gradient(135deg,var(--brand),var(--brand-2)); }
.tag {
  background: rgba(37,99,235,.10);
  color: var(--brand);
}
.spec { background: rgba(248,250,252,.82); }
.toolbar input,
.toolbar select,
select,
input,
button {
  border-radius: var(--radius);
}
.toolbar input:focus,
.toolbar select:focus,
select:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.source-item a { color: var(--brand); }

body.dark-mode {
  --bg: #07111f;
  --bg-2: #0f172a;
  --panel: rgba(15, 23, 42, .92);
  --surface: rgba(15, 23, 42, .78);
  --surface-strong: rgba(15, 23, 42, .94);
  --surface-solid: #111827;
  --ink: #e5e7eb;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, .14);
  --shadow: 0 16px 42px rgba(0, 0, 0, .34);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, rgba(37,99,235,.22), transparent 30%),
    radial-gradient(circle at 96% 10%, rgba(20,184,166,.15), transparent 26%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-2) 100%);
}

body.dark-mode .sidebar,
body.dark-mode .hero,
body.dark-mode .section,
body.dark-mode .train-card,
body.dark-mode .feature-card,
body.dark-mode .metric,
body.dark-mode .map,
body.dark-mode .train-side-drawer,
body.dark-mode .drawer-panel {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
}

body.dark-mode .brand,
body.dark-mode .nav a.active,
body.dark-mode .nav a:hover,
body.dark-mode input,
body.dark-mode select,
body.dark-mode button,
body.dark-mode .status-pill,
body.dark-mode .tag,
body.dark-mode .toolbar,
body.dark-mode .legend-item,
body.dark-mode .spec,
body.dark-mode .drawer-specs div {
  background-color: rgba(15, 23, 42, .9);
  border-color: var(--line);
  color: var(--ink);
}

body.dark-mode .brand small,
body.dark-mode .nav a,
body.dark-mode .card-meta,
body.dark-mode .muted,
body.dark-mode .map-note,
body.dark-mode .side-note,
body.dark-mode .drawer-specs span {
  color: var(--muted);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .eyebrow {
  color: var(--ink);
}

body.dark-mode .drawer-backdrop {
  background: rgba(2, 6, 23, .72);
}

body.dark-mode .leaflet-tile {
  filter: brightness(.74) contrast(1.08) saturate(.82);
}
