/**
 * 广东城际通 (www.gdcjt.com) · 城际打字挑战视觉样式系统
 * 默认采用日间白蓝智慧出行主题，支持一键切换夜间极客调度中心主题
 */

:root,
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-panel: #ffffff;
  --bg-card: #f8fafc;
  --bg-card-elevated: #eff6ff;
  --bg-map: #d8e8f8;
  --border-subtle: rgba(42, 90, 166, 0.15);
  --border-strong: rgba(42, 90, 166, 0.42);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --brand-intercity: #2a5aa6;
  --brand-primary: #2a5aa6;
  --brand-accent: #0284c7;
  --gate-red: #e11d48;
  --express-green: #059669;
  --limited-purple: #7c3aed;
  --amber-gold: #d97706;

  --map-core-fill: #f8fafc;
  --map-active-city-fill: #ffffff;
  --map-neighbor-fill: #e8eef5;
  --map-region-stroke: rgba(42, 90, 166, 0.34);
  --map-grid-stroke: rgba(42, 90, 166, 0.09);
  --map-city-zh: rgba(42, 90, 166, 0.28);
  --map-city-en: rgba(42, 90, 166, 0.20);
  --map-sea-text: rgba(2, 132, 199, 0.35);
  --map-station-label: #0f172a;
  --map-station-bg: #ffffff;

  --shadow-card: 0 8px 24px -4px rgba(42, 90, 166, 0.12);
}

[data-theme="dark"] {
  --bg-app: #0b1120;
  --bg-panel: #111827;
  --bg-card: #1e293b;
  --bg-card-elevated: #263349;
  --bg-map: #070d19;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(56, 189, 248, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --brand-intercity: #2a5aa6;
  --brand-primary: #0ea5e9;
  --brand-accent: #38bdf8;
  --gate-red: #f43f5e;
  --express-green: #10b981;
  --limited-purple: #a855f7;
  --amber-gold: #f59e0b;

  --map-core-fill: rgba(30, 41, 59, 0.72);
  --map-active-city-fill: rgba(38, 56, 84, 0.90);
  --map-neighbor-fill: rgba(15, 23, 42, 0.65);
  --map-region-stroke: rgba(100, 116, 139, 0.38);
  --map-grid-stroke: rgba(51, 65, 85, 0.25);
  --map-city-zh: rgba(148, 163, 184, 0.25);
  --map-city-en: rgba(100, 116, 139, 0.20);
  --map-sea-text: rgba(56, 189, 248, 0.22);
  --map-station-label: #e2e8f0;
  --map-station-bg: #0f172a;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "JetBrains Mono", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==================== 顶部品牌导航栏 ==================== */
.topbar {
  height: 58px;
  padding: 0 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, #2a5aa6, #0ea5e9);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.logo-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--brand-intercity);
  color: #fff;
  letter-spacing: 1px;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-tools-group,
.nav-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-btn:hover {
  border-color: var(--brand-accent);
  transform: translateY(-1px);
}

.nav-btn.is-active {
  border-color: var(--brand-primary);
  background: rgba(14, 165, 233, 0.12);
}

.nav-btn-highlight {
  border-color: rgba(237, 28, 36, 0.35);
  background: rgba(237, 28, 36, 0.08);
  color: #ed1c24;
  text-decoration: none;
}

.nav-btn-highlight:hover {
  background: #ed1c24;
  color: #ffffff;
  border-color: #ed1c24;
}

.nav-btn-wechat {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #059669;
}

.nav-btn-wechat:hover {
  background: #059669;
  color: #fff;
}

/* ==================== 主工作区分栏 ==================== */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(480px, 1.12fr) minmax(460px, 0.88fr);
  min-height: 0;
}

/* ==================== 左侧：真实地理投影地图舱 ==================== */
.map-panel {
  position: relative;
  background: var(--bg-map);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.active-route-banner {
  pointer-events: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.red-gate-badge,
.red-gate-badge-compact {
  pointer-events: auto;
  background: var(--bg-panel);
  border: 1px solid rgba(244, 63, 94, 0.30);
  padding: 5px 11px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.gate-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gate-red);
  box-shadow: 0 0 6px var(--gate-red);
}

.red-gate-badge.is-checked-in,
.red-gate-badge-compact.is-checked-in {
  border-color: var(--express-green);
  color: var(--text-primary);
}

.red-gate-badge.is-checked-in .gate-dot,
.red-gate-badge-compact.is-checked-in .gate-dot {
  background: var(--express-green);
  box-shadow: 0 0 8px var(--express-green);
}

.line-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brand-intercity);
  display: inline-block;
}

