/* ══════════════════════════════════════════════════════════════
   AR 景点增强系统 · 全局样式
   设计原则：全屏沉浸 + 户外可读（高对比 + 深色压底 + 文字描边）
   ══════════════════════════════════════════════════════════════ */

:root {
  --accent: #5ee7ff;
  --accent-2: #a78bfa;
  --warn: #ffb454;
  --danger: #ff5d5d;
  --ok: #4ade80;

  --bg: #050c12;
  --panel: rgba(7, 17, 24, 0.72);
  --panel-solid: #0a1620;
  --line: rgba(94, 231, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.10);

  --text: #eaf6ff;
  --text-dim: #9fb6c6;
  --text-mute: #6d8394;

  --hud-accent: var(--accent);
  --hud-warn: var(--warn);
  --hud-danger: var(--danger);
  --hud-bg: rgba(6, 14, 20, 0.62);
  --hud-text: var(--text);

  --r: 14px;
  --r-lg: 20px;
  --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);

  --dock-h: 108px;
  --tabs-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body { position: fixed; inset: 0; }
img, canvas, video { display: block; }
button { font-family: inherit; color: inherit; }

/* ─────────── 舞台 ─────────── */

#stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

#cam {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  transition: opacity .25s;
}
#cam.off { opacity: 0; pointer-events: none; }

#photo-layer, #ar-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;              /* 保持照片原始比例，不做裁切 */
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  background: #000;
}
#photo-layer.on, #ar-layer.on { opacity: 1; }
#ar-layer { background: transparent; }

#ar-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
#ar-canvas.on { opacity: 1; }
#ar-canvas.interactive { pointer-events: auto; }

#cam-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; text-align: center;
  background: radial-gradient(circle at 50% 35%, #10222f, #050c12 70%);
  z-index: 4;
}
#cam-fallback h3 { margin: 0; font-size: 17px; }
#cam-fallback p { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.7; max-width: 30em; }

/* ─────────── 取景框 ─────────── */

#reticle { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#reticle .c {
  position: absolute; width: 30px; height: 30px;
  border: 2.5px solid rgba(255,255,255,.85);
  filter: drop-shadow(0 0 5px rgba(0,0,0,.65));
}
#reticle .tl { top: 16%; left: 9%;  border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
#reticle .tr { top: 16%; right: 9%; border-left: 0;  border-bottom: 0; border-radius: 0 6px 0 0; }
#reticle .bl { bottom: 30%; left: 9%;  border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
#reticle .br { bottom: 30%; right: 9%; border-left: 0;  border-top: 0; border-radius: 0 0 6px 0; }
.reticle-hint {
  position: absolute; left: 50%; bottom: 33%;
  transform: translateX(-50%);
  font-size: 12.5px; color: rgba(255,255,255,.88); white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.9);
}

/* ─────────── 处理中动效 ─────────── */

#processing {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(3, 9, 14, 0.78);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
#processing[hidden] { display: none; }

.scan-grid {
  position: absolute; inset: 0; opacity: .18;
  background-image:
    linear-gradient(rgba(94,231,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,231,255,.5) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 78%);
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 130px;
  background: linear-gradient(to bottom, transparent, rgba(94,231,255,.22), transparent);
  animation: scanSweep 2.6s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes scanSweep {
  0%   { top: -18%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.proc-card {
  position: relative; width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 20px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}
.proc-title { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 600; }
.proc-bar { height: 5px; margin: 13px 0 9px; border-radius: 4px; background: rgba(255,255,255,.10); overflow: hidden; }
.proc-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px; transition: width .45s cubic-bezier(.3,.8,.3,1);
  box-shadow: 0 0 12px rgba(94,231,255,.65);
}
.proc-detail { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; min-height: 2.6em; }
.proc-steps {
  list-style: none; margin: 12px 0 10px; padding: 0;
  font-size: 12px; color: var(--text-mute); max-height: 30vh; overflow-y: auto;
}
.proc-steps li { padding: 4px 0 4px 20px; position: relative; line-height: 1.5; }
.proc-steps li::before {
  content: '·'; position: absolute; left: 6px; top: 3px; color: var(--accent); font-weight: 700;
}
.proc-steps li.new::before { content: '▸'; }

.dot-lived {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); animation: pulse 1.5s infinite; flex: none;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.72); } }

/* ─────────── 按钮 ─────────── */

.btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--panel); color: var(--text);
  padding: 10px 15px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: transform .12s, background .18s, border-color .18s, opacity .18s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
