/* 星軌信艙 — 前端原型樣式
   配色：鋼青＋深空黑藍＋灰白；唯一例外：詐騙警示用低飽和紅。
   字級硬指標：內文 18px/1.7、列表寄件人與主旨 18px、摘要 16px、按鈕 ≥16px、標籤 ≥14px、輔助字 ≥13px。 */

:root {
  --space: #060b15;
  --space-2: #0a1322;
  --hull: #111c2c;
  --hull-2: #17263a;
  --hull-3: #1e3149;
  --panel: #0d1726;
  --steel: #5e8fb3;
  --steel-hi: #9cc0da;
  --steel-mid: #3f6a8a;
  --steel-lo: #2a4560;
  --ink: #e4eaf0;
  --ink-2: #b2bfcb;
  --ink-3: #8797a7;
  --alert: #b87471;
  --alert-bg: rgba(184, 116, 113, 0.13);
  --alert-line: rgba(184, 116, 113, 0.55);
  --radius: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Heiti TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
svg.ic { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── 太空背景與駕駛艙剖面 ───────── */
.space {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, #12233a 0%, rgba(10, 19, 34, 0) 60%),
    linear-gradient(180deg, #08111f 0%, var(--space) 100%);
}
.space svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.cockpit {
  position: fixed; inset: 0; z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: calc(10px + var(--safe-l)) minmax(0, 1fr) calc(10px + var(--safe-r));
  height: 100%;
}

/* 艙頂：風擋框與艙壁 */
.canopy {
  grid-column: 1 / -1;
  position: relative;
  height: calc(64px + var(--safe-t));
  background: linear-gradient(180deg, #0c1624 0%, #0c1624 var(--safe-t), transparent var(--safe-t));
}
.canopy svg.frame { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64px; display: block; }
.canopy .hud {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  color: var(--steel-hi); pointer-events: none;
}
.canopy .hud svg { width: 26px; height: 26px; }
.canopy .hud .lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--steel); box-shadow: 0 0 8px var(--steel); opacity: .85; }
.canopy .hud .lamp.dim { background: var(--steel-lo); box-shadow: none; }

/* 側壁：艙壁肋條 */
.wall {
  position: relative;
  background:
    repeating-linear-gradient(180deg, transparent 0 46px, rgba(156, 192, 218, .14) 46px 48px),
    linear-gradient(90deg, #0b1522, #16253a 60%, #0f1b2b);
}
.wall.left { grid-column: 1; grid-row: 2; border-right: 1px solid #22384f; }
.wall.right { grid-column: 3; grid-row: 2; border-left: 1px solid #22384f;
  background:
    repeating-linear-gradient(180deg, transparent 0 46px, rgba(156, 192, 218, .14) 46px 48px),
    linear-gradient(270deg, #0b1522, #16253a 60%, #0f1b2b); }
.wall .gauges { display: none; }

/* 中央螢幕：嵌在艙內的顯示器 */
.mount {
  grid-column: 2; grid-row: 2;
  min-height: 0;
  padding: 6px 4px 6px;
  background: linear-gradient(180deg, #121f31, #0e1828);
}
.bezel {
  height: 100%;
  border-radius: 22px;
  padding: 5px;
  background: linear-gradient(160deg, #2b4560 0%, #16263b 40%, #1b2e45 100%);
  box-shadow: 0 0 0 1px #0a121e, 0 10px 30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(156, 192, 218, .25);
}
.screen {
  position: relative;
  height: 100%;
  border-radius: 17px;
  overflow: hidden;
  background:
    radial-gradient(130% 60% at 50% 0%, rgba(94, 143, 179, .10), transparent 70%),
    var(--panel);
  box-shadow: inset 0 0 0 1px rgba(156, 192, 218, .16), inset 0 0 40px rgba(0, 0, 0, .45);
  isolation: isolate;
}
.screen::after { /* 玻璃反光與掃描線 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 50;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .045) 0%, rgba(255, 255, 255, 0) 32%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px);
}

/* 艙底：主控台 */
.console {
  grid-column: 1 / -1; grid-row: 3;
  position: relative;
  padding: 10px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  background:
    linear-gradient(180deg, #2a4560 0, #1a2c42 2px, #13223a 3px, #0d1828 100%);
  box-shadow: 0 -1px 0 #0a121e, 0 -8px 20px rgba(0, 0, 0, .35);
}
.console::before { /* 主控台面板接縫 */
  content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 100%; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 24.6%, rgba(0,0,0,.25) 24.6% 25%, transparent 25% 74.6%, rgba(0,0,0,.25) 74.6% 75%, transparent 75%);
  opacity: .5;
}
.keys { position: relative; display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.key {
  flex: 1 1 0; min-width: 0; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid #2b4661; border-radius: 12px;
  background: linear-gradient(180deg, #1c2f46, #132238);
  box-shadow: inset 0 1px 0 rgba(156, 192, 218, .18), 0 2px 0 #070d17;
  color: var(--ink-2);
  font-size: 16px; line-height: 1.2;
  padding: 6px 2px;
  transition: transform .08s, background .15s, color .15s;
}
.key:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(156,192,218,.1), 0 1px 0 #070d17; }
.key.on { color: var(--steel-hi); border-color: var(--steel-mid); background: linear-gradient(180deg, #23405d, #172b44); }
.key.on svg.ic { filter: drop-shadow(0 0 6px rgba(156, 192, 218, .55)); }
.key .badge { position: absolute; }
.key-wrap { position: relative; flex: 1 1 0; display: flex; }
.key-wrap .key { flex: 1; }
.dot-count {
  position: absolute; top: -9px; right: -3px; pointer-events: none; box-shadow: 0 0 0 2px #0d1828;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--steel); color: #08111f; font-size: 16px; font-weight: 700; line-height: 24px; text-align: center;
}
.console .deco { position: relative; display: flex; justify-content: center; gap: 14px; padding: 18px 0 14px; }
.console .deco i { width: 34px; height: 8px; border-radius: 4px; background: #1b2d44; box-shadow: inset 0 1px 0 rgba(156,192,218,.15); }
.console .deco i.lit { background: var(--steel-mid); box-shadow: 0 0 10px rgba(94,143,179,.6); }

/* ───────── 螢幕內版面 ───────── */
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.topbar {
  flex: none; display: flex; align-items: center; gap: 6px;
  min-height: 56px; padding: 6px 8px 6px 6px;
  border-bottom: 1px solid rgba(94, 143, 179, .18);
}
.topbar .title { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.topbar .title svg.ic { color: var(--steel-hi); }
.topbar .title .sub { font-size: 14px; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--steel-hi); font-size: 16px;
}
.icon-btn:active { background: rgba(94, 143, 179, .15); }
.text-btn {
  flex: none; min-height: 44px; padding: 0 14px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--steel-mid); background: transparent; color: var(--steel-hi);
  font-size: 16px; font-weight: 600;
}
.text-btn.solid { background: var(--steel); border-color: var(--steel); color: #07101d; }
.text-btn:active { filter: brightness(1.15); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--steel-lo); border-radius: 3px; }

/* 信箱切換 */
.boxbar {
  flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px;
  scrollbar-width: none; border-bottom: 1px solid rgba(94, 143, 179, .12);
}
.boxbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--steel-lo); background: rgba(23, 38, 58, .7);
  color: var(--ink-2); font-size: 16px; white-space: nowrap;
}
.chip.on { background: var(--steel); border-color: var(--steel); color: #07101d; font-weight: 600; }
.chip .n { font-size: 16px; font-weight: 700; min-width: 24px; padding: 0 6px; height: 24px; line-height: 24px; border-radius: 12px; background: var(--steel-lo); color: var(--ink); text-align: center; }
.chip.on .n { background: #0b1626; color: var(--steel-hi); }

/* 列表分組標題 */
.sec-h {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 6px; margin: 0;
  font-size: 15px; font-weight: 600; letter-spacing: .06em; color: var(--steel-hi);
}
.sec-h svg.ic { width: 20px; height: 20px; }
.sec-h .n { font-size: 14px; color: var(--ink-3); font-weight: 500; }

/* 信件列 */
.list { list-style: none; margin: 0; padding: 0; }
.row-wrap { position: relative; overflow: hidden; border-bottom: 1px solid rgba(94, 143, 179, .12); }
.row-wrap.gone { transition: height .22s ease, opacity .22s; }
.row-under {
  position: absolute; inset: 0; display: flex; justify-content: flex-end;
  background: linear-gradient(90deg, #13233a, #20405f);
}
.swipe-btn {
  height: 100%; width: 0; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: var(--steel-mid); color: #eef4f9; font-size: 16px; font-weight: 600;
  white-space: nowrap;
}
.row-wrap.armed .row-under { background: var(--steel); }
.row-wrap.armed .swipe-btn { background: var(--steel); color: #07101d; justify-content: center; align-items: flex-start; padding-left: 26px; }
.row {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 14px 14px 26px;
  background: var(--panel);
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  cursor: pointer;
  will-change: transform;
}
.row.anim { transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.row:focus-visible { outline: 2px solid var(--steel-hi); outline-offset: -2px; }
.row.sel { background: #15263c; box-shadow: inset 3px 0 0 var(--steel); }
.row .udot { position: absolute; left: 10px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--steel-hi); box-shadow: 0 0 8px rgba(156, 192, 218, .8); }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--hull-3); color: var(--steel-hi);
  border: 1px solid var(--steel-lo);
  font-size: 18px; font-weight: 700;
}
.avatar.scam { color: var(--alert); border-color: var(--alert-line); background: var(--alert-bg); }
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.t-sender { flex: 1; min-width: 0; font-size: 18px; line-height: 1.35; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-time { flex: none; font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.t-subject { font-size: 18px; line-height: 1.4; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-preview { font-size: 16px; line-height: 1.5; color: var(--ink-3); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row.unread .t-sender, .row.unread .t-subject { color: var(--ink); font-weight: 700; }
.row.unread .t-preview { color: var(--ink-2); }
.t-aux { font-size: 13px; color: var(--ink-3); }
.row-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; line-height: 1; padding: 5px 9px; border-radius: 8px;
  border: 1px solid var(--steel-lo); color: var(--steel-hi); background: rgba(42, 69, 96, .35);
  white-space: nowrap;
}
.tag svg.ic { width: 16px; height: 16px; }
.tag.alert { color: #e2b4b2; border-color: var(--alert-line); background: var(--alert-bg); }
mark { background: rgba(94, 143, 179, .45); color: var(--ink); border-radius: 3px; padding: 0 1px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px; color: var(--ink-3); font-size: 16px; text-align: center; }
.empty svg.ic { width: 48px; height: 48px; stroke-width: 1.2; color: var(--steel-mid); }

/* ───────── 信件頁 ───────── */
.mail { padding: 18px 18px 28px; }
.mail h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.45; font-weight: 700; }
.mail-from { display: flex; gap: 12px; align-items: center; }
.mail-from .who { flex: 1; min-width: 0; }
.mail-from .name { font-size: 18px; font-weight: 600; }
.mail-from .addr { font-size: 14px; color: var(--ink-3); word-break: break-all; }
.mail-to { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scam-banner {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--alert-line); background: var(--alert-bg);
  color: #ecc9c7; font-size: 16px; line-height: 1.55;
}
.scam-banner svg.ic { color: var(--alert); margin-top: 1px; }
.ai-card {
  margin-top: 16px; padding: 14px 16px 16px; border-radius: var(--radius);
  border: 1px solid var(--steel-lo);
  background: linear-gradient(180deg, rgba(42, 69, 96, .35), rgba(23, 38, 58, .5));
}
.ai-card.scam { border-color: var(--alert-line); }
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--steel-hi); }
.ai-head .lbl { font-size: 14px; font-weight: 700; letter-spacing: .08em; margin-right: auto; display: inline-flex; align-items: center; gap: 6px; }
.ai-sum { margin: 10px 0 0; font-size: 18px; line-height: 1.6; font-weight: 600; color: var(--ink); }
.ai-sub { margin: 14px 0 6px; font-size: 14px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.pts { margin: 0; padding: 0; list-style: none; }
.pts li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.6; color: var(--ink-2); margin: 4px 0; }
.pts li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--steel); }
.todos { margin: 0; padding: 0; list-style: none; }
.todo {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 8px 0; border: 0; background: none; font-size: 16px; line-height: 1.5; color: var(--ink);
}
.todo .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--steel); display: flex; align-items: center; justify-content: center; color: #07101d; margin-top: 0; }
.todo .box svg.ic { width: 18px; height: 18px; stroke-width: 2.4; opacity: 0; }
.todo.done { color: var(--ink-3); text-decoration: line-through; }
.todo.done .box { background: var(--steel); }
.todo.done .box svg.ic { opacity: 1; }
.mail-body { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(94, 143, 179, .18); font-size: 18px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.actbar { flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(94, 143, 179, .18); background: rgba(13, 23, 38, .95); }
.actbar .key { min-height: 56px; }

/* ───────── 判讀頁 ───────── */
.grp-h {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 16px 16px 8px; border: 0; background: none; text-align: left;
  font-size: 17px; font-weight: 700; color: var(--steel-hi); letter-spacing: .04em;
}
.grp-h .n { font-size: 16px; font-weight: 600; color: var(--ink-3); }
.grp-h .chev { margin-left: auto; transition: transform .2s; color: var(--ink-3); }
.grp-h.closed .chev { transform: rotate(-90deg); }
.cards { padding: 0 12px 4px; display: flex; flex-direction: column; gap: 12px; }
.dcard {
  border-radius: var(--radius); border: 1px solid var(--steel-mid);
  background: linear-gradient(180deg, #172a41, #12223a);
  box-shadow: inset 0 1px 0 rgba(156, 192, 218, .12);
  padding: 14px 16px 12px;
}
.dcard-top { display: flex; align-items: center; gap: 10px; }
.dcard-top .avatar { width: 38px; height: 38px; font-size: 16px; }
.dcard-top svg.ic { width: 20px; height: 20px; }
.dcard-top .t-sender { font-size: 18px; color: var(--ink); font-weight: 600; }
.dcard .ai-sum { margin-top: 10px; }
.dcard-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.mini { list-style: none; margin: 0; padding: 0; }

/* 搜尋 */
.searchbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(94, 143, 179, .18); }
.field-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--steel-mid); background: #0a1422; color: var(--steel-hi);
}
.field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; }
.field-search input::placeholder { color: var(--ink-3); }
.search-hint { padding: 16px; }
.search-hint .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.result-n { padding: 12px 16px 4px; }

/* 寫信 */
.compose-form { display: flex; flex-direction: column; min-height: 100%; }
.cf-row { display: flex; align-items: center; gap: 10px; padding: 4px 16px; min-height: 56px; border-bottom: 1px solid rgba(94, 143, 179, .15); }
.cf-row label { flex: none; width: 56px; font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
.cf-row input, .cf-row select {
  flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; font-size: 18px; color: var(--ink);
}
.cf-row select { -webkit-appearance: none; appearance: none; color: var(--steel-hi); }
.cf-row select option { background: var(--hull); color: var(--ink); }
.cf-body { flex: 1; width: 100%; min-height: 280px; padding: 14px 16px; border: 0; outline: 0; resize: none; background: transparent; font-size: 18px; line-height: 1.7; color: var(--ink); }
.cf-row input::placeholder, .cf-body::placeholder { color: var(--ink-3); }
.proto-note { display: flex; gap: 8px; align-items: center; padding: 10px 16px; font-size: 13px; color: var(--ink-3); border-bottom: 1px solid rgba(94, 143, 179, .15); }
.proto-note svg.ic { width: 18px; height: 18px; color: var(--steel); }

/* 登入 */
.login { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 24px; }
.login .emblem { width: 92px; height: 92px; color: var(--steel-hi); filter: drop-shadow(0 0 14px rgba(94, 143, 179, .45)); }
.login h1 { margin: 12px 0 4px; font-size: 28px; letter-spacing: .12em; }
.login .tagline { font-size: 14px; color: var(--ink-3); letter-spacing: .1em; margin-bottom: 26px; }
.login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.lf { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--steel-mid); background: #0a1422; color: var(--steel-hi); }
.lf input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 18px; color: var(--ink); }
.lf input::placeholder { color: var(--ink-3); }
.lf:focus-within, .field-search:focus-within { border-color: var(--steel-hi); box-shadow: 0 0 0 3px rgba(94, 143, 179, .25); }
.remember { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.remember input { font-size: 16px; width: 22px; height: 22px; accent-color: var(--steel); margin: 0; }
.login .go { height: 54px; justify-content: center; font-size: 18px; margin-top: 4px; }
.login .note { margin-top: 18px; font-size: 13px; color: var(--ink-3); text-align: center; }
.login .err { font-size: 14px; color: var(--steel-hi); min-height: 20px; text-align: center; }

/* 底部面板與提示 */
.sheet-bg { position: absolute; inset: 0; z-index: 30; background: rgba(3, 8, 15, .62); display: flex; align-items: flex-end; animation: fade .15s; }
.sheet {
  width: 100%; max-height: 85%; overflow-y: auto; padding: 8px 12px 14px;
  border-radius: 18px 18px 0 0; border-top: 1px solid var(--steel-mid);
  background: linear-gradient(180deg, #1a2d45, #111e31);
  animation: rise .2s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--steel-lo); margin: 4px auto 10px; }
.sheet h3 { margin: 4px 6px 10px; font-size: 15px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent; text-align: left; font-size: 17px; color: var(--ink);
}
.opt:active, .opt.on { background: rgba(94, 143, 179, .18); }
.opt svg.ic { color: var(--steel-hi); }
.opt .r { margin-left: auto; font-size: 16px; color: var(--ink-3); }
.sheet hr { border: 0; border-top: 1px solid rgba(94, 143, 179, .2); margin: 8px 4px; }
.toast {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; min-height: 56px;
  border-radius: 14px; border: 1px solid var(--steel-mid); background: #1b3049;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 16px; line-height: 1.4; animation: rise .2s;
}
.toast .msg { flex: 1; }
.toast svg.ic { color: var(--steel-hi); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 寬螢幕：雙欄與側壁儀表 */
.split { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(340px, 420px) 1fr; }
.split > .pane { position: relative; min-width: 0; }
.split > .pane + .pane { border-left: 1px solid rgba(94, 143, 179, .2); }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-3); font-size: 16px; }
.placeholder svg { width: 120px; height: 120px; color: var(--steel-lo); }

@media (min-width: 960px) {
  .cockpit { grid-template-columns: minmax(24px, 1fr) minmax(0, 1240px) minmax(24px, 1fr); }
  .canopy { height: calc(110px + var(--safe-t)); }
  .canopy svg.frame { height: 110px; }
  .canopy .hud { bottom: 16px; }
  .mount { padding: 14px 10px 12px; }
  .bezel { border-radius: 26px; padding: 7px; }
  .screen { border-radius: 20px; }
  .console { padding-top: 14px; padding-bottom: calc(14px + var(--safe-b)); }
  .keys { max-width: 560px; }
}
@media (min-width: 1280px) {
  .wall .gauges { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-top: 40px; position: absolute; inset: 0; overflow: hidden; }
  .wall .gauges svg { width: min(120px, 80%); height: auto; color: var(--steel-mid); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 補充 */
.t-label { font-size: 14px; color: var(--ink-3); }
.field-search .clear-q { display: none; width: 40px; height: 40px; margin-right: -6px; color: var(--ink-3); }
.field-search.has .clear-q { display: inline-flex; }
.field-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
