/* ============================================================
   中国高速模拟器 — 全站共享样式
   改这里的颜色，所有页面一起变（DRY 原则）
   ============================================================ */

:root {
  --color-primary: #38bdf8;   /* 青蓝 */
  --color-green:   #34d399;   /* 翠绿 */
  --color-amber:   #fbbf24;   /* 琥珀 */
  --color-danger:  #f87171;   /* 警示红 */

  --bg-0: #0b1020;
  --bg-1: #131a33;
  --bg-2: #1b2444;
  --bg-card: rgba(30, 41, 74, 0.72);
  --bg-card-hi: rgba(45, 60, 105, 0.85);

  --text-1: #eaf1ff;   /* 主文字 */
  --text-2: #c3cfe8;   /* 次文字 */
  --text-3: #93a3c4;   /* 弱文字（仍保证对比度） */

  --line: rgba(120, 150, 210, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-1);
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 92% 8%, rgba(52, 211, 153, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 48%, #0d1428 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(11, 16, 32, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.3px;
  text-decoration: none;
  background: linear-gradient(92deg, var(--color-primary), var(--color-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand .logo { font-size: 20px; -webkit-text-fill-color: initial; }

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.nav-links a:hover {
  color: var(--text-1);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}
.nav-links a.active {
  color: #06121f;
  background: linear-gradient(92deg, var(--color-primary), var(--color-green));
  font-weight: 700;
}

/* ---------- 布局 ---------- */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 70px;
}

.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 6px;
  background: linear-gradient(92deg, var(--color-primary), var(--color-green) 60%, var(--color-amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p { margin: 0; color: var(--text-3); font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.card:hover { border-color: rgba(56, 189, 248, 0.4); }

.card.link-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.card.link-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hi);
}
.card.link-card .icon { font-size: 30px; display: block; margin-bottom: 8px; }
.card.link-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-1); }
.card.link-card p { margin: 0; font-size: 13px; color: var(--text-3); }

.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--text-1); }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--text-1); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: var(--text-1);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
  background: linear-gradient(92deg, var(--color-primary), var(--color-green));
  color: #06121f;
  border-color: transparent;
}
.btn.green {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
}
.btn.amber {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.5);
}
.btn.danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.5);
}
.btn.small { padding: 6px 12px; font-size: 12.5px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-2); }
label.field span { display: block; margin-bottom: 5px; font-weight: 600; }

input[type="text"], input[type="number"], select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(9, 14, 28, 0.7);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* ---------- 首页：满屏地图 ---------- */
main.full-map {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 58px);
}
main.full-map .map-wrap {
  height: 100%;
  border-radius: 0;
  border: none;
}
main.full-map canvas.map-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- 地图画布 ---------- */
.map-wrap {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: radial-gradient(700px 500px at 50% 30%, rgba(56, 189, 248, 0.08), transparent 70%), rgba(8, 12, 24, 0.6);
  overflow: hidden;
}
canvas.map-canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }

.map-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  color: var(--text-3);
  background: rgba(11, 16, 32, 0.75);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  pointer-events: none;
}

/* 地图右下角的缩放按钮 */
.map-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}
.zoom-btn {
  width: 40px;
  height: 40px;
  font-size: 19px;
  line-height: 1;
  font-family: inherit;
  color: var(--text-1);
  background: rgba(19, 26, 51, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}
.zoom-btn:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.22);
}
.zoom-btn:active { transform: scale(0.94); }

/* ---------- 数据小卡 ---------- */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.stat .num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(92deg, var(--color-primary), var(--color-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .lbl { font-size: 12.5px; color: var(--text-3); }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(12, 18, 36, 0.55);
  margin-bottom: 8px;
  font-size: 13.5px;
  transition: background 0.16s ease;
}
.list li:hover { background: rgba(30, 41, 74, 0.7); }
.list li .grow { flex: 1; min-width: 0; }
.list li .name { color: var(--text-1); font-weight: 600; }
.list li .meta { color: var(--text-3); font-size: 12px; }

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.tag.blue  { color: #9adcff; border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.12); }
.tag.green { color: #9ff0cf; border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.12); }
.tag.amber { color: #ffdf9a; border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.12); }

.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  padding: 26px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: rgba(19, 26, 51, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: var(--text-1);
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 页脚 ---------- */
footer.site-foot {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 26px 20px 40px;
  border-top: 1px solid var(--line);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .nav-links { width: 100%; margin-left: 0; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  main { padding: 18px 14px 60px; }
  .card { padding: 15px; }
}