.btn:active { transform: scale(.955); }
.btn.primary {
  background: linear-gradient(135deg, rgba(94,231,255,.30), rgba(167,139,250,.30));
  border-color: rgba(94,231,255,.55);
  box-shadow: 0 6px 22px rgba(94,231,255,.20);
}
.btn.ghost { background: rgba(10,22,32,.55); }
.btn.sm { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.xs { padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }
.btn[disabled] { opacity: .42; pointer-events: none; }
.btn.round {
  width: 50px; height: 50px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
}
.btn.round > input { display: none; }

.shutter {
  width: 72px; height: 72px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.92);
  background: radial-gradient(circle at 50% 42%, #fff, #d6e6ef 62%, #9fb6c6);
  box-shadow: 0 0 0 5px rgba(0,0,0,.28), 0 8px 26px rgba(0,0,0,.55);
  cursor: pointer; transition: transform .1s;
  flex: none;
}
.shutter:active { transform: scale(.9); }
.shutter[disabled] { opacity: .5; }

.chip {
  appearance: none; border: 1px solid var(--line-soft);
  background: rgba(10,22,32,.6);
  color: var(--text-dim);
  padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .18s;
}
.chip.on {
  color: #04121a; font-weight: 650;
  background: linear-gradient(135deg, var(--accent), #9fe9ff);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(94,231,255,.35);
}

/* ─────────── 底部控制 ─────────── */

#dock {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--tabs-h) + var(--safe-b));
  z-index: 12;
  padding: 0 14px calc(10px + var(--safe-l) * 0);
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.dock-row { display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.dock-group {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  pointer-events: auto;
}
.dock-group.layers {
  justify-content: flex-start; gap: 7px;
  overflow-x: auto; padding: 4px 2px;
  scrollbar-width: none;
}
.dock-group.layers::-webkit-scrollbar { display: none; }

#tabs {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 14;
  height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: linear-gradient(to top, rgba(4,10,15,.96), rgba(4,10,15,.72) 70%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
#tabs button {
  flex: 1; appearance: none; background: none; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-mute); font-size: 10.5px; cursor: pointer;
  transition: color .18s; position: relative;
}
#tabs button i { font-size: 19px; font-style: normal; line-height: 1; }
#tabs button.on { color: var(--accent); }
#tabs button.on::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}

/* ─────────── 数字人 ─────────── */

#guide {
  position: absolute; z-index: 16;
  left: calc(12px + var(--safe-l));
  bottom: calc(var(--tabs-h) + var(--safe-b) + 100px);
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start;
  max-width: min(74vw, 330px);
}
#guide-avatar {
  position: relative;
  width: 92px; height: 92px; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--line);
  background: radial-gradient(circle at 50% 32%, rgba(30,64,88,.92), rgba(5,12,18,.96) 72%);
  overflow: hidden; cursor: pointer;
  box-shadow: 0 10px 32px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .24s cubic-bezier(.3,1.4,.4,1), box-shadow .24s, width .24s, height .24s;
  flex: none;
}
#guide-avatar:active { transform: scale(.94); }
#dh-canvas { width: 100%; height: 100%; display: block; }
.guide-ring {
  position: absolute; inset: -1px; border-radius: 50%; pointer-events: none;
  border: 2px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.guide-state {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  font-size: 9.5px; padding: 1.5px 7px; border-radius: 999px;
  background: rgba(3,10,16,.82); border: 1px solid var(--line-soft);
  color: var(--text-dim); white-space: nowrap;
}
#guide[data-state="speaking"] .guide-ring {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(94,231,255,.65), inset 0 0 18px rgba(94,231,255,.28);
  animation: ringPulse 1.6s ease-in-out infinite;
}
#guide[data-state="listening"] .guide-ring {
  border-color: var(--danger);
  box-shadow: 0 0 22px rgba(255,93,93,.6);
}
#guide[data-state="thinking"] .guide-ring {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(167,139,250,.6);
  animation: ringPulse 2.4s ease-in-out infinite;
}
@keyframes ringPulse {
  0%,100% { opacity: 1; }
  50% { opacity: .42; }
}

#bubble {
  order: -1;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 11px 13px 9px;
  font-size: 13.5px; line-height: 1.68;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  max-height: 34vh; overflow-y: auto;
  animation: bubbleIn .26s cubic-bezier(.3,1.2,.4,1);
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-text .cursor { display: inline-block; width: 7px; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bubble-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 7px; }

/* ─────────── 抽屉面板 ─────────── */

