/* ==========================================================================
   零跑智控 · 网页面板样式
   材质基准：leapauto/design/零跑智控-设计规范.md（智能座舱级真微晶毛玻璃）
   —— 中性灰为骨、状态色为信号，禁止蓝色强调、禁止脏黑阴影、禁止未确认即变绿。
   ========================================================================== */

/* ---------------------------------------------------------------- 令牌层 */
:root {
  /* 画布 */
  --canvas: #e8e8e8;
  --canvas-2: #f2f2f2;

  /* 微晶玻璃三段（浅色） */
  --glass-1: rgba(255, 255, 255, .88);
  --glass-2: rgba(248, 248, 248, .72);
  --glass-3: rgba(255, 255, 255, .82);

  /* 切边高光三段 */
  --rim-1: rgba(255, 255, 255, .92);
  --rim-2: rgba(255, 255, 255, .45);
  --rim-3: rgba(255, 255, 255, .18);

  /* 文本 */
  --on-surface: #202020;
  --on-surface-2: #404040;
  --on-surface-3: #6e6e6e;
  --surface: #ffffff;
  --surface-line: rgba(0, 0, 0, .07);

  /* 主操作（中性，非蓝） */
  --primary: #303030;
  --on-primary: #ffffff;

  /* 状态语义 */
  --good: #00c853;
  --good-aura: rgba(0, 200, 83, .14);
  --alert: #ff3b30;
  --alert-aura: rgba(255, 59, 48, .16);
  --alert-soft: #d93025;
  --warn: #ff9500;
  --warn-aura: rgba(255, 149, 0, .15);

  /* 圆角阶梯 */
  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 8px;
  --r-xs: 6px;

  /* 动效 */
  --spring: cubic-bezier(.2, .8, .25, 1);
  --fast: 140ms var(--spring);

  --metric-num: 34px;
  --gap: 14px;
}

html[data-theme='dark'],
html[data-theme='auto'] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] {
    --canvas: #111111;
    --canvas-2: #0a0a0a;
    --glass-1: rgba(41, 41, 41, .82);
    --glass-2: rgba(32, 32, 32, .70);
    --glass-3: rgba(24, 24, 24, .80);
    --rim-1: rgba(255, 255, 255, .32);
    --rim-2: rgba(255, 255, 255, .12);
    --rim-3: rgba(255, 255, 255, .05);
    --on-surface: #f0f0f0;
    --on-surface-2: #c9c9c9;
    --on-surface-3: #8f8f8f;
    --surface: #1c1c1c;
    --surface-line: rgba(255, 255, 255, .09);
    --primary: #e4e4e4;
    --on-primary: #202020;
    --alert-soft: #ff8a80;
  }
}

html[data-theme='dark'] {
  --canvas: #111111;
  --canvas-2: #0a0a0a;
  --glass-1: rgba(41, 41, 41, .82);
  --glass-2: rgba(32, 32, 32, .70);
  --glass-3: rgba(24, 24, 24, .80);
  --rim-1: rgba(255, 255, 255, .32);
  --rim-2: rgba(255, 255, 255, .12);
  --rim-3: rgba(255, 255, 255, .05);
  --on-surface: #f0f0f0;
  --on-surface-2: #c9c9c9;
  --on-surface-3: #8f8f8f;
  --surface: #1c1c1c;
  --surface-line: rgba(255, 255, 255, .09);
  --primary: #e4e4e4;
  --on-primary: #202020;
  --alert-soft: #ff8a80;
}

/* ---------------------------------------------------------------- 复位 */
* { box-sizing: border-box; }
/* 组件里一堆 display:flex/grid 会把浏览器默认的 [hidden] 顶掉，必须显式压回去 */
[hidden] { display: none !important; }

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

body {
  background: var(--canvas);
  color: var(--on-surface);
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, 'SF Pro SC', 'PingFang SC',
        'HarmonyOS Sans SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .02em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-line);
  border-radius: var(--r-xs);
  padding: 1px 5px;
}

/* ---------------------------------------------------------------- 底衬极光 */
.stage {
  position: relative;
  min-height: 100vh;
  padding: 18px clamp(14px, 3vw, 34px) 40px;
  isolation: isolate;
  overflow: hidden;
}

