/* ==========================================================================
   列车进站 · three.js 三维动画 — 界面样式
   ========================================================================== */

:root {
  --bg:        #060b14;
  --ink:       #e8eef7;
  --ink-soft:  #a9b8cc;
  --muted:     #6f8199;
  --line:      rgba(140, 170, 210, .18);
  --glass:     rgba(10, 18, 30, .56);
  --glass-2:   rgba(14, 24, 38, .78);
  --cyan:      #56d6ff;
  --amber:     #ffc46b;
  --green:     #63e6a8;
  --red:       #ff6b6b;
  --r:         14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, #0d1726 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }

/* ------------------------------------------------------------------- HUD */
.hud {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  animation: hudIn .8s cubic-bezier(.2,.7,.3,1) .15s both;
}
.hud > * { pointer-events: auto; }

.hud-tl { top: 20px; left: 20px; }
.hud-tr { top: 20px; right: 20px; }
.hud-b  { bottom: 20px; left: 50%; transform: translateX(-50%); width: min(100% - 40px, 940px); }

@keyframes hudIn { from { opacity: 0; transform: translateY(10px); } }
.hud-b { animation-name: hudInB; }
@keyframes hudInB {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.panel {
  background: var(--glass);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ----------------------------------------------------------------- clock */
.clock-card { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; }
.dial { width: 54px; height: 54px; flex: none; overflow: visible; }
.dial-face { fill: rgba(8,15,25,.7); stroke: var(--line); stroke-width: 2; }
.dial-ticks line { stroke: rgba(160,190,220,.5); stroke-width: 2; }
.dial-ticks line.major { stroke: var(--cyan); stroke-width: 3; }
.hand-h { stroke: #dbe7f5; stroke-width: 3.4; stroke-linecap: round; }
.hand-m { stroke: #dbe7f5; stroke-width: 2.4; stroke-linecap: round; }
.hand-s { stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; }
.dial-pin { fill: var(--amber); }
.clock-text { display: flex; flex-direction: column; line-height: 1.35; }
.clock-text b { font-family: var(--mono); font-size: 19px; letter-spacing: .06em; font-weight: 600; }
.clock-text span { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }
.clock-text em { font-style: normal; font-size: 11.5px; color: var(--cyan); letter-spacing: .08em; }

/* ----------------------------------------------------------------- panel */
.hud-tr .panel { width: 232px; padding: 15px 16px 13px; }
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: .05em;
  padding-bottom: 11px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex: none;
  box-shadow: 0 0 0 0 currentColor;
}
.dot.run  { background: var(--green); animation: pulse 1.4s infinite; }
.dot.stop { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dot.door { background: var(--cyan); animation: pulse 1.4s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(99,230,168,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(99,230,168,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,230,168,0); }
}

.gauge { margin-bottom: 12px; }
.gauge-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.gauge-row > span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.gauge-row b { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--ink); }
.gauge-row b i { font-style: normal; font-size: 10.5px; color: var(--muted); margin-left: 3px; letter-spacing: .05em; }
.bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0;
  border-radius: 4px; background: linear-gradient(90deg, var(--cyan), #7af0d0);
  box-shadow: 0 0 12px rgba(86,214,255,.55);
  transition: width .12s linear;
}
.bar.dist > i { background: linear-gradient(90deg, var(--amber), #ff9d5c); box-shadow: 0 0 12px rgba(255,196,107,.5); }

.meta { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid var(--line); }
.meta > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.meta dt { font-size: 12px; color: var(--muted); }
.meta dd { margin: 0; font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono); }
#doorVal { color: var(--cyan); }

/* ------------------------------------------------------------- bottom bar */
.bar-panel { padding: 13px 16px 15px; }
.progress-track {
  height: 3px; border-radius: 3px; background: rgba(255,255,255,.09);
  margin-bottom: 13px; overflow: hidden;
}
.progress-track > i {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 20px;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--ink);
  font-family: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer;
  transition: transform .18s, background .2s, border-color .2s, box-shadow .25s, color .2s;
}
.btn:hover { background: rgba(255,255,255,.11); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #2a7fb8, #1b4f7a);
  box-shadow: 0 10px 26px -12px rgba(86,214,255,.75), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn.primary:hover { background: linear-gradient(135deg, #3390cd, #205d90); }
.btn.primary.lg { height: 46px; padding: 0 34px; font-size: 15px; border-radius: 12px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,.08); }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.seg-btn {
  height: 32px; padding: 0 13px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; transition: background .2s, color .2s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  color: #04121c;
  background: linear-gradient(135deg, var(--cyan), #8ee7ff);
  box-shadow: 0 6px 16px -8px rgba(86,214,255,.9);
}
.hint {
  margin: 10px 0 0; text-align: center;
  font-size: 11.5px; color: var(--muted); letter-spacing: .06em;
}

/* ----------------------------------------------------------------- intro */
.intro {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(120% 100% at 50% 40%, rgba(8,16,28,.72), rgba(4,8,14,.94));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .7s ease, visibility .7s;
}
.intro.hide { opacity: 0; visibility: hidden; }
.intro-inner { max-width: 560px; text-align: center; animation: introUp .9s cubic-bezier(.2,.7,.3,1) both; }
@keyframes introUp { from { opacity: 0; transform: translateY(18px); } }
.eyebrow {
  margin: 0 0 16px; font-size: 11.5px; letter-spacing: .34em;
  color: var(--cyan); text-transform: uppercase;
}
.intro h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 9vw, 82px);
  font-weight: 700; letter-spacing: .16em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 30%, #8fb6d8);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 20px 60px rgba(86,214,255,.25);
}
.sub { margin: 0 auto 26px; max-width: 30em; color: var(--ink-soft); line-height: 1.9; font-size: 14.5px; }
.feats {
  list-style: none; margin: 0 0 32px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.feats li {
  font-size: 12.5px; color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
}
.tips { margin: 20px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }

/* ------------------------------------------------------------------ fade */
.fade {
  position: fixed; inset: 0; z-index: 60;
  background: #04070d; opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hud-tr { top: auto; bottom: 132px; right: 14px; }
  .hud-tr .panel { width: 200px; padding: 12px; }
  .hud-tl { top: 14px; left: 14px; }
  .clock-card { padding: 9px 14px 9px 9px; }
  .dial { width: 44px; height: 44px; }
  .clock-text b { font-size: 16px; }
  .hud-b { bottom: 14px; }
  .controls { gap: 7px; }
  .btn { height: 34px; padding: 0 14px; font-size: 12.5px; }
  .seg-btn { height: 28px; padding: 0 10px; }
  .hint { display: none; }
}
@media (max-width: 560px) {
  .hud-tr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