.map-line-title {
  font-weight: 800;
  font-size: 14px;
}

.service-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.service-local {
  background: rgba(2, 132, 199, 0.14);
  color: var(--brand-accent);
}

.service-express {
  background: rgba(16, 185, 129, 0.16);
  color: var(--express-green);
}

.service-limited {
  background: rgba(244, 63, 94, 0.16);
  color: var(--gate-red);
}

.service-sprint30 {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-gold);
}

.map-cities-trail {
  font-size: 12px;
  color: var(--text-secondary);
}

.red-gate-badge {
  font-size: 11.5px;
  color: var(--text-secondary);
  border-color: rgba(244, 63, 94, 0.35);
}

.gate-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gate-red);
  box-shadow: 0 0 8px var(--gate-red);
}

.red-gate-badge.is-checked-in {
  border-color: var(--express-green);
  color: var(--text-primary);
}

.red-gate-badge.is-checked-in .gate-dot {
  background: var(--express-green);
  box-shadow: 0 0 10px var(--express-green);
}

.express-skip-toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.96), rgba(2, 132, 199, 0.96));
  color: #fff;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: opacity 0.25s ease;
}

.svg-container {
  flex: 1;
  width: 100%;
  height: 100%;
}

.gba-metro-map {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}

.gba-metro-map.is-grabbing {
  cursor: grabbing;
}