.aura {
  position: fixed;
  border-radius: 50%;
  filter: blur(78px);
  opacity: .55;
  z-index: -1;
  pointer-events: none;
  animation: drift 26s ease-in-out infinite alternate;
}
.aura-a { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: radial-gradient(circle, rgba(255,255,255,.85), rgba(255,255,255,0) 70%); }
.aura-b { width: 40vw; height: 40vw; right: -6vw; top: 8vw; background: radial-gradient(circle, rgba(190,190,190,.5), rgba(190,190,190,0) 70%); animation-delay: -8s; }
.aura-c { width: 52vw; height: 52vw; left: 22vw; bottom: -22vw; background: radial-gradient(circle, rgba(255,255,255,.6), rgba(255,255,255,0) 70%); animation-delay: -16s; }

html[data-theme='dark'] .aura-a,
html[data-theme='auto'] .aura-a { }

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] .aura { opacity: .22; filter: blur(96px); }
}
html[data-theme='dark'] .aura { opacity: .22; filter: blur(96px); }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5vw, -2vw, 0) scale(1.08); }
}

/* ---------------------------------------------------------------- 玻璃材质 */
.glass {
  position: relative;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--glass-1) 0%, var(--glass-2) 46%, var(--glass-3) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  overflow: hidden;
}

/* 3 阶渐变反光线（禁止纯色硬描边） */
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-1) 0%, var(--rim-2) 52%, var(--rim-3) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* 顶层 0.5px 水切折射线 */
.glass::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rim-1), transparent);
  opacity: .7;
  pointer-events: none;
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: var(--gap);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--glass-1), var(--glass-3));
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}
.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-1), var(--rim-3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inline-form { display: inline; margin: 0; }

/* 免登录模式的常驻标记：不点、不关，就为了让人一直记得门是开着的 */
.lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  background: var(--warn-aura);
  color: var(--warn);
  font-size: 10.5px;
  white-space: nowrap;
  cursor: help;
}

.car-badge { display: flex; flex-direction: column; line-height: 1.25; }
.car-name { font-size: 15px; font-weight: 700; }
.car-vin { font-size: 11px; color: var(--on-surface-3); letter-spacing: .08em; }

.freshness {
  font-size: 11.5px;
  color: var(--on-surface-3);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.freshness.is-old { color: var(--warn); }
.freshness.is-live { color: var(--good); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--on-surface-2);
  transition: transform var(--fast), background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--surface-line); color: var(--on-surface); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-busy { color: var(--warn); }

/* ---------------------------------------------------------------- 栅格 */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.col { display: flex; flex-direction: column; gap: var(--gap); }
/* 窄屏单列时也要保证「展台 → 空调 → 车控」在上，照片/位置/胎压在下 */
.col-main { order: 1; min-width: 0; }
.col-side { order: 2; min-width: 0; }

@media (max-width: 1023px) {
  .board { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- 展台卡 */
.hero-card {
  padding: 20px 20px 18px;
  border-radius: var(--r-lg);
}
.hero-aura {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 150%;
  background: radial-gradient(60% 60% at 22% 22%, var(--good-aura), transparent 70%);
  opacity: 0;
  transition: opacity 420ms var(--spring);
  pointer-events: none;
}
.hero-card.is-good .hero-aura { opacity: 1; animation: breathe 6.5s ease-in-out infinite; }
.hero-card.is-warn .hero-aura { background: radial-gradient(60% 60% at 22% 22%, var(--warn-aura), transparent 70%); opacity: 1; }
.hero-card.is-alert .hero-aura { background: radial-gradient(60% 60% at 22% 22%, var(--alert-aura), transparent 70%); opacity: 1; }

@keyframes breathe {
  0%, 100% { opacity: .78; }
  50% { opacity: 1; }
}

.hero-top { position: relative; display: flex; flex-direction: column; gap: 8px; }
.hero-metric { display: flex; align-items: baseline; gap: 3px; }
.metric-num {
  font-size: var(--metric-num);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.metric-unit { font-size: 12px; font-weight: 700; transform: translateY(-1.5px); color: var(--on-surface-2); }
.metric-soc { font-size: 13px; font-weight: 700; margin-left: 3px; color: var(--on-surface-2); font-variant-numeric: tabular-nums; }

/* 110 × 4.5 能量槽 */
.energy-slot {
  width: 110px;
  height: 4.5px;
  border-radius: 2px;
  background: var(--surface-line);
  overflow: hidden;
}
.energy-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 200, 83, .55), var(--good));
  transition: width 620ms var(--spring);
}
.energy-fill.is-warn { background: linear-gradient(90deg, rgba(255, 149, 0, .55), var(--warn)); }
.energy-fill.is-alert { background: linear-gradient(90deg, rgba(255, 59, 48, .5), var(--alert)); }
.energy-fill.is-charging { animation: chargeShimmer 2.2s linear infinite; }

