/* 深海配色（文档\聊天App_设计.md “深海配色”表）。只做深色这一套。 */
:root {
  --bg: #0B1626;
  --bar: #0E1B2E;
  --line: #1A2B44;
  --her: #16273F;
  --me: #5CC8D6;
  --me-text: #04222A;
  --text: #E6EEF7;
  --dim: #8FA3BA;
  --action: #9FB3C8;
  --on: #7FD6E2;
  --lost: #E9A88C;
  --lost-bg: #2A2230;
  --lost-text: #F1C9B4;
  --input-line: #22385A;
  --avatar: #16314A;
  --font: -apple-system, "PingFang SC", system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 var(--font); overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- 整体布局：手机竖屏 ---------- */
.app {
  position: fixed; left: 0; right: 0; top: 0; height: var(--app-h);
  display: grid; grid-template-rows: 1fr auto; grid-template-columns: 100%;
  grid-template-areas: "main" "tabs";
}
.chat, .page { grid-area: main; min-height: 0; }
.now { display: none; }

/* 底部五个页签 */
.tabs {
  grid-area: tabs; display: flex; background: var(--bar); border-top: 1px solid var(--line);
  padding-bottom: var(--bottom);
}
.tab {
  flex: 1; min-height: 54px; min-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--dim); font-size: 11px;
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--on); }
.app.typing .tabs { display: none; }

/* ---------- 聊天 ---------- */
.chat { display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 12px; background: var(--bar); border-bottom: 1px solid var(--line);
  padding: calc(var(--top) + 8px) 16px 8px; min-height: calc(var(--top) + 60px); flex: none;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--avatar); color: var(--on);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.avatar svg { width: 30px; height: 30px; }
.avatar.big { width: 72px; height: 72px; }
.avatar.big svg { width: 54px; height: 54px; }
.who { min-width: 0; }
.name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.status { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 6px; line-height: 1.4; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: none; flex: none; }
.status.online, .status.typing { color: var(--on); }
.status.online .dot, .status.typing .dot { display: inline-block; background: var(--on); }
.status.lost { color: var(--lost); }

.banner {
  background: var(--lost-bg); color: var(--lost-text); font-size: 13px; padding: 9px 16px; flex: none;
  border-bottom: 1px solid var(--line);
}
.notify-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; font-size: 13px; color: var(--dim);
  background: var(--bar); border-bottom: 1px solid var(--line); flex: none;
}
.notify-bar span { flex: 1; }
.pill {
  min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--me); color: var(--me-text); font-weight: 600; font-size: 14px;
}
.x { min-width: 44px; min-height: 44px; font-size: 22px; color: var(--dim); }

.list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 12px 12px; }
.older { text-align: center; font-size: 12px; color: var(--dim); min-height: 20px; padding: 4px 0; }
.msgs { display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }

