/* 模拟器外壳（工具界面）用 DeskBot 设计系统的深色：暖中性色、Geist、只有一个橙色强调。
   这些变量也被 lab.css / game.css 用到，改这里三个页面一起变。 */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap");

:root {
  --bg: #0e0e0e;          /* ground · dark */
  --panel: #161615;
  --raise: #1b1b1a;       /* surface · dark */
  --sunk: #262625;        /* surface-sunk · dark */
  --line: #2a2a28;
  --text: #efefec;        /* ink · dark */
  --muted: #a6a6a1;       /* ink-muted · dark */
  --faint: #6e6e6a;
  --accent: #ff6a26;      /* accent · dark */
  --on-accent: #121212;
  --ok: #3ec27a;
  --up: #ff5a4e;          /* 红涨 */
  --down: #3ec27a;        /* 绿跌 */
  --eye: #b39cff;         /* lilac：AI 的颜色（游戏里的画像维度条） */
  --shell: #e4e2dc;
  --shell-dark: #c4c1b9;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Geist, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
button:hover { border-color: var(--faint); }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
button.accent, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.accent:hover, button.primary:hover { filter: brightness(1.08); }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 16px; letter-spacing: -0.2px; }
.brand span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; font-family: var(--mono); }
.bar-right { display: flex; align-items: center; gap: 18px; }
.bar-right a { color: var(--muted); font-size: 13px; text-decoration: none; }
.bar-right a:hover { color: var(--text); }
.conn { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.conn.on i { background: var(--ok); }
.conn.wait i { background: var(--accent); animation: blinkdot 1s steps(1) infinite; }
@keyframes blinkdot { 50% { opacity: .25; } }


/* ================= 控制台（index.html）：屏幕是主角，其余尽量塞满 ================= */
body.console { height: 100vh; overflow: hidden; font-size: 13px; line-height: 1.4; }
.console .bar { padding: 6px 14px; gap: 14px; flex: none; }
.console .brand { font-size: 15px; white-space: nowrap; }
.console .bar-right { margin-left: auto; gap: 12px; min-width: 0; }
.console .links { display: flex; gap: 12px; white-space: nowrap; }
.console .links a { color: var(--muted); font-size: 12px; text-decoration: none; }
.console .links a:hover { color: var(--text); }
.console .conn { padding: 3px 9px; white-space: nowrap; }
button.icon { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; font: 500 13px var(--mono); border-radius: 50%; color: var(--muted); }
button.icon:hover { color: var(--text); }

.peers { display: flex; gap: 10px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.peers span { display: inline-flex; align-items: center; gap: 5px; }
.peers i { width: 6px; height: 6px; border-radius: 50%; background: var(--sunk); }
.peers b { font: 500 12px var(--mono); }
.peers .on { color: var(--text); }
.peers .on i { background: var(--ok); }

#card-json { margin: 0; font: 11px/1.45 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-all; max-height: 100%; overflow: auto; }
/* 三栏：控制 | 屏幕 | 连接+演示。每栏自己滚动，但设计上桌面不用滚 */
.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr) 308px; }
.col { min-height: 0; overflow-y: auto; background: var(--panel); scrollbar-width: thin; }
.ctl { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.s-card { flex: 1; min-height: 64px; display: flex; flex-direction: column; border-bottom: 0; }
.s-card pre { flex: 1; min-height: 0; max-height: none; }
.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.side > .sec { flex: none; }
.side > .s-3d { flex: 1 1 auto; min-height: 220px; display: flex; flex-direction: column; }
.s-3d .stage3d { flex: 1; height: auto; min-height: 180px; }
.sec { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.sec h3, .tail h3 { margin: 0 0 7px; font: 500 11px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.sec h3 small, .tail h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); font-family: Geist, "PingFang SC", sans-serif; font-size: 12px; }
.h-actions { margin-left: auto; display: flex; gap: 4px; }
.note { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--faint); }