@keyframes chargeShimmer {
  from { filter: brightness(.9); }
  50% { filter: brightness(1.25); }
  to { filter: brightness(.9); }
}

.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  border: 1px solid var(--surface-line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--on-surface-2);
  background: rgba(255, 255, 255, .28);
  white-space: nowrap;
}
html[data-theme='dark'] .chip,
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--on-surface-3); }
.chip.is-good { color: var(--good); border-color: var(--good-aura); }
.chip.is-good .dot { background: var(--good); }
.chip.is-alert { color: var(--alert-soft); border-color: var(--alert-aura); }
.chip.is-alert .dot { background: var(--alert); }
.chip.is-warn { color: var(--warn); border-color: var(--warn-aura); }
.chip.is-warn .dot { background: var(--warn); }
.chip.is-live .dot { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero-sub { margin-top: 10px; font-size: 12px; color: var(--on-surface-3); display: flex; flex-wrap: wrap; gap: 10px; }
.hero-sub b { color: var(--on-surface-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 通用卡 */
.panel-card { padding: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.card-head h2 { font-size: 13.5px; letter-spacing: .06em; }
.head-state, .head-note { font-size: 11.5px; color: var(--on-surface-3); }
.head-state.is-on { color: var(--good); }
.head-state.is-warn { color: var(--warn); }
.head-note.is-alert { color: var(--alert); font-weight: 600; }
.card-note { margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--on-surface-3); }

.text-btn {
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--on-surface-2);
  border-bottom: 1px solid var(--surface-line);
}
.text-btn:hover { color: var(--on-surface); }
.text-btn.is-busy { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: rgba(255, 255, 255, .34);
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 600;
  transition: transform var(--fast), background var(--fast), border-color var(--fast), opacity var(--fast);
}
html[data-theme='dark'] .btn { background: rgba(255, 255, 255, .06); }
.btn:hover { border-color: var(--rim-2); }
.btn:active { transform: scale(.955); }
.btn[disabled] { opacity: .42; cursor: not-allowed; }
.btn-lg { padding: 12px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger-ghost { color: var(--alert-soft); border-color: var(--alert-aura); }
.btn.is-working { color: var(--warn); border-color: var(--warn-aura); }
.btn.is-pending { color: var(--warn); border-color: var(--warn-aura); }
.btn.is-pending .cmd-ico { animation: spinPulse 1.2s ease-in-out infinite; }
/* 本地记忆：只代表「已下发」，绝不能画成生效绿 */
.btn.is-local { color: var(--warn); border-color: var(--warn); }
.btn.is-confirmed { color: var(--good); border-color: var(--good-aura); }

.ac-toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 温度分段 */
.temp-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.temp-pill {
  min-width: 42px;
  padding: 7px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--surface-line);
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface-2);
  transition: transform var(--fast), background var(--fast), color var(--fast);
}
.temp-pill:hover { transform: translateY(-1px); }
.temp-pill.is-current { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.temp-pill.is-local { border-color: var(--warn); color: var(--warn); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* 指令分组 */
.cmd-group { margin-bottom: 14px; }
.cmd-group:last-child { margin-bottom: 0; }
.cmd-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--on-surface-3);
  margin: 0 0 8px;
}
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.cmd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: rgba(255, 255, 255, .3);
  text-align: left;
  transition: transform var(--fast), border-color var(--fast), background var(--fast);
}
html[data-theme='dark'] .cmd { background: rgba(255, 255, 255, .05); }
.cmd:hover { border-color: var(--rim-2); }
.cmd:active { transform: scale(.955); }
.cmd .cmd-ico { display: inline-flex; width: 20px; height: 20px; color: var(--on-surface-2); }
.cmd .cmd-ico svg { width: 20px; height: 20px; }
.cmd .cmd-label { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.cmd .cmd-sub { font-size: 10.5px; color: var(--on-surface-3); }
.cmd.is-danger { border-color: var(--alert-aura); }
.cmd.is-danger .cmd-ico, .cmd.is-danger .cmd-label { color: var(--alert-soft); }
.cmd.is-pending { border-color: var(--warn-aura); color: var(--warn); }
.cmd.is-pending .cmd-ico { animation: spinPulse 1.2s ease-in-out infinite; }
.cmd.is-confirmed { border-color: var(--good-aura); }
.cmd.is-confirmed .cmd-ico, .cmd.is-confirmed .cmd-label { color: var(--good); }
.cmd.is-local { border-color: var(--warn-aura); }
.cmd.is-local .cmd-label::after { content: '·本地'; font-size: 9.5px; color: var(--warn); margin-left: 3px; }
.cmd[disabled] { opacity: .4; cursor: not-allowed; }

@keyframes spinPulse {
  0%, 100% { opacity: .45; transform: rotate(0deg); }
  50% { opacity: 1; transform: rotate(12deg); }
}

/* 分段子选项（座椅位置/档位） */
.cmd-detail {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
}
.cmd-detail[hidden] { display: none; }
.detail-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { width: 100%; font-size: 11px; color: var(--on-surface-3); letter-spacing: .1em; }
.opt {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-xs);
  border: 1px solid var(--surface-line);
  background: transparent;
}
.opt.is-current { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.opt.is-level-on { border-color: var(--good); color: var(--good); }
.opt.is-local { border-color: var(--warn); color: var(--warn); }
.opt.is-ghost { border-style: dashed; color: var(--on-surface-3); }
.opt.is-ghost:hover { color: var(--on-surface); border-color: var(--on-surface-3); }

/* ---------------------------------------------------------------- 驻车照片 */
/* 照片是 16:9 的灰底框，暗色下靠这条描边才分得清边界 */
.photo-card .photo-frame { border: 1px solid var(--surface-line); }
.photo-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, .04);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-theme='dark'] .photo-frame { background: rgba(255, 255, 255, .04); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  text-align: center;
  color: var(--on-surface-2);
  font-size: 13px;
  font-weight: 600;
}
.photo-placeholder small { font-size: 11px; font-weight: 400; color: var(--on-surface-3); }
.photo-time {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: .04em;
}

