/* ════════════════════════════════════════════════════════════
   CLAUDE MIND · 绘学导图
   Claude Warm Daylight / Claude Warm Charcoal
   ════════════════════════════════════════════════════════════ */

:root {
  --ease: cubic-bezier(.22, .61, .36, 1);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --sidebar-w: 266px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
          "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ── 日间：温暖羊皮纸 ─────────────────────────── */
html[data-theme="light"] {
  --bg: #F7F5F0;
  --bg-2: #FAF9F5;
  --surface: #FFFDF9;
  --surface-2: #F1EEE7;
  --ink: #2C2A29;
  --ink-soft: #5F5A53;
  --muted: #948C81;
  --line: #E4DFD5;
  --guide: #DCD6CA;
  --node: #E3DFD7;
  --node-text: #2C2A29;
  --node-border: #D8D3C8;
  --root: #6E6256;
  --root-text: #FFFFFF;
  --accent: #D97757;
  --accent-ink: #B4573A;
  --accent-soft: #F6E5DC;
  --connector: #B5B0A8;
  --dot: rgba(110, 98, 86, .07);
  --shadow-s: 0 1px 2px rgba(70, 58, 44, .06);
  --shadow-m: 0 8px 26px rgba(70, 58, 44, .10);
  --shadow-l: 0 20px 60px rgba(70, 58, 44, .18);
  --scrim: rgba(46, 40, 34, .28);
  --danger: #C0553F;
}

/* ── 夜间：高级暖炭灰 ─────────────────────────── */
html[data-theme="dark"] {
  --bg: #191918;
  --bg-2: #1E1E1C;
  --surface: #232220;
  --surface-2: #2A2926;
  --ink: #F4F2ED;
  --ink-soft: #CFCAC1;
  --muted: #928B80;
  --line: #32312D;
  --guide: #34322E;
  --node: #2D2C29;
  --node-text: #F4F2ED;
  --node-border: #3A3833;
  --root: #E08263;
  --root-text: #1E1E1C;
  --accent: #E08263;
  --accent-ink: #F0A189;
  --accent-soft: #332721;
  --connector: #6A655D;
  --dot: rgba(244, 242, 237, .05);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-m: 0 10px 30px rgba(0, 0, 0, .42);
  --shadow-l: 0 24px 70px rgba(0, 0, 0, .6);
  --scrim: rgba(0, 0, 0, .5);
  --danger: #E0795F;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { transition: background .3s var(--ease), color .3s var(--ease); }
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, textarea { border: none; outline: none; background: transparent; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ═════════════ PIN 锁屏 ═════════════ */
.lock {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background:
    radial-gradient(1200px 700px at 50% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  padding: 24px; overflow: auto;
}
.lock-card { width: min(340px, 100%); text-align: center; }
.lock-mark {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 18px;
  display: grid; place-items: center; font-size: 24px; color: var(--root-text);
  background: var(--root); box-shadow: var(--shadow-m);
}
.lock-title {
  font-size: 15px; letter-spacing: .28em; font-weight: 600; margin: 0 0 6px;
  color: var(--ink);
}
.lock-sub { margin: 0 0 26px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 26px; }
.pin-dots i {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--connector); transition: all .18s var(--ease);
}
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.18); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-pad button {
  height: 62px; border-radius: 50%; font-size: 21px; font-weight: 400;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-s);
  transition: transform .12s var(--ease), background .18s;
}
.pin-pad button:active { transform: scale(.94); background: var(--surface-2); }
.pin-pad button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.lock-err { height: 18px; margin: 16px 0 0; font-size: 12.5px; color: var(--danger); }

/* ═════════════ 布局 ═════════════ */
.app {
  position: fixed; inset: 0; display: flex; overflow: hidden;
}
.sidebar {
  width: var(--sidebar-w); flex: 0 0 auto; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40; transition: transform .3s var(--ease);
}
.side-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 6px 18px; }
.brand { display: flex; flex-direction: column; gap: 3px; }
.brand-main { font-size: 12.5px; font-weight: 650; letter-spacing: .18em; color: var(--ink); }
.brand-sub { font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.side-head .icon-btn { display: none; }

.side-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); margin-bottom: 10px; box-shadow: var(--shadow-s);
}
.side-search span { font-size: 15px; opacity: .8; }
.side-search input { flex: 1; font-size: 13.5px; color: var(--ink); min-width: 0; }
.side-search input::placeholder { color: var(--muted); }