/* SVG 真实行政区划边界样式 */
.geo-grid-line {
  stroke: var(--map-grid-stroke);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.geo-sea-label {
  fill: var(--map-sea-text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 5px;
  pointer-events: none;
}

.geo-city-polygon {
  stroke: var(--map-region-stroke);
  stroke-width: 1.25;
  stroke-linejoin: round;
  transition: fill 0.25s ease;
}

.geo-city-polygon.is-core-city {
  fill: var(--map-core-fill);
}

.geo-city-polygon.is-neighbor-city {
  fill: var(--map-neighbor-fill);
  stroke-dasharray: 3 2;
  opacity: 0.85;
}

.geo-city-polygon.is-active-route-city {
  fill: var(--map-active-city-fill);
  stroke-width: 1.6;
}

.geo-city-label-zh {
  fill: var(--map-city-zh);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  pointer-events: none;
}

.is-neighbor-label .geo-city-label-zh {
  font-size: 13px;
  opacity: 0.7;
}

.geo-city-label-en {
  fill: var(--map-city-en);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  pointer-events: none;
}

.geo-waterway-path {
  fill: none;
  stroke: url(#water-grad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-inactive-line-path {
  fill: none;
  stroke-width: 3.2;
  opacity: 0.34;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  transition: opacity 0.2s, stroke-width 0.2s;
}

.map-inactive-line-path:hover {
  opacity: 0.8;
  stroke-width: 5;
}

.map-inactive-station-dot {
  opacity: 0.4;
  cursor: pointer;
}

.map-active-line-glow {
  fill: none;
  stroke-width: 9;
  opacity: 0.22;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-active-line-base {
  fill: none;
  stroke-width: 4.2;
  opacity: 0.42;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-active-line-progress {
  fill: none;
  stroke-width: 5.5;
  opacity: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-station-node {
  cursor: pointer;
}

.station-circle-core {
  fill: var(--map-station-bg);
  stroke-width: 2.4;
  transition: transform 0.2s;
}

.map-station-node.is-passed .station-circle-core {
  fill: currentColor;
}

.map-station-node.is-pass-through .station-circle-core {
  opacity: 0.48;
  stroke-dasharray: 2 2;
}

.map-station-node.is-current-target .station-circle-core {
  fill: #fde047;
  stroke-width: 3;
}

.station-target-pulse {
  fill: none;
  stroke-width: 2;
  animation: mapPulse 1.5s infinite ease-out;
}

@keyframes mapPulse {
  0% {
    r: 6;
    opacity: 0.95;
  }
  100% {
    r: 20;
    opacity: 0;
  }
}

.station-map-label {
  fill: var(--map-station-label);
  font-size: 10.5px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--map-station-bg);
  stroke-width: 3.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-map-label.is-target-label {
  fill: #d97706;
  font-size: 12.5px;
  font-weight: 900;
}

[data-theme="dark"] .station-map-label.is-target-label {
  fill: #fde047;
}

.train-radar-halo {
  opacity: 0.24;
  animation: radarPulse 1.3s infinite alternate ease-in-out;
}

@keyframes radarPulse {
  from { r: 13; opacity: 0.15; }
  to { r: 22; opacity: 0.35; }
}

.train-floating-pill {
  fill: #0f172a;
  stroke: #38bdf8;
  stroke-width: 1.4;
  opacity: 0.94;
}

.train-floating-text {
  fill: #f8fafc;
  font-size: 11px;
  font-weight: 800;
}

.map-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.map-controls-left,
.map-legend {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-ctrl-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.map-ctrl-btn:hover,
.map-ctrl-btn.is-active {
  border-color: var(--brand-primary);
  color: var(--brand-accent);
}

.map-legend {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  gap: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot-stop,
.dot-hub,
.dot-pass {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-stop {
  background: var(--brand-primary);
}

.dot-hub {
  border: 2.5px solid var(--amber-gold);
  background: #fff;
}

.dot-pass {
  border: 1.5px dashed var(--text-secondary);
}

/* ==================== 右侧：打字竞技与控制座舱 ==================== */
.cockpit-panel {
  background: var(--bg-panel);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
}

.selector-card,
.pids-display-card,
.typing-arena-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.gdcjt-mini-link {
  font-size: 12px;
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
}

.gdcjt-mini-link:hover {
  text-decoration: underline;
}

.line-tabs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.line-tab-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--line-color, #2a5aa6);
  color: var(--text-primary);
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.line-tab-btn:hover {
  border-color: var(--line-color, var(--brand-primary));
  transform: translateY(-1px);
}

.line-tab-btn.is-active {
  background: var(--bg-card-elevated);
  border-color: var(--line-color, var(--brand-primary));
  box-shadow: 0 0 0 1px var(--line-color, var(--brand-primary));
}

.line-tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
}

.line-tab-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-tag-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.segmented-control {
  display: flex;
  flex: 1;
  background: var(--bg-panel);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

.seg-btn.is-active {
  background: var(--brand-intercity);
  color: #ffffff;
}

.direction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.direction-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.direction-info strong {
  font-size: 12.5px;
  color: var(--text-primary);
}

.stops-count-badge {
  font-size: 11px;
  color: var(--text-muted);
}

.direction-actions {
  display: flex;
  gap: 5px;
}

.action-chip-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.action-chip-btn:hover {
  border-color: var(--brand-accent);
}

/* ==================== 统一车站到站与核心打字卡片 (tw-metro-typing 风格) ==================== */
.station-focus-card,
.typing-arena-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.station-focus-card.shake-error,
.typing-arena-card.shake-error {
  animation: arenaShake 0.26s ease;
  border-color: var(--gate-red);
}

@keyframes arenaShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.st-focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-subtle);
}

.st-focus-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kicker-pill {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--brand-accent);
  background: rgba(14, 165, 233, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.st-seq-text {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
}

.stop-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-intercity);
  color: #fff;
}

.st-city-pill {
  font-size: 11px;
  color: var(--text-muted);
}

.st-focus-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-station-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--bg-panel);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.next-label {
  color: var(--text-muted);
  font-size: 10px;
}

.next-station-box strong {
  color: var(--text-primary);
}

.mini-voice-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}

.mini-voice-btn:hover {
  border-color: var(--brand-accent);
}

.combo-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--express-green);
}

/* 车站居中视觉 */
.st-hero-box {
  text-align: center;
  padding: 2px 0;
}

.st-hero-zh {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
  line-height: 1.15;
}

.st-hero-en {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.st-transfers-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.transfer-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-gold);
  font-weight: 600;
}

/* 粤拼/方言免责提示条 */
.jyutping-disclaimer-bar {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-primary);
  text-align: center;
}