/* ---------------------------------------------------------------- 位置 */
.loc-body { display: flex; flex-direction: column; gap: 10px; }
.loc-coord { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--on-surface-2); }
.loc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-actions a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface);
  text-decoration: none;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .3);
}
html[data-theme='dark'] .loc-actions a { background: rgba(255, 255, 255, .05); }
.loc-actions a:active { transform: scale(.96); }

/* ---------------------------------------------------------------- 胎压 */
.tire-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tire {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
}
.tire .t-name { font-size: 11.5px; color: var(--on-surface-3); }
.tire .t-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tire.is-alert { border-color: var(--alert-aura); }
.tire.is-alert .t-val { color: var(--alert-soft); }

/* ---------------------------------------------------------------- 会话健康 */
.health-list { display: flex; flex-direction: column; gap: 7px; }
.h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.h-k { color: var(--on-surface-3); }
.h-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.h-v.is-good { color: var(--good); }
.h-v.is-warn { color: var(--warn); }
.h-v.is-alert { color: var(--alert-soft); }

.import-box { margin-top: 12px; border-top: 1px solid var(--surface-line); padding-top: 10px; }
.import-box summary { font-size: 12px; font-weight: 600; color: var(--on-surface-2); cursor: pointer; }
.import-box textarea {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: rgba(0, 0, 0, .03);
  color: var(--on-surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  resize: vertical;
}
html[data-theme='dark'] .import-box textarea { background: rgba(255, 255, 255, .04); }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.import-result { margin-top: 8px; font-size: 11.5px; color: var(--on-surface-3); word-break: break-all; }

/* ---------------------------------------------------------------- 提示条 */
.callout {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: rgba(0, 0, 0, .04);
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-surface-2);
}
html[data-theme='dark'] .callout { background: rgba(255, 255, 255, .05); }
.callout-amber { border-color: var(--warn-aura); color: var(--warn); }
.callout-red { border-color: var(--alert-aura); color: var(--alert-soft); }