/* 按钮：小胶囊 */
.console button { padding: 3px 10px; font-size: 12.5px; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { font-family: var(--mono); font-size: 12px; padding: 3px 9px; }
.chips button[data-live], .chips button[data-gesture] { font-family: inherit; font-size: 12.5px; }
.chips.tight button { padding: 3px 7px; }
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.grp { display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 6px; padding: 4px 0; }
.grp + .grp { border-top: 1px dashed var(--line); }
.grp > span { font-size: 12px; color: var(--faint); padding-top: 4px; }
.grid5 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.grid5 button { display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 8px; padding: 5px 6px; }
.grid5 button[data-scene="stop"] { grid-column: span 1; color: var(--muted); }
kbd { font: 500 10.5px/1 var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
button.running { border-color: var(--accent); }
button.running kbd { color: var(--accent); border-color: var(--accent); }

.scene-state { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.scene-state b { font-weight: 500; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scene-state .pg { display: flex; gap: 3px; flex-wrap: wrap; }
.scene-state .pg i { width: 12px; height: 4px; border-radius: 2px; background: var(--sunk); }
.scene-state .pg i.on { background: var(--text); }
.scene-chip { font: 500 12px/1 var(--mono); padding: 4px 9px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }

.switch { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; cursor: pointer; }
.switch input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.switch small { color: var(--faint); margin-left: auto; font: 11px var(--mono); }

.line { display: flex; gap: 4px; align-items: center; }
.line input, .console input:not([type=checkbox]) { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font: 12px var(--mono); }
.line.pop { margin-top: 6px; }
.line.pop[hidden] { display: none; }
textarea { width: 100%; height: 60px; margin: 8px 0 6px; resize: vertical; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: 12px/1.4 var(--mono); }

/* 3D 预览（右栏小卡片，可放大到屏幕所在的位置） */
.stage3d { position: relative; height: 196px; overflow: hidden; perspective: 1800px; touch-action: none; border-radius: 10px;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #1d1c1a 0%, var(--bg) 75%); border: 1px solid var(--line); }
.fit { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; }
.robot { position: absolute; transform-style: preserve-3d; transition: transform .6s ease; }
.sec.s-3d.off .stage3d { display: none; }
.sec.s-3d.off h3 { margin-bottom: 0; }
body.big3d .side > .s-3d { flex: none; min-height: 0; }
body.big3d .s-3d .stage3d { display: none; }
.hero-3d { display: none; position: relative; flex: 1; width: 100%; min-height: 0; perspective: 1800px; }
body.big3d .hero-3d { display: block; }
body.big3d .hero-3d .stage3d { display: block; position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; }
body.big3d .flat-holder { display: none; }

/* 场景演示：紧凑列表 */
.scenes { display: grid; gap: 4px; }
.scene { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; text-align: left; border-radius: 10px; padding: 5px 8px 5px 11px; background: var(--raise); }
.scene b { font-weight: 600; font-size: 13px; line-height: 1.3; }
.scene span { grid-column: 1; font-size: 11.5px; color: var(--faint); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene i { grid-row: 1 / 3; grid-column: 2; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-style: normal; font-size: 9px; }
.scene:hover i, .scene.running i { background: var(--accent); color: var(--on-accent); }
.scene.running { border-color: var(--accent); }
.scenes .all { justify-self: start; font-size: 12px; color: var(--muted); background: none; border: 0; padding: 2px 2px; }
.scenes .all:hover { color: var(--text); }

details.dev { border-bottom: 0; padding: 0; }
details.dev > summary { padding: 9px 14px; cursor: pointer; font: 500 11px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); list-style: none; }
details.dev > summary::after { content: " +"; }
details.dev[open] > summary::after { content: " −"; }
details.dev[open] { padding-bottom: 12px; }
details.dev > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.dev textarea { width: calc(100% - 28px); }

/* 中：屏幕 */
.hero { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(128px, 30%); background: radial-gradient(ellipse 70% 60% at 50% 40%, #1c1b19 0%, var(--bg) 78%); }
.hero-main { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
.flat-holder { background: #111; border-radius: 22px; padding: 12px; box-shadow: 0 0 0 1px #2a2a28, 0 18px 36px rgba(0,0,0,.5); transition: transform .12s ease-out; flex: none; }
.flat-holder.pressed { transform: translateY(5px) scale(.985); }
.flat-inner { position: relative; width: 100%; height: 100%; }
.screen.flat-screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; touch-action: manipulation; }

.hero-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.tele { font: 11.5px/1.3 var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tele b { color: var(--text); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: none; padding: 3px 9px; font-size: 12px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--text); color: var(--bg); }
.tools { display: flex; gap: 6px; margin-left: auto; }
.tools button { padding: 4px 14px; font-size: 13px; }
.caption-bar { flex: 1 0 100%; font-size: 12.5px; color: var(--text); position: relative; padding-left: 14px; }
.caption-bar:empty { display: none; }
.caption-bar::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blinkdot 1s steps(1) infinite; }

/* 日志尾巴：本机消息 + 中枢日志 */
.tail { display: flex; flex-direction: column; min-height: 0; padding: 7px 0 0; background: var(--panel); }
.tail-head { display: flex; align-items: center; gap: 12px; padding: 0 14px 5px; }
.tail-head h3 { margin: 0; }
.tail-head a { margin-left: auto; color: var(--muted); font-size: 12px; text-decoration: none; }
.tail-head a:hover { color: var(--text); }
.log { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; font: 11.5px/1.45 var(--mono); scrollbar-width: thin; }
.log li { display: grid; grid-template-columns: 58px 34px 1fr; gap: 0 8px; padding: 1px 14px; border-top: 1px solid #1f1f1d; align-items: baseline; }
.log li .tm { color: var(--faint); font-variant-numeric: tabular-nums; }
.log li .tg { color: var(--faint); }
.log li .tx { color: var(--muted); word-break: break-all; min-width: 0; }
.log li.down .tg { color: var(--eye); }
.log li.up .tg { color: var(--accent); }
.log li.sys .tx { color: var(--faint); }
.log li.log .tx { font-family: Geist, "PingFang SC", sans-serif; font-size: 12px; color: var(--muted); }
.log li.log .tx b { font: 500 11.5px var(--mono); color: var(--text); margin-right: 6px; }
.log li.log.warn .tg { color: var(--accent); }
.log li.log.warn .tx { color: var(--text); }
.log li.log.error { background: color-mix(in srgb, var(--up) 9%, transparent); }
.log li.log.error .tg { color: var(--up); font-weight: 600; }
.log li.log.error .tx { color: var(--text); }
.tail[data-show="msg"] li.log, .tail[data-show="log"] li.up, .tail[data-show="log"] li.down, .tail[data-show="log"] li.sys { display: none; }

/* 快捷键面板 */
.help { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: grid; place-items: center; }
.help[hidden] { display: none; }
.help-card { width: min(460px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 16px; }
.help-card h3 { margin: 0 0 8px; font: 500 12px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.help-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.help-card dt { white-space: nowrap; }
.help-card dd { margin: 0; color: var(--muted); }
.help-card kbd { font-size: 11px; color: var(--text); }
.help-card code { font: 11.5px var(--mono); color: var(--muted); }

/* 窄屏（手机）：单列，屏幕在最上面撑满宽度，其余按重要性往下排 */
@media (max-width: 820px) {
  body.console { height: auto; overflow: visible; }
  .console .bar { padding: 8px 14px; gap: 8px; }
  .console .brand span, .console .links, .console .peers, .scene-chip { display: none; }
  .console .bar-right { margin-left: auto; }
  .grid { display: flex; flex-direction: column; }
  .col { display: contents; }
  .hero { display: contents; }
  .hero-main { order: 0; padding: 14px 14px 6px; overflow: visible; }
  .hero-bar { order: 1; border: 0; background: none; padding: 4px 14px 8px; }
  .hero-bar .seg:not(.keep) { display: none; }
  .tele { order: 3; flex-basis: 100%; font-size: 11px; white-space: normal; }
  .tools { flex: 1; margin-left: 0; }
  .tools button { flex: 1; min-height: 44px; font-size: 15px; }
  .s-scenes { order: 2; } .s-live { order: 3; } .s-faces { order: 4; } .s-demos { order: 5; } .s-body { order: 6; }
  .s-conn { order: 7; } .s-3d { order: 8; display: none; } .s-card { display: none; } .dev { order: 9; } .tail { order: 10; border-top: 1px solid var(--line); }
  body.big3d .s-3d { display: none; }
  .sec { background: var(--panel); padding: 14px 16px; }
  .console button { min-height: 38px; font-size: 14px; }
  .console button.icon { min-height: 0; width: 34px; height: 34px; }
  .chips button { padding: 6px 12px; }
  .grid5 { grid-template-columns: repeat(3, 1fr); }
  .grid5 button { min-height: 44px; }
  .grp { grid-template-columns: 40px 1fr; }
  .scene { padding: 10px 12px; }
  .tail { height: 260px; }
  .hero-3d { min-height: 62vh; }
  .caption-bar { order: 4; }
}

/* ---------- 3D 机身：照实物（白色 PLA 3D 打印，2026-10-31 照片），每个面按朝向打光 ---------- */
.box, .part { position: absolute; transform-style: preserve-3d; }
.face { position: absolute; backface-visibility: hidden; outline: 1px solid transparent; }   /* 透明描边：去掉 3D 面接缝处的锯齿虚线 */
.face.top    { filter: brightness(1.05); }
.face.side   { filter: brightness(.8); }
.face.back   { filter: brightness(.74); }
.face.bottom { filter: brightness(.6); }
/* 白色 PLA：哑光（试过画打印层纹，缩小后会出摩尔纹，去掉了） */
.shell .face, .plate .face, .base .face, .arm .face, .plinth .face {
  background: linear-gradient(180deg, #f4f3f0, #e2e0db);
}
.plinth .face { filter: brightness(.93); }
.head .face.front { border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 8px rgba(0,0,0,.06); }
.floor-shadow {
  position: absolute; width: 900px; height: 700px; left: -450px; top: -350px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 35%, transparent 65%);
}

.cam {   /* 顶上的圆盘：现在是白色打印件，摄像头装进去前没有镜头 */
  position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-radius: 50%; background: radial-gradient(circle at 50% 45%, #f6f5f2 0 50px, #e3e1dc 51px);
  box-shadow: inset 0 0 0 5px #e8e6e1, 0 6px 14px rgba(0,0,0,.18);
}



/* ================= 模式切换条 / 设备 / 设置面板 ================= */
.s-modes { padding-bottom: 10px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.modes button { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 8px 6px; font-size: 14px; font-weight: 600; }
.modes button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.modes button.on kbd { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.now { margin-top: 8px; padding: 8px 10px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; }
.now[hidden] { display: none; }
.now-top { display: flex; align-items: baseline; gap: 8px; }
.now-top b { font-size: 13px; }
.now-top span { flex: 1; min-width: 0; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-top em { font: normal 500 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.now-bar { height: 3px; border-radius: 2px; background: var(--sunk); margin: 7px 0 8px; overflow: hidden; }
.now-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.now-ctl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.now-ctl button { padding: 4px 4px; font-size: 12px; border-radius: 8px; }
.combo { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.combo span { font-size: 12px; color: var(--faint); margin-right: 2px; }
.combo button { border-radius: 8px; font-size: 12px; padding: 3px 9px; }
.combo button[data-scene="stop"] { color: var(--muted); margin-left: auto; }
.s-modes .note { min-height: 17px; }

.s-device .dev-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 2px 0; color: var(--muted); }
.s-device .dev-row b { font: 500 12px var(--mono); color: var(--text); text-align: right; }
.s-device .line { margin-top: 7px; }
.s-device .line button { flex: 1; border-radius: 8px; }
.s-device button:disabled, .chips2 button:disabled { opacity: .35; cursor: default; }
.cheat { margin-top: 8px; font-size: 12px; }
.cheat summary { cursor: pointer; color: var(--muted); list-style: none; }
.cheat summary::before { content: "▸ "; }
.cheat[open] summary::before { content: "▾ "; }
.cheat dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 0; }
.cheat dt { color: var(--text); white-space: nowrap; }
.cheat dd { margin: 0; color: var(--faint); }

details.dbg { padding: 0; border-bottom: 0; flex: 1 1 auto; min-height: 0; }
details.dbg > summary { padding: 9px 14px; cursor: pointer; font: 500 11px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); list-style: none; }
details.dbg > summary::after { content: " +"; }
details.dbg[open] > summary::after { content: " −"; }
details.dbg > .sec { border-bottom: 0; border-top: 1px solid var(--line); }
details.dbg .s-card pre { max-height: 220px; }

/* 右栏：设置 / 演示 / 3D 三个标签页，设置是默认 */
.side > .s-tabs { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; border-bottom: 1px solid var(--line); }
.tabs-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex: none; }
.tabs-head .seg { flex: 1; }
.tabs-head .seg button { flex: 1; }
.tabs-head .sheet-x { display: none; }
.rpane { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 14px; scrollbar-width: thin; }
.rpane[hidden] { display: none; }
.rpane h3 { margin: 0 0 7px; font: 500 11px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.rpane h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); font-family: Geist, "PingFang SC", sans-serif; font-size: 12px; }
#rp-3d { padding: 0; display: flex; flex-direction: column; }
#rp-3d[hidden] { display: none; }
#rp-3d .s-3d { flex: 1; display: flex; flex-direction: column; padding: 10px 14px 12px; min-height: 0; }
#rp-3d .s-3d h3 { margin: 0 0 7px; font: 500 11px/1.2 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
#rp-3d .s-3d h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); font-family: Geist, "PingFang SC", sans-serif; font-size: 12px; }
#rp-3d .stage3d { flex: 1; height: auto; min-height: 180px; }
body.big3d .s-tabs #rp-3d .stage3d { display: none; }

.st-status { font-size: 12px; color: var(--faint); min-height: 18px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.st-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sunk); flex: none; }
.st-status.ok { color: var(--muted); } .st-status.ok::before { background: var(--ok); }
.st-status.pend { color: var(--text); } .st-status.pend::before { background: var(--accent); animation: blinkdot 1s steps(1) infinite; }
.st-status.warn { color: var(--text); } .st-status.warn::before { background: var(--accent); }
.st-status.err { color: var(--up); } .st-status.err::before { background: var(--up); }
.st-tabs { display: flex; margin-bottom: 10px; }
.st-tabs button { flex: 1; }
.st-group { padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px dashed var(--line); }
.st-group:last-child { border-bottom: 0; margin-bottom: 0; }
.st-group h4 { margin: 0 0 7px; font: 600 12.5px/1.2 Geist, "PingFang SC", sans-serif; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.st-group h4 small { font-weight: 400; color: var(--faint); font-size: 12px; }
.opt { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: baseline; width: 100%; text-align: left; border-radius: 10px; padding: 7px 11px; margin-bottom: 4px; }
.opt b { font-size: 13px; }
.opt span { font-size: 12px; color: var(--faint); }
.opt.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.opt.on span { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.chips2 { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; background: var(--raise); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; cursor: grab; }
.pchip b { font-weight: 600; }
.pchip i { font: normal 11px var(--mono); color: var(--faint); }
.pchip button { border: 0; background: none; padding: 0 5px; min-width: 18px; font-size: 14px; line-height: 1.3; color: var(--faint); border-radius: 50%; }
.pchip button:hover { color: var(--text); background: var(--sunk); }
.st-add { position: relative; }
.st-add input { width: 100%; }
.st-add.inline { display: flex; gap: 4px; }
.st-add.inline input { flex: 1; }
.dd { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 3px); margin: 0; padding: 4px; list-style: none; background: var(--raise); border: 1px solid var(--faint); border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.dd li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dd li:hover { background: var(--sunk); }
.dd li i { font: normal 11.5px var(--mono); color: var(--faint); }
.st-row { display: grid; grid-template-columns: 70px 1fr 54px; gap: 8px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.st-row input[type=range] { accent-color: var(--accent); width: 100%; margin: 0; padding: 0; }
.st-row output { font: 500 12px var(--mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.st-row.sw { grid-template-columns: 1fr auto; }
.st-row select { grid-column: 2 / 4; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font: 12.5px Geist, "PingFang SC", sans-serif; color: var(--text); }
.st-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.st-err { margin: 6px 0 0; font-size: 12px; color: var(--up); }
#st-reset { border-radius: 8px; font-size: 12px; color: var(--muted); }

.bar-settings { display: none; }

/* 窄屏：设置变成一整张从下往上的面板 */
@media (max-width: 820px) {
  .bar-settings { display: inline-block; }
  .modes { grid-template-columns: repeat(3, 1fr); }
  .modes button { min-height: 44px; }
  .s-modes { order: 2; } .s-device { order: 3; } details.dbg { order: 6; }
  .side > .s-tabs { display: none; }
  body.sheet .side > .s-tabs { display: flex; position: fixed; inset: 0; z-index: 60; background: var(--panel); border: 0; }
  body.sheet .tabs-head .sheet-x { display: grid; }
  .rpane { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
  .st-row { grid-template-columns: 76px 1fr 56px; }
  .pchip { padding: 5px 6px 5px 12px; }
  .pchip button { min-height: 28px; min-width: 28px; }
  .opt { min-height: 48px; }
}

/* 真机状态：横幅 / 设备盒子 / 仅预览 */
.warn-bar { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: color-mix(in srgb, var(--up) 14%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--up) 45%, var(--line)); font-size: 13px; font-weight: 500; flex: none; }
.warn-bar[hidden] { display: none; }
.warn-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.warn-bar a { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.dev-shown { display: grid; gap: 2px; margin: 4px 0 6px; padding: 7px 9px; border-radius: 8px; background: var(--raise); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dev-shown b { font: 500 12.5px var(--mono); color: var(--text); word-break: break-all; }
.dev-shown.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.dev-shown.warn { border-color: #d99a2b; background: color-mix(in srgb, #d99a2b 13%, var(--raise)); }
.dev-shown.warn b { color: #f2b84b; }
.dev-shown.off { border-color: color-mix(in srgb, var(--up) 55%, var(--line)); background: color-mix(in srgb, var(--up) 10%, var(--raise)); }
.dev-shown.off b { color: var(--up); }
.s-device .dev-row b.bad { color: var(--up); }
.s-device .line button.warn { border-color: #d99a2b; color: #f2b84b; }
.modes-root.preview .modes button { border-style: dashed; }
.modes-root.preview .modes::after { content: "仅预览 · 真机不会跟着变"; grid-column: 1 / -1; font-size: 12px; color: #f2b84b; padding: 2px 2px 0; }
.modes-root.preview .now-top b::after { content: " · 仅预览"; color: #f2b84b; font-weight: 400; }