.new-doc {
  height: 38px; border-radius: 12px; margin-bottom: 10px;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 550;
  letter-spacing: .02em; box-shadow: var(--shadow-s);
  transition: transform .14s var(--ease), filter .2s;
}
.new-doc:active { transform: scale(.98); filter: brightness(.96); }
html[data-theme="dark"] .new-doc { color: #1E1E1C; }

.doc-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 4px; }
.doc-list::-webkit-scrollbar { width: 6px; }
.doc-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.doc-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 11px; font-size: 13.5px; color: var(--ink-soft);
  transition: background .16s;
}
.doc-item:hover { background: var(--surface); }
.doc-item.is-on { background: var(--surface); color: var(--ink); font-weight: 550; box-shadow: var(--shadow-s); }
.doc-item .di-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--connector); flex: 0 0 auto; }
.doc-item.is-on .di-dot { background: var(--accent); }
.doc-item .di-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .di-count { font-size: 11px; color: var(--muted); }
.doc-empty { padding: 18px 12px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.7; }

.side-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 8px;
}
.side-link { font-size: 12px; color: var(--muted); padding: 4px 2px; }
.side-link:hover { color: var(--accent-ink); }
.side-ver { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; opacity: .7; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg); }

/* ── 顶栏 ── */
.topbar {
  height: calc(54px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand-mobile { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  font-size: 15px; color: var(--ink-soft); transition: background .16s;
}
.icon-btn:hover { background: var(--surface-2); }
.only-touch { display: none; }

.view-switch {
  position: relative; display: flex; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.vs-btn {
  position: relative; z-index: 1; padding: 6px 14px; border-radius: 9px;
  font-size: 12.5px; color: var(--muted); letter-spacing: .02em;
  transition: color .2s var(--ease); white-space: nowrap;
}
.vs-btn.is-on { color: var(--ink); font-weight: 550; }
.vs-thumb {
  position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-s);
  transition: transform .26s var(--ease), width .26s var(--ease);
}
.save-pill {
  font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap;
  padding: 4px 9px; border-radius: 99px; border: 1px solid transparent;
}
.save-pill.is-saving { color: var(--accent-ink); border-color: var(--accent-soft); background: var(--accent-soft); }
.save-pill.is-local { color: var(--danger); border-color: var(--line); }
.save-pill.is-err { color: var(--danger); }

/* ── 多标签页 ── */
.tabs {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 8px 16px; overflow-x: auto; border-bottom: 1px solid var(--line);
  background: var(--bg-2); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 8px 12px; border-radius: 11px 11px 0 0; font-size: 12.5px; color: var(--muted);
  border: 1px solid transparent; border-bottom: none; transition: all .16s var(--ease);
  max-width: 190px;
}
.tab:hover { color: var(--ink-soft); background: var(--surface); }
.tab.is-on {
  color: var(--ink); background: var(--bg); border-color: var(--line);
  font-weight: 550; box-shadow: 0 -1px 0 var(--accent) inset;
}
.tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-x {
  width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center;
  font-size: 10px; color: var(--muted); opacity: 0; transition: opacity .16s, background .16s;
}
.tab:hover .tab-x, .tab.is-on .tab-x { opacity: 1; }
.tab-x:hover { background: var(--surface-2); color: var(--ink); }

/* ── 舞台 ── */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }

/* ═════════════ 大纲视图 ═════════════ */
.outline-wrap { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.outline-wrap::-webkit-scrollbar { width: 9px; }
.outline-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.outline-inner {
  max-width: 800px; margin: 0 auto;
  padding: 44px 32px calc(160px + env(safe-area-inset-bottom, 0px));
}
.doc-title {
  width: 100%; font-size: 30px; font-weight: 650; letter-spacing: -.01em;
  padding: 2px 8px 10px; color: var(--ink); border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.doc-title:focus { border-bottom-color: var(--line); }
.doc-title::placeholder { color: var(--muted); opacity: .6; }

.outline-tree { margin-top: 18px; }
.outline-tree ul { list-style: none; margin: 0; padding: 0; }
.outline-tree ul ul {
  margin-left: 9px; padding-left: 24px; border-left: 1px solid var(--guide);
}
.orow {
  display: flex; align-items: flex-start; gap: 3px; position: relative;
  padding: 3px 6px 3px 2px; border-radius: 9px; min-height: 34px;
  transition: background .14s;
}
.orow::before {
  content: ""; position: absolute; left: -24px; top: 22px; width: 22px; height: 1px;
  background: var(--guide);
}
.outline-tree > ul > li > .orow::before { display: none; }
.orow:hover { background: var(--surface); }
.orow.is-on { background: var(--accent-soft); }
.twist {
  width: 18px; height: 26px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 9px; color: var(--muted); padding: 0;
  transition: transform .18s var(--ease), color .16s;
  transform: rotate(90deg);
}
.twist.is-closed { transform: rotate(0deg); }
.twist.empty { visibility: hidden; }
.odot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--connector);
  flex: 0 0 auto; margin: 13px 6px 0 1px; transition: background .16s;
}
.orow.is-on .odot { background: var(--accent); }
.otext {
  flex: 1; min-width: 24px; font-size: 15.5px; line-height: 1.65; color: var(--ink);
  padding: 2px 2px; outline: none; word-break: break-word; white-space: pre-wrap;
  caret-color: var(--accent);
}
.otext:empty::before { content: "输入要点…"; color: var(--muted); opacity: .55; }
.obadge {
  flex: 0 0 auto; margin: 5px 2px 0 0; font-size: 10.5px; color: #fff;
  background: var(--accent); border-radius: 99px; padding: 2px 7px; line-height: 1.4;
}
.onote-dot { flex: 0 0 auto; margin: 7px 2px 0 0; font-size: 10px; color: var(--muted); }

.outline-add {
  margin: 22px 0 0 30px; font-size: 13px; color: var(--muted);
  padding: 7px 12px; border-radius: 9px; transition: all .16s;
}
.outline-add:hover { color: var(--accent-ink); background: var(--accent-soft); }

/* ═════════════ 思维导图 ═════════════ */
.map-wrap {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 24px 24px; background-position: 12px 12px;
}
.map-wrap.dragging { cursor: grabbing; }
.map-scene { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.map-links { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.map-nodes { position: absolute; inset: 0; }
.map-links path { fill: none; stroke: var(--connector); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.mnode {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border-radius: 999px; -webkit-user-select: none; user-select: none;
  cursor: pointer; transition: box-shadow .18s, background .18s, border-color .18s;
}
.mnode.lv1, .mnode.lv2 {
  padding: 9px 18px; font-size: 14.5px; background: var(--node); color: var(--node-text);
  border: 1px solid var(--node-border); box-shadow: var(--shadow-s);
}
.mnode.lv3 {
  padding: 5px 8px; font-size: 14px; color: var(--ink-soft); background: transparent;
}
.mnode.root {
  padding: 14px 30px; font-size: 17.5px; font-weight: 600; letter-spacing: .02em;
  background: var(--root); color: var(--root-text); box-shadow: var(--shadow-m);
}
.mnode:hover.lv1, .mnode:hover.lv2, .mnode:hover.root { box-shadow: var(--shadow-m); border-color: var(--accent); }
.mnode:hover.lv3 { background: var(--surface); }
.mnode.is-empty { color: var(--muted); font-style: italic; opacity: .8; }
.mnode .mbadge {
  font-size: 10.5px; line-height: 1.5; padding: 1px 6px; border-radius: 99px;
  background: var(--accent); color: #fff; font-weight: 500;
}
html[data-theme="dark"] .mnode .mbadge { color: #1E1E1C; }
.mnode .mnote { font-size: 10px; color: var(--muted); }

.map-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13.5px; color: var(--muted); pointer-events: none;
}
.map-ctrl {
  position: absolute; right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-m); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.map-ctrl button {
  width: 38px; height: 38px; border-radius: 11px; font-size: 15px; color: var(--ink-soft);
  display: grid; place-items: center; transition: background .16s, color .16s;
}
.map-ctrl button:hover { background: var(--surface-2); color: var(--ink); }
.map-hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  font-size: 11px; color: var(--muted); letter-spacing: .04em;
  padding: 6px 14px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 80%, transparent);
  pointer-events: none; opacity: .85; transition: opacity .4s;
}
.map-hint.hide { opacity: 0; }

/* ═════════════ 触屏节点工具条 ═════════════ */
.node-toolbar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-m); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  max-width: calc(100vw - 28px); overflow-x: auto; scrollbar-width: none;
}
.node-toolbar::-webkit-scrollbar { display: none; }
.nt-label {
  font-size: 11px; color: var(--muted); padding: 0 8px; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto;
}
.node-toolbar button {
  flex: 0 0 auto; height: 34px; padding: 0 10px; border-radius: 10px;
  font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; transition: background .16s;
}
.node-toolbar button:hover { background: var(--surface-2); color: var(--ink); }
.node-toolbar button.danger { color: var(--danger); }
.node-toolbar button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ═════════════ 节点画册抽屉 ═════════════ */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(430px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-l);
  transform: translateX(102%); transition: transform .32s var(--ease);
  padding-top: env(safe-area-inset-top, 0px);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-titlewrap { flex: 1; min-width: 0; }