/* ---------------------------------------------------------------- Toast */
.toast-rail {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
  width: min(520px, calc(100vw - 28px));
}
.toast {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: var(--surface);
  color: var(--on-surface);
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: rise 260ms var(--spring);
}
.toast .t-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--on-surface-3); }
.toast.is-good .t-bar { background: var(--good); }
.toast.is-warn .t-bar { background: var(--warn); }
.toast.is-alert .t-bar { background: var(--alert); }
.toast.is-pending .t-bar { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
.toast .t-body { flex: 1; }
.toast .t-title { font-weight: 700; }
.toast .t-desc { color: var(--on-surface-3); font-size: 11.5px; margin-top: 2px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- 密码抽屉 */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade 180ms ease-out;
}
.sheet-mask[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 规范要求：弹层必须高对比实底，禁止半透明穿透 */
.sheet {
  width: min(430px, 100vw);
  padding: 18px 20px 22px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  color: var(--on-surface);
  border-top: 1px solid var(--rim-2);
  animation: slideUp 280ms var(--spring);
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-size: 15px; }
.sheet-sub { margin-top: 4px; font-size: 11.5px; color: var(--on-surface-3); line-height: 1.5; }

.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0 14px; }
.pin-dots i {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--on-surface-3);
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}
.pin-dots i.on { background: var(--primary); border-color: var(--primary); transform: scale(1.12); }
.pin-dots.is-shake { animation: shake 320ms ease-in-out; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.key {
  height: 52px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: transparent;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform var(--fast), background var(--fast);
}
.key:hover { background: var(--surface-line); }
.key:active { transform: scale(.94); }
.key.key-fn { font-size: 13px; font-weight: 600; color: var(--on-surface-2); }

.remember-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--on-surface-3);
}
.sheet-foot { display: flex; gap: 8px; margin-top: 14px; }
.sheet-foot .btn { flex: 1; }
.sheet-error { margin-top: 8px; font-size: 11.5px; color: var(--alert-soft); min-height: 16px; }

/* ------------------------------------------------------------ 车辆切换列表 */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-sm);
  background: var(--glass-3);
  color: var(--on-surface-2);
  font-size: 11.5px;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.chip-btn:hover { color: var(--on-surface); border-color: var(--rim-2); transform: translateY(-1px); }

.fleet-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 46vh; overflow-y: auto; }
.fleet-empty { padding: 10px 2px; font-size: 12px; line-height: 1.6; color: var(--on-surface-3); }
.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 10px;
  width: 100%;
  padding: 11px 13px;
  text-align: left;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-md);
  background: var(--glass-2);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.fleet-row:hover:not([disabled]) { border-color: var(--rim-1); background: var(--glass-1); transform: translateY(-1px); }
.fleet-name { grid-column: 1; grid-row: 1; font-size: 13px; font-weight: 700; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-meta { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--on-surface-3); }
.fleet-tag {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--warn-aura);
  color: var(--warn);
  font-size: 10.5px;
  white-space: nowrap;
}
.fleet-row.is-active { border-color: var(--good-aura); background: var(--good-aura); cursor: default; }
.fleet-row.is-active .fleet-name { color: var(--good); }
.fleet-row.is-off { border-style: dashed; }
.fleet-row[disabled] { opacity: .82; }

/* ---------------------------------------------------------------- 登录页 */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 76vh; }
.login-card {
  width: min(390px, 100%);
  padding: 26px 24px 22px;
  border-radius: var(--r-xl);
  text-align: center;
}
.login-mark { color: var(--on-surface); display: flex; justify-content: center; margin-bottom: 6px; }
.login-title { font-size: 19px; letter-spacing: .12em; }
.login-sub { font-size: 11.5px; color: var(--on-surface-3); margin-top: 3px; }
.login-form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; letter-spacing: .12em; color: var(--on-surface-3); }
.field-input {
  padding: 12px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: rgba(0, 0, 0, .03);
  outline: none;
  transition: border-color var(--fast), background var(--fast);
}
html[data-theme='dark'] .field-input { background: rgba(255, 255, 255, .05); }
.field-input:focus { border-color: var(--rim-2); background: transparent; }
.login-foot { margin-top: 12px; font-size: 10.5px; color: var(--on-surface-3); }

/* ---------------------------------------------------------------- 页脚 */
.foot {
  margin-top: 18px;
  text-align: center;
  font-size: 10.5px;
  color: var(--on-surface-3);
  letter-spacing: .06em;
}

/* 骨架/空态 */
.skeleton { display: inline-block; height: 10px; border-radius: 3px; background: var(--surface-line); animation: pulse 1.5s ease-in-out infinite; }
.empty-note { font-size: 12px; color: var(--on-surface-3); }

@media (max-width: 420px) {
  :root { --metric-num: 26px; --gap: 11px; }
  .stage { padding-left: 12px; padding-right: 12px; }
  .cmd-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  /* 窄屏顶栏很挤：标记只留锁图标，鼠标/长按时 title 仍然讲清楚 */
  .lock-tag { padding: 0 6px; gap: 0; }
  .lock-tag > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