.day { align-self: center; font-size: 12px; color: var(--dim); margin: 14px 0 6px; }
.row { display: flex; flex-direction: column; margin-top: 3px; max-width: 80%; }
.row.her { align-self: flex-start; align-items: flex-start; }
.row.me { align-self: flex-end; align-items: flex-end; }
.row.gap { margin-top: 12px; }
.bubble {
  padding: 9px 14px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text;
}
.her .bubble { background: var(--her); color: var(--text); border-radius: 18px 18px 18px 6px; }
.me .bubble { background: var(--me); color: var(--me-text); border-radius: 18px 18px 6px 18px; }
.bubble .act { color: var(--action); font-style: italic; }
.bubble.broken { color: var(--dim); font-style: italic; }
/* v3 画面描写：不用气泡，像小说里的叙述，靠左和她的气泡对齐；画面在上、话在下（间隔 8px） */
.row.scene { max-width: 90%; }
.narr {
  color: #A9BACB; font-size: 14px; line-height: 1.75; padding: 0 4px; white-space: pre-wrap;
  word-break: break-word; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text;
}
.narr + .bubble { margin-top: 8px; }
/* 留言（A5，画稿 14）：上面一行小字、气泡一圈淡黄细边；连着几条前面一条分隔线 */
.note-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #E9C46A; margin: 0 0 5px 2px; }
.note-head .ic { width: 15px; height: 15px; }
.bubble.note { border: 1px solid rgba(233, 196, 106, .35); }
.note-sep {
  align-self: stretch; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--dim); margin: 14px 0 4px;
}
.note-sep::before, .note-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.row.picked { position: relative; z-index: 41; background: #0D1A2B; border: 1px solid #22385A; border-radius: 18px; padding: 12px; margin-left: -13px; }
.row.picked.me { margin-left: 0; margin-right: -13px; }
.copy-back { position: fixed; inset: 0; z-index: 40; background: rgba(2, 8, 16, .6); }
.copy-menu {
  position: fixed; z-index: 42; min-width: 200px; background: #13233A; border: 1px solid #22385A; border-radius: 16px;
  overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.copy-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 18px; font-size: 16px; text-align: left; }
.copy-item + .copy-item { border-top: 1px solid #1A2B44; }
.copy-item:hover, .copy-item:focus-visible { background: #1A2E4A; outline: none; }
.copy-ic { width: 20px; height: 20px; color: var(--dim); flex: none; }
.copy-toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 60;
  background: rgba(20, 36, 58, .96); color: var(--text); padding: 10px 20px; border-radius: 12px; font-size: 14px; pointer-events: none;
}
/* 手机：长按弹自己的复制菜单，不让系统的选字、放大镜一起出来 */
@media (pointer: coarse) {
  .row .bubble, .row .narr { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
.meta { font-size: 11px; color: var(--dim); margin: 3px 6px 0; line-height: 1.3; }
.meta.failed { color: var(--lost); }
button.meta { min-height: 32px; padding: 0 6px; margin-top: 0; text-decoration: underline; text-underline-offset: 2px; }
.empty { text-align: center; color: var(--dim); font-size: 14px; margin-top: 30vh; }

.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--bar); border-top: 1px solid var(--line);
  padding: 8px 12px; flex: none;
}
.app:not(.typing) .composer { padding-bottom: 8px; }
.composer textarea {
  flex: 1; min-height: 44px; max-height: 132px; resize: none; background: var(--bg); color: var(--text);
  border: 1px solid var(--input-line); border-radius: 22px; padding: 10px 16px; font: 16px/22px var(--font);
  outline: none; display: block;
}
.composer textarea:focus { border-color: var(--on); }
.composer textarea::placeholder { color: var(--dim); }
.send {
  width: 44px; height: 44px; border-radius: 50%; background: var(--me); color: var(--me-text);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.send:disabled { opacity: .35; cursor: default; }
.send svg { width: 22px; height: 22px; }

/* ---------- v2 页签：小家、状况、控制、位置（panels.js 画） ---------- */
.page { display: flex; flex-direction: column; background: var(--bg); }
.page-head {
  background: var(--bar); border-bottom: 1px solid var(--line); flex: none;
  padding: calc(var(--top) + 12px) 20px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
}
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0; flex: 1; }
.page-meta { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.page-sub { flex-basis: 100%; font-size: 14px; color: var(--dim); }
.page-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 12px;
}
.page-body > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; flex-shrink: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.lockline .ic { width: 14px; height: 14px; }

.card { background: var(--her); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }
.card-head h2 { color: var(--dim); font-weight: 500; }
.card-meta { font-size: 12px; color: var(--dim); }
.card p { margin: 0; }
.card-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.card-row > .btn { flex: none; white-space: nowrap; }
.sub-h { font-size: 13px; color: var(--dim); font-weight: 500; margin: 6px 0 0; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.pad-t { padding-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.on { color: var(--on); }
.stale {
  background: var(--lost-bg); color: var(--lost-text); font-size: 13px; padding: 9px 14px; border-radius: 12px;
}
.stale.soft { background: var(--bar); color: var(--dim); }
.stale.warn { background: var(--lost-bg); }
.stale.small { font-size: 12px; padding: 7px 10px; }
.empty-card { color: var(--dim); text-align: center; padding: 28px 0; font-size: 14px; }
.note { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--text); }
.foot { font-size: 12px; color: var(--dim); line-height: 1.6; margin: 4px 0 0; }

.quote { font-size: 17px; line-height: 1.5; }
.resting { font-size: 13px; color: var(--lost-text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--bg); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.tile-l { font-size: 12px; color: var(--dim); }
.tile-v { font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.tile-s { font-size: 13px; color: var(--dim); margin-top: 2px; overflow-wrap: anywhere; }
.bar.none { background: transparent; }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 3px 11px; font-size: 13px; }

.meter { display: grid; grid-template-columns: 4.6em 1fr 5.5em; align-items: center; gap: 10px; font-size: 14px; }
.meter.stack { grid-template-columns: 1fr auto; grid-template-areas: "n r" "b b"; row-gap: 6px; }
.meter.stack .m-name { grid-area: n; }
.meter.stack .m-read { grid-area: r; }
.meter.stack .bar { grid-area: b; }
.m-read { color: var(--dim); font-size: 13px; text-align: right; white-space: nowrap; }
.bar { position: relative; height: 6px; border-radius: 3px; background: var(--bg); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--on); }
.bar .fill.warn { background: var(--lost); }
.bar .fill.tiny { width: 8px !important; height: 8px; top: -1px; border-radius: 50%; }
.bar .base { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--dim); border-radius: 1px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv > span { color: var(--dim); flex: none; }
.kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.kv.text b { color: var(--text); font-size: 13px; line-height: 1.5; }
.kv-block { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl { display: flex; gap: 12px; font-size: 14px; align-items: baseline; }
.tl-at { color: var(--dim); font-variant-numeric: tabular-nums; flex: none; width: 3em; }
.tl-state { color: var(--on); font-size: 13px; flex: none; }
.tl-state.bad { color: var(--lost); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--dim); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.link { color: var(--on); font-size: 14px; min-height: 36px; text-align: left; }
.link:disabled { color: var(--dim); opacity: .6; cursor: default; }
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 14px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.primary { background: var(--me); color: var(--me-text); }
.btn.ghost { background: transparent; color: var(--on); border: 1px solid var(--line); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--input-line); }
.btn.text { min-height: 36px; padding: 0 8px; color: var(--dim); font-weight: 500; font-size: 14px; }
.btn.coral { background: #E9A88C; color: #2A1A12; }
.btn.outline-coral { background: transparent; color: var(--lost-text); border: 1px solid #5A3E3A; }
.btn.dimmed { opacity: .55; }
.btn.big { width: 100%; min-height: 52px; border-radius: 16px; font-size: 16px; }
.tag { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

.seg { display: flex; background: var(--her); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 10px; color: var(--dim); font-size: 15px; }
.seg button.on { background: #16314A; color: var(--text); }
.seg.small { width: auto; padding: 3px; border-radius: 10px; background: var(--bg); }
.seg.small button { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; white-space: nowrap; }
.m-name { font-weight: 400; }

/* 小家 */
.where { flex-direction: row; align-items: center; gap: 14px; }
.here-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--on); flex: none; box-shadow: 0 0 0 5px rgba(127, 214, 226, .18); }
.where-main { font-size: 17px; }
.where-sub { font-size: 14px; color: var(--dim); }
/* 小家平面图（A5，照画稿 11、12；数据全从 home.layout 来） */
#page-home { position: relative; }
.plan-tools { display: flex; gap: 10px; align-items: stretch; }
.plan-tools .seg { flex: 1; min-width: 0; }
.plan-aim { width: 52px; flex: none; border-radius: 14px; background: var(--her); color: var(--on); display: flex; align-items: center; justify-content: center; }
.plan-aim .ic { width: 24px; height: 24px; }
.plan-box {
  position: relative; flex: none; border-radius: 18px; overflow: hidden; background: #0A1424; border: 1px solid var(--line);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab;
}
.plan-box:active { cursor: grabbing; }
.plan { width: 100%; height: 100%; display: block; }
.plan text { text-anchor: middle; dominant-baseline: central; pointer-events: none; font-family: var(--font); }
.plan-hint {
  position: absolute; left: 10px; bottom: 10px; background: rgba(14, 27, 46, .92); color: var(--dim); font-size: 12px;
  padding: 5px 10px; border-radius: 10px; pointer-events: none;
}
.p-drive { fill: #121D2D; }
.p-room { fill: #13233A; }
.p-room.semi { fill: #10283A; }
.p-room.open { fill: #0F1C2E; }
.p-wall { fill: none; stroke: #4D6E96; stroke-width: 4; stroke-linejoin: miter; }
.p-win { fill: rgba(92, 200, 214, .28); stroke: #5CC8D6; stroke-width: .8; }
.p-glass { stroke: #7FD6E2; stroke-width: 3; }
.p-roller { stroke: #8FA3BA; stroke-width: 2.5; stroke-dasharray: 8 4; }
.p-swing { fill: none; stroke: #7690B3; stroke-width: 1; stroke-dasharray: 3 2.5; vector-effect: non-scaling-stroke; }
.p-fence { stroke: #35574A; stroke-width: 4; }
.p-dashed { stroke: #3A5578; stroke-width: 1; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.p-overlay { fill: rgba(92, 200, 214, .06); stroke: #5CC8D6; stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.p-stair { fill: #13233A; stroke: #5A7AA3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.p-tread { stroke: #5A7AA3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.p-light { fill: #E8C66A; }
.p-f { fill: #1A2D4A; stroke: #5A7AA3; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.p-f.k-lawn { fill: #0E2620; stroke: none; cursor: inherit; }
.p-f.k-plant { fill: #123527; stroke: #1F5240; }
.p-f.k-flower { fill: #2E2236; stroke: #4A3352; }
.p-f.k-path { fill: #18263A; stroke: #283B55; }
.p-f.k-rug { fill: rgba(26, 45, 74, .5); stroke-dasharray: 3 2; }
.p-f.k-water { fill: #15405A; stroke: #5CC8D6; }
.p-f.k-car { fill: #182840; }
.p-f.k-dev { fill: #5A7AA3; }
.p-f.k-sky { fill: none; stroke: #5CC8D6; stroke-dasharray: 5 3; }
.p-f.tail { stroke: #E9A88C; stroke-width: 1.6; }
.p-f.sel { stroke: #5CC8D6 !important; stroke-width: 3.5 !important; stroke-dasharray: none !important; }
.p-rname { fill: #E6EEF7; font-weight: 700; }
.p-flabel { fill: #B8C7D9; }
.p-flabel.water { fill: #CFEFF4; }
.p-ylabel { fill: #3F7A60; font-weight: 700; letter-spacing: .15em; }
.p-ylabel.small { fill: #8FA3BA; font-weight: 400; letter-spacing: 0; }
.p-marks { pointer-events: none; }
.p-her { fill: var(--on); stroke: #0B1626; }
.p-her-halo { fill: var(--on); opacity: .22; }
.p-pill-her { fill: var(--on); }
.p-you { fill: #0B1626; stroke: var(--text); }
.p-you-dot { fill: var(--text); }
.p-pill-you { fill: var(--text); }
.p-pill-t { fill: #04222A; font-weight: 700; }
.lg-her { width: 10px; height: 10px; border-radius: 50%; background: var(--on); display: inline-block; }
.lg-you { width: 18px; height: 12px; border-radius: 6px; border: 1.2px solid var(--text); display: inline-block; }
.lg-you2 { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--text); display: inline-block; box-sizing: border-box; }
.lg-tail { width: 18px; height: 12px; border-radius: 3px; border: 1.5px solid #E9A88C; display: inline-block; box-sizing: border-box; }
.lg-water { width: 18px; height: 12px; border-radius: 3px; border: 1.2px solid #5CC8D6; background: #15405A; display: inline-block; box-sizing: border-box; }
.lg-light { width: 8px; height: 8px; border-radius: 50%; background: #E8C66A; display: inline-block; }
/* 点了家具：底下的说明卡 */
.fsheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; z-index: 20;
  background: var(--bar); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 4px 20px 18px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); animation: fs-up .18s ease-out;
}
@keyframes fs-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fsheet { animation: none; } }
.fsheet .grab-btn { display: block; width: 100%; min-height: 28px; }
.fsheet .grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--input-line); margin: 0 auto; }
.fs-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 26px; }
.fs-room { font-size: 14px; color: var(--dim); }
.fs-tail { background: #3A2A2A; color: var(--lost-text); font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.fs-name { font-size: 20px; font-weight: 700; margin: 2px 0 10px; }
.fs-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.fs-kv dt { color: var(--dim); }
.fs-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fs-kv dd.dim { color: var(--dim); }
.page-body.with-fsheet { padding-bottom: 220px; }

/* 曲线 */
.curve-box { height: 140px; background: var(--bg); border-radius: 12px; overflow: hidden; }
.curves { width: 100%; height: 100%; display: block; }
.curve { fill: none; stroke-width: 2; stroke-linejoin: round; }
.curve.c0, .lg-line.c0 { stroke: var(--on); border-color: var(--on); }
.curve.c1, .lg-line.c1 { stroke: #E9A88C; border-color: #E9A88C; stroke-dasharray: 6 4; }
.curve.c2, .lg-line.c2 { stroke: #A7A3F0; border-color: #A7A3F0; stroke-dasharray: 2 3; }
.curve.c3, .lg-line.c3 { stroke: #8FA3BA; border-color: #8FA3BA; stroke-dasharray: 8 3 2 3; }
.lg-line { width: 18px; height: 0; border-top: 2px solid; display: inline-block; }
.lg-line.c1 { border-top-style: dashed; }
.lg-line.c2 { border-top-style: dotted; }
.sleep-band { fill: #050D18; opacity: .75; }
.curve-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: -4px; }

/* 控制 */
.card.rest { background: #2A1F2B; border: 1px solid #4A3340; }
.card.rest h2 { color: #F1B99E; font-size: 17px; }
.card.rest p { font-size: 14px; color: var(--lost-text); line-height: 1.55; }
.rest-now { font-size: 13px; color: var(--dim); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two .btn { min-height: 48px; }
.gates { display: flex; flex-direction: column; }
.gate-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.gate-row .gname { flex: 1; min-width: 0; color: var(--dim); }
.gate-row.ok .gname { color: var(--text); }
.gmark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; font-size: 12px; line-height: 15px; text-align: center; color: var(--on); }
.gate-row.ok .gmark { border-color: transparent; font-size: 15px; }
.switch { width: 58px; height: 34px; border-radius: 17px; background: var(--bg); border: 1px solid var(--line); position: relative; flex: none; }
.switch i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--dim); transition: left .15s; }
.switch.on { background: #1B4A55; border-color: var(--on); }
.switch.on i { left: 28px; background: var(--on); }
.switch:disabled { opacity: .5; cursor: default; }
.list-card { padding: 4px 16px; gap: 0; }
.fold { border-top: 1px solid var(--line); }
.fold:first-child { border-top: 0; }
.fold-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left; font-size: 15px; }
.fold-right { color: var(--dim); font-size: 14px; }
.fold.open .fold-right { color: var(--on); }
.fold-body { padding: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.rows { display: flex; flex-direction: column; }
.row-line { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); font-size: 15px; }
.rows > .row-line:first-child, .fold-body > .row-line:first-child { border-top: 0; }
.row-line.dimmed { opacity: .55; }
.row-line.edit input { width: 8em; }
.draft { display: flex; flex-direction: column; gap: 4px; }
.draft-head { display: flex; justify-content: space-between; align-items: center; }
.draft-line { display: flex; align-items: center; gap: 8px; font-size: 14px; border-top: 1px solid var(--line); padding: 4px 0; }
.draft-line.struck .grow { text-decoration: line-through; color: var(--dim); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.page input {
  background: var(--bg); color: var(--text); border: 1px solid var(--input-line); border-radius: 10px;
  min-height: 40px; padding: 0 12px; font: 16px var(--font); outline: none; width: 100%;
}
.page input:focus { border-color: var(--on); }
.usage { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.u { background: var(--bg); border-radius: 12px; padding: 12px 8px; text-align: center; }
.u-l { font-size: 13px; color: var(--dim); }
.u-v { font-size: 22px; margin-top: 2px; }
.u-f { font-size: 11px; color: var(--lost); }
.warns { margin: 0; padding-left: 18px; font-size: 13px; color: var(--lost-text); }

/* 位置 */
.card.place { align-items: center; text-align: center; padding: 26px 18px 18px; gap: 8px; }
.card.place .grid2 { width: 100%; margin-top: 12px; }
.place-pin { color: var(--on); }
.place-pin .ic { width: 40px; height: 40px; }
.place-city { font-size: 34px; font-weight: 700; letter-spacing: 2px; }
.place .tile { text-align: center; padding: 14px 8px; }
.place .tile-v { font-size: 22px; }
.place-msg { font-size: 14px; border-radius: 12px; padding: 10px 14px; line-height: 1.55; }
.place-msg.ok { background: #12343A; color: var(--on); }
.place-msg.bad { background: var(--lost-bg); color: var(--lost-text); }
.cities { gap: 10px; }
.city-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; }
.city { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; min-height: 40px; padding: 0 16px; font-size: 15px; }

/* 控制页新版（A5，画稿 13） */
.sec-label { font-size: 14px; font-weight: 600; color: var(--dim); margin: 6px 4px -2px; }
.pill-count { font-size: 12px; color: var(--on); background: #16314A; border-radius: 999px; padding: 2px 10px; }
.pill-count.none { color: var(--dim); background: transparent; }
.form.put { grid-template-columns: 1fr 6.5em; }
.form.put .full, .form.put .btn.full { grid-column: 1 / -1; }
.form.put input { min-height: 48px; font-size: 16px; }
.set-card { padding: 4px 16px; gap: 0; }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 60px; width: 100%; text-align: left; border-top: 1px solid var(--line); font-size: 15px; padding: 8px 0; }
.set-card > .set-row:first-child { border-top: 0; }
.set-row:disabled { cursor: default; }
.set-row.edit input { width: 7em; min-height: 38px; }
.set-name { font-size: 16px; color: var(--text); }
.set-fold { border-top: 1px solid var(--line); }
.set-fold > .set-row { border-top: 0; }
.maint { padding: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.chev { width: 9px; height: 9px; border-right: 1.8px solid var(--dim); border-bottom: 1.8px solid var(--dim); transform: rotate(-45deg); flex: none; margin: 0 4px; }
.chev.down { transform: rotate(45deg); margin-top: -4px; }
.chev.up { transform: rotate(-135deg); margin-top: 4px; }
.card.means { padding: 0; gap: 0; overflow: hidden; }
.means-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 16px; }
.means-head h2 { font-size: 17px; color: var(--text); font-weight: 600; margin: 0 0 2px; }
.mrow { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mrow.active { background: #1A2A44; }
.mrow-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mrow-head h3 { font-size: 16px; margin: 0; font-weight: 600; }
.mnow { font-size: 13px; color: var(--on); }
.mnow.warn { color: var(--lost); }
.mdesc { margin: 0; font-size: 14px; color: var(--dim); line-height: 1.6; }
.live { font-size: 12px; color: var(--lost-text); background: #3A2A2A; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.mrow.later { flex-direction: row; align-items: center; color: #4D6080; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.seg.dur { background: transparent; padding: 0; gap: 8px; }
.seg.dur button { border: 1px solid var(--input-line); border-radius: 12px; min-height: 44px; font-size: 14px; white-space: nowrap; padding: 0 4px; }
.seg.dur button.on { border-color: var(--on); background: #16314A; color: var(--text); }
.seg.dur button:disabled { opacity: .45; cursor: default; }
.btn.coral-soft { background: #4A3230; color: #F1A98A; }
.btn.deep { background: #1F3A5A; color: var(--text); }
.btn.outline-coral.big { border-color: #E9A88C; color: #E9A88C; }
.sl { display: flex; flex-direction: column; gap: 6px; }
.sl-top { display: flex; justify-content: space-between; font-size: 14px; }
.sl-read { color: var(--dim); }
.sl-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.sl input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0;
  border: 0; padding: 0; min-height: 0; border-radius: 0; box-shadow: none;
}
.sl input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--me) var(--p, 50%), #4A4F55 var(--p, 50%)); }
.sl input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--me) var(--p, 50%), #4A4F55 var(--p, 50%)); }
.sl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--me); border: 3px solid var(--bar); margin-top: -8px; }
.sl input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--me); border: 3px solid var(--bar); }
.sl input[type=range]:disabled { opacity: .45; }

/* 输 PIN 的底板 */
.sheet-back { position: fixed; inset: 0; background: rgba(2, 8, 16, .72); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 480px; background: var(--bar); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 10px 24px calc(var(--bottom) + 20px); text-align: center;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--input-line); margin: 0 auto 16px; }
.sheet h2 { font-size: 19px; margin: 0 0 6px; }
.sheet p { margin: 0; font-size: 14px; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0 8px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #4A6488; }
.dots i.on { background: var(--on); border-color: var(--on); }
.sheet-msg { min-height: 22px; font-size: 14px; margin-bottom: 10px; color: var(--dim); }
.sheet-msg.ok { color: var(--on); font-weight: 600; }
.sheet-msg.bad { color: var(--lost); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { min-height: 54px; border-radius: 14px; background: var(--her); font-size: 24px; }
.key.plain { background: transparent; font-size: 15px; color: var(--dim); display: flex; align-items: center; justify-content: center; }
.key.plain .ic { width: 24px; height: 24px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 90px); transform: translateX(-50%); z-index: 60;
  background: #1F3450; color: var(--text); padding: 10px 18px; border-radius: 12px; font-size: 14px;
}
@media (min-width: 900px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
  .page-head { padding: 22px 32px 16px; }
  .page-body { padding: 20px 32px 32px; }
}

/* ---------- 配对、还没配对 ---------- */
.gate {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--top) + 16px) 16px calc(var(--bottom) + 16px);
  overflow-y: auto;
}
.gate-card { max-width: 400px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.gate h1 { font-size: 22px; margin: 14px 0 6px; }
.gate p { color: var(--dim); font-size: 15px; margin: 6px 0; }
.gate ol { text-align: left; color: var(--text); font-size: 15px; padding-left: 22px; margin: 12px 0; align-self: stretch; }
.gate ol li { margin: 6px 0; }
.gate .pill { margin-top: 14px; }
.gate .link { color: var(--on); min-height: 44px; margin-top: 6px; font-size: 14px; }
.gate .warn { color: var(--lost); }
.gate .ok { color: var(--on); }
.gate textarea {
  width: 100%; min-height: 88px; margin-top: 12px; background: var(--bar); color: var(--text); border: 1px solid var(--input-line);
  border-radius: 14px; padding: 10px 14px; font: 14px/1.4 var(--font); resize: vertical;
}

/* ---------- 电脑：左边竖排页签、中间聊天、右边“她现在” ---------- */
@media (min-width: 900px) {
  .app {
    grid-template-rows: 100%; grid-template-columns: 88px minmax(0, 1fr) 300px;
    grid-template-areas: "tabs main now";
  }
  .app.typing .tabs { display: flex; }
  .tabs {
    flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line);
    padding: 16px 0; gap: 4px;
  }
  .tab { flex: none; min-height: 64px; font-size: 12px; }
  .now {
    display: flex; flex-direction: column; grid-area: now; background: var(--bar); border-left: 1px solid var(--line);
    padding: 20px; gap: 16px; min-height: 0;
  }
  .now-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .now-title { font-size: 13px; color: var(--dim); }
  .now-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
  .now-box { background: var(--her); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .now-box.where { flex-direction: row; align-items: center; gap: 12px; }
  .now-box.where .where-main { font-size: 15px; }
  .now-box.where .where-sub { font-size: 13px; }
  .now-box.line { flex-direction: row; align-items: center; min-height: 46px; text-align: left; font-size: 14px; width: 100%; }
  .now-box.kvs .kv { font-size: 13px; }
  .now-body .tile { background: var(--her); }
  .now-body .btn.outline { color: var(--on); border-color: var(--line); }
  .row { max-width: 70%; }
  .list { padding: 12px 24px 16px; }
  .composer { padding: 12px 24px; }
  .composer textarea { max-width: none; }
}