.drawer-kicker {
  display: block; font-size: 10.5px; letter-spacing: .18em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 4px;
}
.drawer-title {
  width: 100%; font-size: 19px; font-weight: 600; color: var(--ink);
  padding: 2px 0; border-bottom: 1px solid transparent;
}
.drawer-title:focus { border-bottom-color: var(--accent); }
.drawer-title::placeholder { color: var(--muted); opacity: .6; }
.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px));
}
.field-label { font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.drawer-note {
  width: 100%; margin: 8px 0 18px; padding: 11px 13px; font-size: 13.5px; line-height: 1.7;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  resize: vertical; min-height: 62px; color: var(--ink);
}
.drawer-note::placeholder { color: var(--muted); opacity: .7; }
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.gallery-count { font-size: 11px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.gallery:empty { display: none; }
.gitem {
  position: relative; aspect-ratio: 1 / 1; border-radius: 13px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); cursor: zoom-in;
}
.gitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gitem .gdel {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(20, 18, 16, .55); color: #fff; font-size: 11px;
  display: grid; place-items: center; backdrop-filter: blur(6px); opacity: 0;
  transition: opacity .16s;
}
.gitem:hover .gdel { opacity: 1; }
.upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 12px; border: 1px dashed var(--connector);
  font-size: 13px; color: var(--accent-ink); background: var(--accent-soft);
  cursor: pointer; transition: filter .16s;
}
.upload-btn:active { filter: brightness(.97); }
.upload-btn.is-busy { opacity: .6; pointer-events: none; }
.upload-tip { font-size: 11px; color: var(--muted); text-align: center; margin: 8px 0 20px; }
.drawer-actions { display: flex; gap: 8px; }
.ghost-btn {
  flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft); background: var(--bg-2); transition: background .16s;
}
.ghost-btn:hover { background: var(--surface-2); }
.ghost-btn.danger { color: var(--danger); }