/* 汉字音节卡片与逐字母高亮 */
.syllable-tokens-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0;
}

.syllable-card {
  min-width: 62px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s;
}

.syllable-card.is-done {
  border-color: var(--express-green);
  background: rgba(16, 185, 129, 0.10);
}

.syllable-card.is-active {
  border-color: var(--brand-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.20);
}

.syllable-hanzi {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.syllable-phonetic {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
}

.syllable-tone {
  font-size: 10px;
  color: var(--amber-gold);
  margin-left: 1px;
}

.target-letters-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
  padding: 2px 6px;
}

.char-cell {
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}

.char-cell.is-space {
  width: 10px;
}

.char-cell.is-optional {
  font-size: 14px;
  opacity: 0.65;
}

.char-cell.is-typed {
  color: var(--express-green);
  background: rgba(16, 185, 129, 0.12);
}

.char-cell.is-current {
  color: var(--text-primary);
  background: rgba(14, 165, 233, 0.24);
  border-bottom-color: var(--brand-accent);
}

/* 输入框 */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.typing-input {
  width: 100%;
  padding: 10px 80px 10px 14px;
  border-radius: 9px;
  border: 2px solid var(--border-strong);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.typing-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.input-shortcut-hint {
  position: absolute;
  right: 10px;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* 彩蛋与小提示 */
.easter-egg-zone {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cultural-tip-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.30);
}

.tip-char-box {
  min-width: 36px;
  height: 36px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--amber-gold);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  margin-bottom: 1px;
}

.tip-tag {
  background: rgba(245, 158, 11, 0.25);
  color: var(--amber-gold);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
}

.tip-meaning {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.station-trivia-banner {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-panel);
  padding: 6px 10px;
  border-radius: 7px;
  border-left: 3px solid var(--brand-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== 极简实时成绩仪表盘 (Scorebar，tw-metro-typing 4 列布局) ==================== */
.telemetry-scorebar,
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
}

.score-col,
.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  background: transparent;
  border: none;
  padding: 0;
}

.score-label,
.metric-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value,
.metric-value {
  font-size: 18px;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
}

.score-speed-wrap {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.score-unit,
.metric-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==================== 模态框与荣誉乘车证车票 ==================== */
.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 25, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.modal-large {
  max-width: 960px;
}

.modal-header,
.ticket-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #2a5aa6, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-sub {
  font-size: 12px;
  opacity: 0.88;
  margin-top: 2px;
}

.modal-close-btn {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
}

.modal-disclaimer-banner {
  padding: 9px 20px;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12px;
  color: var(--text-primary);
}

.modal-disclaimer-note {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.32);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.ticket-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 16px;
}

.ticket-serial {
  font-size: 11.5px;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.ticket-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.ticket-route-hero {
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 22px;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  text-align: center;
}

.ticket-station-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-city-tag {
  font-size: 11px;
  color: var(--brand-accent);
  font-weight: 700;
}

.ticket-st-zh {
  font-size: 26px;
  font-weight: 900;
}

.ticket-st-en {
  font-size: 12px;
  color: var(--text-secondary);
}

.ticket-arrow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ticket-train-code {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--brand-intercity);
  color: #fff;
}