#sheet, #chat-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 22;
  max-height: min(78vh, 660px);
  display: flex; flex-direction: column;
  background: linear-gradient(to top, rgba(6,14,20,.985), rgba(8,18,26,.96));
  border-top: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -18px 60px rgba(0,0,0,.7);
  padding-bottom: var(--safe-b);
  animation: sheetUp .3s cubic-bezier(.25,.9,.3,1);
}
#sheet[hidden], #chat-panel[hidden] { display: none; }
/* 导航面板留出上半屏给 HUD 罗盘与雷达 */
#sheet.compact { max-height: min(56vh, 460px); }
/* 从启动页打开手册时盖在启动遮罩之上，关掉后「开始」按钮仍在原处可点 */
#sheet.over-boot, #chat-panel.over-boot { z-index: 70; }
@keyframes sheetUp { from { transform: translateY(100%); } }

#sheet::before, #chat-panel::before {
  content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.22);
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 17px 16px 10px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.sheet-head h2 { margin: 0; font-size: 15.5px; font-weight: 620; letter-spacing: .2px; }
.head-actions { display: flex; gap: 7px; }
.sheet-body { padding: 14px 16px calc(20px + var(--safe-b)); overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* 详情内容排版 */
.sec { margin-bottom: 20px; }
.sec:last-child { margin-bottom: 4px; }
.sec-title {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 9px; font-weight: 600;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-dim); white-space: nowrap; }
.kv dd { margin: 0; word-break: break-word; }
.card {
  background: rgba(255,255,255,.045); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 12px 13px; margin-bottom: 9px;
}
.card h4 { margin: 0 0 5px; font-size: 13.8px; font-weight: 620; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card p { margin: 0; font-size: 12.8px; line-height: 1.7; color: var(--text-dim); }
.card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 10.5px; padding: 2.5px 8px; border-radius: 999px;
  background: rgba(94,231,255,.13); color: var(--accent); border: 1px solid rgba(94,231,255,.24);
}
.tag.warn { background: rgba(255,180,84,.14); color: var(--warn); border-color: rgba(255,180,84,.3); }
.tag.dim { background: rgba(255,255,255,.06); color: var(--text-mute); border-color: var(--line-soft); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.28); }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs img {
  width: 104px; height: 72px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line-soft); flex: none; cursor: pointer;
}
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 52px; align-items: center; gap: 9px; font-size: 12px; }
.bar-track { height: 7px; border-radius: 4px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-val { text-align: right; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.warnbox {
  border: 1px solid rgba(255,180,84,.34); background: rgba(255,180,84,.09);
  border-radius: var(--r); padding: 11px 12px; font-size: 12.6px; line-height: 1.7; color: #ffe0b4;
}
.warnbox.info { border-color: rgba(94,231,255,.3); background: rgba(94,231,255,.08); color: #cdf2ff; }
.empty { text-align: center; color: var(--text-mute); font-size: 13px; padding: 34px 10px; line-height: 1.8; }

/* AR 方案控制 */
.plan-modes { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.plan-input {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,.07); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
  font-size: 13.5px; font-family: inherit; outline: none;
}
.plan-input:focus { border-color: rgba(94,231,255,.5); }
.plan-input::placeholder { color: var(--text-mute); }

/* POI 列表 */
.poi-list { display: flex; flex-direction: column; gap: 8px; }
.poi {
  display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center;
  background: rgba(255,255,255,.045); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 11px 12px; cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.poi:active { transform: scale(.985); }
.poi.on { border-color: rgba(94,231,255,.55); background: rgba(94,231,255,.1); }
.poi-arrow {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(94,231,255,.14); border: 1px solid rgba(94,231,255,.28);
  font-size: 15px; color: var(--accent);
  transition: transform .3s cubic-bezier(.3,1.2,.4,1);
}
.poi-main { min-width: 0; }
.poi-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-meta { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.poi-dist { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.poi-dist small { display: block; font-size: 10.5px; color: var(--text-mute); font-weight: 400; margin-top: 2px; }

/* ─────────── 对话面板 ─────────── */

#chat-log {
  flex: 1; overflow-y: auto; padding: 13px 15px;
  display: flex; flex-direction: column; gap: 11px;
  -webkit-overflow-scrolling: touch;
}
.msg { max-width: 86%; font-size: 13.6px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(94,231,255,.24), rgba(167,139,250,.22)); border: 1px solid rgba(94,231,255,.32); border-radius: 15px 15px 4px 15px; padding: 9px 13px; }
.msg.bot { align-self: flex-start; background: rgba(255,255,255,.055); border: 1px solid var(--line-soft); border-radius: 15px 15px 15px 4px; padding: 9px 13px; }
.msg.sys { align-self: center; color: var(--text-mute); font-size: 11.5px; max-width: 100%; text-align: center; }
.msg.err { align-self: stretch; border-color: rgba(255,93,93,.4); background: rgba(255,93,93,.1); color: #ffd4d4; max-width: 100%; }
.msg.bot .speak { margin-top: 6px; }

#chat-quick { display: flex; gap: 7px; overflow-x: auto; padding: 0 15px 9px; scrollbar-width: none; flex: none; }
#chat-quick::-webkit-scrollbar { display: none; }
#chat-quick:empty { display: none; }

#chat-form {
  display: flex; gap: 8px; align-items: center; flex: none;
  padding: 10px 13px calc(13px + var(--safe-b));
  border-top: 1px solid var(--line-soft);
  background: rgba(4,10,15,.6);
}
#chat-input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,.07); border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 11px 13px; color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .18s;
}
#chat-input:focus { border-color: rgba(94,231,255,.5); }
.mic {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: rgba(255,255,255,.07);
  font-size: 17px; cursor: pointer; color: var(--text-dim);
  transition: all .2s;
}
.mic.rec { background: rgba(255,93,93,.24); border-color: var(--danger); color: #fff; animation: ringPulse 1.2s infinite; }
.mic[disabled] { opacity: .35; pointer-events: none; }

/* ─────────── Toast ─────────── */

#toast-wrap {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(18px + var(--safe-t)); z-index: 40;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 15px;
  font-size: 13px; line-height: 1.55;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: toastIn .24s cubic-bezier(.3,1.3,.4,1);
  max-width: 92vw;
}
.toast.err { border-color: rgba(255,93,93,.5); color: #ffd9d9; }
.toast.ok { border-color: rgba(74,222,128,.45); color: #d3ffe4; }
.toast.out { animation: toastOut .28s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ─────────── 启动遮罩 ─────────── */

#boot {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 26px;
  background: radial-gradient(circle at 50% 28%, #0e2431 0%, #050c12 62%);
  transition: opacity .4s, visibility .4s;
}
/* 注意：作者样式的 display:flex 会覆盖 UA 样式表的 [hidden]{display:none}，
 * 于是 el.boot.hidden = true 会静默失效。必须显式补这一条。 */
#boot[hidden] { display: none; }
#boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-inner { width: min(420px, 100%); text-align: center; }
.boot-logo {
  width: 68px; height: 68px; margin: 0 auto 18px;
  border-radius: 19px; display: flex; align-items: center; justify-content: center;
  font-size: 25px; font-weight: 800; letter-spacing: .5px; color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 44px rgba(94,231,255,.4);
}
#boot h1 { margin: 0 0 7px; font-size: 21px; font-weight: 700; letter-spacing: .4px; }
#boot-msg { margin: 0 0 20px; color: var(--text-dim); font-size: 13.5px; min-height: 1.5em; }
#boot-checks { list-style: none; margin: 0 0 22px; padding: 0; text-align: left; font-size: 12.8px; }
#boot-checks li {
  padding: 7px 0 7px 25px; position: relative; color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,.05); line-height: 1.5;
}
#boot-checks li::before {
  position: absolute; left: 2px; top: 7px; font-size: 12px;
}
#boot-checks li.pending::before { content: '○'; color: var(--text-mute); }
#boot-checks li.ok::before { content: '✓'; color: var(--ok); font-weight: 700; }
#boot-checks li.warn::before { content: '!'; color: var(--warn); font-weight: 700; }
#boot-checks li.err::before { content: '✕'; color: var(--danger); font-weight: 700; }
#boot-checks li small { display: block; color: var(--text-mute); font-size: 11.5px; margin-top: 2px; }
#boot-go { width: 100%; padding: 14px; font-size: 15px; }
.boot-note { margin: 15px 0 0; font-size: 11.5px; color: var(--text-mute); line-height: 1.75; }

/* ─────────── 横屏适配 ─────────── */

@media (orientation: landscape) and (max-height: 480px) {
  #guide { bottom: calc(var(--tabs-h) + var(--safe-b) + 76px); }
  #guide-avatar { width: 68px; height: 68px; }
  .shutter { width: 58px; height: 58px; }
  #dock { gap: 5px; }
  #sheet, #chat-panel { max-height: 88vh; }
}

/* 小屏微调 */
@media (max-width: 350px) {
  .btn { padding: 9px 12px; font-size: 12.5px; }
  #guide-avatar { width: 76px; height: 76px; }
}