/* ═════════════ 全屏看图 ═════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(14, 13, 12, .94);
  display: flex; align-items: center; justify-content: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 64px calc(56px + env(safe-area-inset-bottom, 0px));
  animation: fade .22s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.lb-close, .lb-nav {
  position: absolute; color: #F4F2ED; background: rgba(255,255,255,.08);
  border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 17px; backdrop-filter: blur(8px); transition: background .16s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 26px; width: 46px; height: 46px; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-cap {
  position: absolute; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%); font-size: 11.5px; color: rgba(255,255,255,.7);
  letter-spacing: .04em;
}

/* ═════════════ Toast ═════════════ */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px); z-index: 400;
  padding: 10px 18px; border-radius: 99px; font-size: 12.5px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-l);
  opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.show { opacity: .96; transform: translateX(-50%) translateY(0); }

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 35; animation: fade .2s; }

/* ═════════════ 响应式（iPad / iPhone） ═════════════ */
@media (max-width: 900px) {
  .only-touch { display: inline-grid; }
  .brand-mobile { display: flex; }
  .topbar { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .vs-btn { padding: 6px 9px; font-size: 12px; }
  .save-pill { display: none; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-102%); box-shadow: var(--shadow-l);
  }
  .sidebar.is-open { transform: translateX(0); }
  .side-head .icon-btn { display: inline-grid; }
  .outline-inner { padding: 26px 16px calc(170px + env(safe-area-inset-bottom, 0px)); }
  .doc-title { font-size: 24px; }
  .otext { font-size: 16px; }   /* 避免 iOS 聚焦时整体放大 */
  .node-toolbar { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 10px; right: 10px; transform: none; }
  .nt-label { display: none; }
  .drawer { width: 100vw; }
  .poster-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand-mobile .brand-main { font-size: 11px; letter-spacing: .12em; }
  .tab { max-width: 140px; }
  .map-hint { display: none; }
}