.ticket-arrow-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-line-bar {
  flex: 1;
  height: 2px;
  background: var(--brand-accent);
}

.ticket-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
}

.ticket-dist-label {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.ticket-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.t-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t-stat span {
  font-size: 11px;
  color: var(--text-secondary);
}

.t-stat strong {
  font-size: 17px;
  font-weight: 800;
}

.fare-highlight {
  color: var(--gate-red);
}

.ticket-badges-section {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
}

.badge-label {
  font-weight: 700;
  color: var(--text-secondary);
}

.badge-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-badge {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(14, 165, 233, 0.16);
  color: var(--brand-accent);
  font-weight: 700;
}

.ticket-promo-footer {
  background: rgba(42, 90, 166, 0.12);
  border: 1px dashed var(--brand-accent);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.promo-left strong {
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.promo-left p {
  font-size: 12px;
  color: var(--text-secondary);
}

.promo-left a {
  color: var(--brand-accent);
  font-weight: 700;
}

.promo-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2a5aa6, #0284c7);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* ==================== 百科图鉴与票价速算器弹窗 ==================== */
.encyclopedia-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill-btn.is-active {
  background: var(--brand-intercity);
  color: #fff;
  border-color: var(--brand-intercity);
}

.enc-search-input {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  min-width: 260px;
  font-size: 12.5px;
}

.enc-stations-grid {
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.enc-station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enc-st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.enc-st-zh {
  font-size: 17px;
  font-weight: 800;
}

.enc-st-phonetics {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: monospace;
}

.enc-st-audio-row {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.enc-audio-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}

.enc-audio-btn:hover {
  border-color: var(--brand-accent);
}

.gdcjt-guide-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fare-calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px;
}

.fare-calc-box h4 {
  font-size: 14px;
  margin-bottom: 10px;
}

.fare-calc-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.calc-result-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-panel);
  font-size: 13px;
  line-height: 1.5;
}

.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.guide-card-title {
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 13.5px;
}

@media (max-width: 1024px) {
  body {
    height: auto;
    overflow: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .map-panel {
    height: 440px;
  }
}


/* ==================== 微信扫码登录与完赛/切线引导弹窗 ==================== */
.nav-btn-wechat {
  border-color: rgba(7, 193, 96, 0.45);
  background: rgba(7, 193, 96, 0.1);
  color: #059669;
  font-weight: 700;
}

[data-theme="dark"] .nav-btn-wechat {
  color: #34d399;
}

.login-modal-dialog {
  max-width: 660px;
}

.login-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-guide-banner {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(7, 193, 96, 0.12);
  border: 1px solid rgba(7, 193, 96, 0.35);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.login-split-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: center;
}

.qr-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.qr-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #07c160;
}

.qr-sub-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.login-form-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.login-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-wechat-login {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: #07c160;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.btn-wechat-login:hover {
  background: #06ad56;
}

.btn-logout {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(225, 29, 72, 0.4);
  background: transparent;
  color: #e11d48;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== 多维竞速排行榜弹窗 ==================== */
.leaderboard-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lb-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.lb-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.lb-city-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.city-rank-pill {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.city-rank-pill strong {
  color: var(--brand-intercity);
}

.lb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.lb-table th,
.lb-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.lb-table th {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 800;
}

.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 11px;
  background: var(--bg-card);
}

.lb-rank-1 { background: #fef08a; color: #854d0e; }
.lb-rank-2 { background: #e2e8f0; color: #334155; }
.lb-rank-3 { background: #fed7aa; color: #9a3412; }

.ticket-rank-comparison {
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(42, 90, 166, 0.1);
  border: 1px solid rgba(42, 90, 166, 0.3);
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 600;
}
