/* ==========================================================================
   半梦 · 网页客户端
   色板与 Android 端 Theme.kt 一致（典雅文学志 / Claude 风）
   ========================================================================== */
:root {
  /* 牛皮纸档案质感（暖牛皮底 + 轻漂白纸面 + 复古棕墨 + 印泥赤陶） */
  --bg: #DFCCA8;
  --bg-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.42 0 0 0 0 0.28 0 0 0 0 0.14 0 0 0 0.11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg-paper-layers:
    var(--bg-paper-grain),
    radial-gradient(ellipse at 50% 0%, rgba(255, 245, 224, .34), transparent 62%),
    radial-gradient(ellipse at 50% 100%, rgba(116, 78, 38, .16), transparent 68%),
    repeating-linear-gradient(0deg, rgba(112, 74, 36, .022) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #E5D4B3 0%, #DEC9A2 52%, #D7BF94 100%);
  --scene-veil: rgba(223, 204, 168, .88);
  --on-bg: #261A10;
  --surface: #EAE0C8;
  --surface-variant: #D5BE95;
  --on-surface: #3A2A1B;
  --on-surface-variant: #604730;
  --outline: #C1A478;
  --primary: #B4573B;
  --primary-deep: #8F3F28;
  --on-primary: #FDF7EE;
  --primary-text: var(--primary-deep);
  --primary-fill: var(--primary-deep);
  --tertiary: #3F7D70;
  --error: #9E3A26;

  /* 衬线回退链补 CJK 字形：Google Fonts 不可达时品牌字体不静默死亡（Finish Gate R4） */
  --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'Noto Serif CJK SC', 'STSong', 'SimSun', 'Times New Roman', serif;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* 设计令牌（2026-09-27 起，UI 重做用；新组件只许用这些，见 docs/design-contract.md）
     圆角两档 · 字阶四档 · 触控 44px。旧样式迁移时逐步改用，不一次性全替。 */
  --r-ctl: 8px;
  --r-card: 16px;
  --fs-page: 24px;
  --fs-title: 15px;
  --fs-body: 14px;
  --fs-meta: 12px;
  --tap: 44px;

  /* 气泡质感令牌（2026-10-09「美化功能有点少」→ 圆桌方向：**不动品牌色板，只做皮肤层**）。
     预设只改圆角 / 尾角 / 描边 / 字体这几个质感值，颜色仍全部走 --primary 与表面色——
     契约「质感变化只发生在皮肤层」允许，换主色那种会破坏「纸上养茧」调性的事不做。
     data-bubble 预设块与本文件的 .msg-bubble / .ta-bubble 规则接线；
     卷宗与梦信各一套圆角（卷宗 18px 大圆角、梦信 5px 微信式），互不串。 */
  --bub-r: 18px;
  --bub-tail: 6px;
  --bub-bw: 1px;
  --ta-r: 5px;
  --ta-tail: 2px;
  --bubble-font: var(--font-sans);
  /* 用户气泡底色令牌：默认实铺主色；素笺换成主色淡染的纸色 + 深字（对比度更好，
     也让「素笺」在默认皮肤里一眼可辨——只改圆角的话 18→14px 肉眼几乎分不出）。 */
  --bub-user-bg: var(--primary);
  --bub-user-color: var(--on-primary);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0A0C11;
    --bg-paper-grain: none;
    --bg-paper-layers: none;
    --scene-veil: rgba(10, 12, 17, .84);
    --on-bg: #F0EFEA;
    --surface: rgba(20, 24, 34, 0.5);
    --surface-variant: rgba(26, 32, 46, 0.62);
    --on-surface: #A5A8B0;
    --on-surface-variant: #6B6F7B;
    --outline: rgba(255, 255, 255, 0.08);
    --primary: #D98A72;
    --on-primary: #141413;
    /* 暗色下深色主色会糊进夜蓝黑底（#A0573B 只有 3.65:1）。两个语义 token
       回落到亮赤陶：压深底 7.29:1，黑字压亮赤陶底 6.87:1，都过 AA。 */
    --primary-text: #D98A72;
    --primary-fill: #D98A72;
    --error: #E08772;
  }
}
:root[data-theme="sakura"] {
  /* 奶油樱雾信笺（温柔粉米信纸 + 细玫瑰金线 + 梅子棕墨） */
  --bg: #F5E8EC;
  --bg-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.30 0 0 0 0 0.38 0 0 0 0.075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg-paper-layers:
    var(--bg-paper-grain),
    radial-gradient(ellipse at 20% 0%, rgba(255, 244, 248, .72), transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(212, 148, 168, .22), transparent 62%),
    linear-gradient(180deg, #FBF2F4 0%, #F5E7EC 55%, #EEDCE2 100%);
  --scene-veil: rgba(245, 232, 236, .89);
  --on-bg: #2E1D23;
  --surface: #FCF6F8;
  --surface-variant: #EEDAE1;
  --on-surface: #452E36;
  --on-surface-variant: #73535E;
  --outline: #DEC0CA;
  --primary: #C0637C;
  --primary-deep: #983F58;
  --on-primary: #FFF9FA;
  --primary-text: var(--primary-deep);
  --primary-fill: var(--primary-deep);
  --tertiary: #5B8C85;
  --error: #A63C4E;
}
:root[data-theme="huiming"] {
  /* 晦明护眼笺（借鉴类脑《晦明》：低刺眼暖米白 #F8F7F5 + 深炭灰墨 + 浓缩咖啡棕引语 + 零噪点零重阴影） */
  --bg: #F8F7F5;
  --bg-paper-grain: none;
  --bg-paper-layers: linear-gradient(180deg, #F9F8F6 0%, #F5F4F1 100%);
  --scene-veil: rgba(248, 247, 245, .94);
  --on-bg: #323135;
  --surface: #EFECE6;
  --surface-variant: #E4E1DA;
  --on-surface: #39383C;
  --on-surface-variant: #6B655E;
  --outline: rgba(77, 65, 55, 0.20);
  --primary: #6A3A1F;
  --primary-deep: #522B16;
  --on-primary: #FAF8F5;
  --primary-text: #6A3A1F;
  --primary-fill: #6A3A1F;
  --tertiary: #4A6F68;
  --error: #9B3829;
  --bub-user-bg: #6A3A1F;
  --bub-user-color: #FAF8F5;
}
:root[data-theme="moonlight"] {
  /* 月夜情书（深蓝丝绒夜色 + 暖烛金光 + 象牙纸墨字） */
  --bg: #111623;
  --bg-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.92 0 0 0 0 0.80 0 0 0 0 0.58 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg-paper-layers:
    var(--bg-paper-grain),
    radial-gradient(ellipse at 80% 6%, rgba(226, 180, 112, .16), transparent 44%),
    radial-gradient(ellipse at 15% 95%, rgba(114, 138, 198, .14), transparent 52%),
    linear-gradient(180deg, #161D2F 0%, #111623 55%, #0D111C 100%);
  --scene-veil: rgba(17, 22, 35, .86);
  --on-bg: #F3ECE0;
  --surface: rgba(26, 33, 52, 0.84);
  --surface-variant: rgba(36, 46, 72, 0.82);
  --on-surface: #DCD3C4;
  --on-surface-variant: #A79E90;
  --outline: rgba(223, 185, 124, 0.20);
  --primary: #DFB374;
  --primary-deep: #DFB374;
  --on-primary: #181410;
  --primary-text: #E6BF85;
  --primary-fill: #DFB374;
  --tertiary: #7CC2B5;
  --error: #E58778;
}
:root[data-theme="dark"] {
  --bg: #0A0C11;
  --bg-paper-grain: none;
  --bg-paper-layers: none;
  --scene-veil: rgba(10, 12, 17, .84);
  --on-bg: #F0EFEA;
  --surface: rgba(20, 24, 34, 0.5);
  --surface-variant: rgba(26, 32, 46, 0.62);
  --on-surface: #A5A8B0;
  --on-surface-variant: #6B6F7B;
  --outline: rgba(255, 255, 255, 0.08);
  --primary: #D98A72;
  --on-primary: #141413;
  --primary-text: #D98A72;
  --primary-fill: #D98A72;
  --error: #E08772;
}

/* ==========================================================================
   气泡质感预设（data-bubble / data-bubble-font，2026-10-09）

   纸信   = 默认：赤陶实底 + 白字 + 18px 圆角 + 尾角（卷宗）；梦信 5px 微信式 + 小尾巴
   素笺   = 主色淡染纸底 + 深字 + 大圆角 + 去描边去尾角：一张干净的信笺
   墨笺   = 纸底 + 赤陶细描边 + 深字 + 8px 方角：像写在裁齐的笺纸上（「墨」指墨线，不引入新色）
   三套是「实底 / 淡染 / 描边」三档填充，叠上方角差异——一眼可辨（第一版墨笺只改方角，
     用户原话「这三个主题我没看出来啥区别」，已重新设计）。淡染用 color-mix，
     旧 WebView 不识时回落实底主色，不会花屏。梦信同步收起素笺的尾巴箭头。
   所有颜色仍出自契约三色（暖纸 / 赤陶 / 夜蓝黑）与表面色，**没有新色**——
   2026-10-09 试过换主题色，五种饱和色铺在奶油纸底上很违和，已回退，教训记在这。
   预设集合与 profile.js 的 BUBBLE_STYLES 一一对应，guard-bubble-skins 钉防漂移。 */
:root[data-bubble="su"] {
  --bub-r: 14px; --bub-tail: 0px; --bub-bw: 0px; --ta-r: 10px; --ta-tail: 10px;
  --bub-user-bg: color-mix(in srgb, var(--primary) 14%, var(--surface));
  --bub-user-color: var(--on-bg);
}
:root[data-bubble="mo"] {
  --bub-r: 8px; --bub-tail: 0px; --bub-bw: 1px; --ta-r: 3px; --ta-tail: 3px;
  --bub-user-bg: var(--surface);
  --bub-user-color: var(--on-surface);
}
/* 素笺不要梦信的小尾巴箭头（圆角气泡上翘一根刺很怪）；墨笺保留（方角更像原版） */
:root[data-bubble="su"] .ta-msg .ta-bubble::after { display: none; }
/* 气泡字体：无衬线（默认）= 正文口吻；衬线 = 文学杂志感，文案类角色尤其贴 */
:root[data-bubble-font="serif"] { --bubble-font: var(--font-display); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 全局：滚动到顶/底不触发整页回弹（iOS 橡皮筋会让页面"滑滑的"） */
html, body { overscroll-behavior-y: contain; }

/* 文本选中色：灯火暖调（视觉升级 · 纸页与灯火） */
::selection { background: rgba(204, 120, 92, .28); }

/* 键盘可达性底线：所有可交互元素获得可见焦点环（Finish Gate R1） */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 手指 / 鼠标操作期间不画焦点环（部分国产浏览器把点按也当键盘焦点，每点一下冒一圈橙框——工单 2026-10-06）；
   键盘导航键一按就摘掉 .pointer-nav（modules/input-modality.js），键盘用户照常有环。
   !important：压过各处自写的 :focus-visible（plaza-card / art-preview 等，特异性更高）。 */
html.pointer-nav :focus,
html.pointer-nav :focus-visible { outline: none !important; }

/* ---------- 全局滚动条：与主题一致的细轨 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--outline) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--on-surface-variant); }
*::-webkit-scrollbar-corner { background: transparent; }
/* 横向滑动条（chips 等）整体隐藏，靠手势滑动 */
.chips::-webkit-scrollbar, .chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

html, body {
  height: 100%;
  width: 100%;
  max-width: 100vw;
}
/* 滚动锁：聊天/沉浸页锁死 document 滚动，键盘弹起不再把整页顶飞 */
html.lock-scroll, body.lock-scroll { overflow: hidden !important; height: 100%; overscroll-behavior: none; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: var(--bg-paper-layers);
  background-attachment: fixed;
  color: var(--on-bg);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

#root {
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
@supports not (height: 100dvh) {
  #root {
    height: 100vh;
    height: var(--app-height, 100vh);
  }
}

button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font-family: inherit; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px;
  padding: 12px 18px; min-height: 44px; font-size: 14px;
  background: var(--primary-fill); color: var(--on-primary);
  transition: opacity .15s ease;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline {
  background: transparent; color: var(--primary-text);
  border: 1px solid var(--primary-text);
}
.btn-ghost {
  background: transparent; color: var(--on-surface-variant);
  border: 1px solid var(--outline);
}
/* 小号按钮：只给"行内操作"用（编辑/删除/增删一行）。44px 是触摸下限，
   这里刻意压到 34px —— 它们成组出现在卡片底部，不是页面主操作 */
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 12.5px; border-radius: 7px; }
.btn-sm.danger { color: var(--error); border-color: var(--error); }

.field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px; color: var(--on-bg);
  outline: none;
}
.field:focus { border-color: var(--primary); }
.field::placeholder { color: var(--on-surface-variant); }

.mono-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--tertiary);
}

/* ---------- 过渡动效（页面切换/按压反馈/悬停） ---------- */
/* ⛔ fill-mode 必须是 backwards，不能是 both / forwards：
   both|forwards 会把终帧的 transform:none 当「动画值」永久留在元素上，computed 变成
   matrix(1,0,0,1,0,0)（≠ none）——该元素连同整棵子树从此常驻独立合成层。
   页节点（#app-body 的直接子元素；#/c/ 线程页就是 .thread-wrap）是全站最大的那一棵，
   被提升成合成层后，真机系统字体放大 / 键盘频繁开合时，安卓 WebView 会漏绘瓦片 →
   输入框那一行出现一条浅色横带（用户口中的「白线」，现象是「字被抹掉半行」）。
   backwards 只在动画开始前套起始帧、跑完不留任何样式；本组关键帧的终帧（opacity:1 /
   transform:none）与元素自然基态等价，所以入场观感完全不变。
   ⛔ 特异性提醒：这条是 (1,0,0)。想用 .thread-wrap{animation-fill-mode:backwards} 之类
      (0,1,0) 的选择器覆盖它**压不住**（跟先后顺序无关，2026-09-19 那次热修就死在这里）。
      要改就改这条，或下面第 2036 行那条 view-in 分组规则。 */
#app-body > * { animation: page-in .28s ease-out backwards; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.btn, .chip, .tile, .feat-card, .user-card, .vendor-tile {
  transition: transform .12s ease, box-shadow .16s ease,
              background-color .15s ease, border-color .15s ease, filter .12s ease;
}
.btn:active, .chip:active, .tile:active, .nav-btn:active,
.feat-card:active, .user-card:active, .vendor-tile:active {
  transform: scale(.97); filter: brightness(.92);
}
.card { transition: box-shadow .18s ease; }
@media (hover: hover) {
  .feat-card:hover, .user-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  #app-body > * { animation: none; }
  /* 卡片在 .stack 内层，需显式关闭入场与节奏动画 */
  .char-card, .char-banner { animation: none; }
}

/* 拉丁字标 LIMINAL */
.latin-wordmark {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--primary-text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 12px; padding: 18px 20px;
}

.hairline { border: none; border-top: 1px solid var(--outline); }

/* ---------- 登录页 ---------- */
.auth-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-logo {
  font-family: var(--font-display); font-size: 40px; font-weight: 600;
  margin-bottom: 6px;
}
.auth-sub { color: var(--on-surface-variant); font-size: 14px; margin-bottom: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-switch {
  margin-top: 20px; font-size: 13px; color: var(--on-surface-variant);
  background: none; border: none; text-decoration: underline;
}
.auth-error {
  color: var(--error); font-size: 13px; min-height: 18px; text-align: center;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 14px;
  color: var(--on-surface-variant);
  font-size: 11px; letter-spacing: .3em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--outline);
}
.auth-guest-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--primary-text);
  background: transparent;
  color: var(--primary-text);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .15s;
}
.auth-guest-btn:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.auth-guest-hint {
  font-size: 11px; color: var(--on-surface-variant);
  font-weight: 400; letter-spacing: .04em;
}

/* ---------- 应用布局 ---------- */
.app-shell {
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  display: flex; flex-direction: column;
  width: 100%;
  max-width: 980px; margin: 0 auto;
  min-width: 0;
  overflow-x: hidden;
  /* 显式定位上下文 + 层叠上下文：这两个原本是入场动画残留 transform 的副作用，摘掉后必须自己接管。
     - position: relative —— 大厅底栏等 absolute 后代以 shell 为包含块，
       锚定「屏幕可视区」而非滚动内容；
     - isolation: isolate —— 残留 transform 曾让 shell 顺带成为层叠上下文，壳内 z-index 与
       body 上挂的浮层（弹窗 / 悬浮球 / toast，全部挂在 document.body）之间的层叠顺序依赖它；
       isolate 只建层叠上下文、**不建合成层**，正好接住这条语义。
     ⛔ 别再给 shell 加 transform / will-change / filter：那会把整棵子树重新提升为常驻合成层，
       安卓 WebView 会漏绘瓦片（输入框白条）。详见文件上方「过渡动效」与第 2036 行两处注释。 */
  position: relative;
  isolation: isolate;
}
@media (min-width: 981px) {
  .app-shell {
    border-left: 1px solid var(--outline);
    border-right: 1px solid var(--outline);
    box-shadow: 0 0 42px rgba(68, 42, 16, .10);
  }
}
@media (display-mode: standalone) {
  #root, .app-shell {
    height: 100dvh;
    height: var(--app-height, 100dvh);
  }
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  /* 顶部安全区（刘海/灵动岛/PWA 全屏）：padding-top 并入 env，桌面端 env 为 0 无影响 */
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--outline);
}
/* 公告槽位：属于外壳，不属于某个页面。切 Tab 时横幅仍在，没公告时 :empty 自动收起。 */
.app-notice { flex: none; padding: calc(8px + env(safe-area-inset-top)) 18px 0; }
.app-notice.after-header { padding-top: 8px; }
.app-notice:empty { display: none; }
.app-notice .nt-banner { margin: 0; }
.app-shell.ta-mode .app-notice,
.app-shell.thread-mode .app-notice { display: none; }
.app-title {
  font-family: var(--font-display); font-size: 19px; font-weight: 500;
  display: flex; align-items: baseline; gap: 10px;
}
.app-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 18px; overscroll-behavior: contain; min-width: 0; }
/* 吸顶分段条（.wd-tabs / .cc-tabs，sticky top:-14px，实测高约 46px）会盖住滚动区顶部。
   给滚动区留出跳转余量：任何 scroll-into-view（焦点回移、代码里的 scrollIntoView、
   矮屏上"滚到这一章"）都会落在条子下面，而不是被条子压住。
   不支持的旧内核会忽略这一行 ⇒ 退回原行为，没有兼容风险。 */
.app-body { scroll-padding-top: 52px; }
/* App 壳质感：主滚动区保留滚动、隐藏滚动条（桌面端 Chrome 右侧那条细框即它）。
   只动主滚动容器，内层 .thread-scroll 等细样式滚动条保持原样。 */
#app-body, .app-body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#app-body::-webkit-scrollbar, .app-body::-webkit-scrollbar {
  display: none;
  width: 0 !important;
}
/* 对话页 thread 是满屏布局：app-body 去 padding，布局由 thread-wrap 全权接管。
   用 .body-thread（JS 挂载）而非 :has()——后者在旧 Safari 不支持会导致整体失效
   止血：线程页只留内层 .thread-scroll 可滚，锁死外层 #app-body 消除嵌套滚动抢夺 */
.app-body.body-thread { padding: 0; overflow: hidden; overscroll-behavior: none; }
.app-body.body-thread .thread-wrap { height: 100%; padding: 12px 14px 0; gap: 10px; }

.app-nav {
  display: flex; justify-content: space-around;
  border-top: 1px solid var(--outline);
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  background-color: var(--bg);
  background-image: var(--bg-paper-layers);
  background-attachment: fixed;
  flex-shrink: 0;
}
/* 软键盘弹出时隐藏底部导航（main.js initKbNavToggle 开关 body.kb-open）：
   否则 adjustResize 把文档流里的导航顶到键盘上方，挤压聊天输入区 */
body.kb-open .app-nav { display: none; }
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 48px;
  background: none; border: none;
  padding: 6px 0; color: var(--on-surface-variant);
  font-family: var(--font-display); font-size: 13px; letter-spacing: .12em;
}
.nav-btn { position: relative; }
.nav-btn.active { color: var(--primary-text); }
/* 底部「我的」标签上的未读红点（开发者批阅了我的反馈）；写法兼容 Chrome 70：不用 inset */
.nav-dot { position: absolute; top: 9px; left: 50%; margin-left: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--nt-urgent, #B3563E); }

/* ---------- 对话线程布局 ---------- */
.thread-wrap {
  display: flex; flex-direction: column; gap: 12px;
  height: 100%;
  min-height: 0;
}
.thread-wrap .thread-scroll { flex: 1 1 0%; min-height: 0; }
.thread-wrap .composer { position: relative; flex-shrink: 0; }
.thread-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: var(--outline) transparent;
  /* 内容底部留白：滚动到底的最后一条消息不被输入框压住 */
  /* 安卓 WebView 修复：确保内层可独立滚动，不被外层 SwipeRefresh 误判 */
}
.thread-scroll > * { margin-bottom: 0; }
.thread-scroll .thread { padding-bottom: 0; }
.thread-scroll .thread::after {
  content: '';
  display: block;
  height: 20px;
  /* ::after 占位不产生 margin 溢出，避免 Safari scrollHeight 多算导致滚动条残影 */
}
.thread-scroll::-webkit-scrollbar { width: 4px; }
.thread-scroll::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 999px; }
.thread-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- 列表/空态 ---------- */
.empty-hint {
  text-align: center; color: var(--on-surface-variant);
  font-size: 13px; padding: 28px 12px; line-height: 1.8;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 角色广场（独立页 · 2026-09-27 重做，与大厅 / 角色页同一套视觉） ----------
   页头 → 搜索 → 频道（横滑）→ 性别 + 标签（一行横滑）→ 计数 → 3:4 海报墙 → 加载更多 */
.plaza-page { display: flex; flex-direction: column; gap: 14px; padding-bottom: 80px; }
/* 版心（2026-10-15）：桌面端不再「手机页被拉满」，内容列居中 1040px */
@media (min-width: 900px) {
  .plaza-page { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .plaza-seg { max-width: 420px; }
}
/* 社区段的小标题与身份说明（官方段的 32px 大标题在社区段隐藏，首屏还给内容） */
.plaza-head-id { margin-top: 2px; font-size: 14px; color: var(--on-surface); }
.plaza-head--community .plaza-head-sub { margin-top: 4px; font-size: 13px; }
.plaza-head { padding-top: 2px; margin-bottom: 4px; }
.plaza-head-title {
  margin-top: 6px;
  font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--on-bg);
}
.plaza-head-sub { margin-top: 6px; font-size: 14px; color: var(--on-surface-variant); }

.plaza-toolbar { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.plaza-search-wrap { position: relative; display: flex; align-items: center; }
.plaza-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--on-surface-variant); pointer-events: none;
}
.field.plaza-search { padding-left: 40px; padding-right: 40px; border-radius: 999px; min-height: 44px; }
.plaza-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.plaza-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--surface-variant); color: var(--on-surface-variant);
  font-size: 12px; cursor: pointer;
}
.plaza-search-clear[hidden] { display: none; }

/* 横滑行：频道与标签共用 —— 贴边滚动，右侧渐隐提示还有 */
.plaza-category-bar, .plaza-tags {
  display: flex; gap: 8px; overflow-x: auto; min-width: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -20px; padding: 0 20px;
  scroll-padding: 0 20px;
}
@media (max-width: 767px) {
  .plaza-category-bar, .plaza-tags { margin: 0 -14px; padding: 0 14px; }
}
.plaza-category-bar::-webkit-scrollbar, .plaza-tags::-webkit-scrollbar { display: none; }
.plaza-cat-pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  /* 触达（2026-10-19）：原 38px，提到 44px。父级 `.plaza-category-bar` 是
     overflow-x:auto 的横滚容器（overflow-y 随之变 auto），::after 扩出来的
     命中面会被裁掉，所以只能真加高。 */
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface); color: var(--on-surface);
  font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.plaza-cat-pill.active { background: var(--on-bg); border-color: var(--on-bg); color: var(--bg); }
.plaza-cat-count { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }

/* ---------- 筛选面板（2026-10-02）----------
   性别 / 标签这两条二级轴从常驻工具条收进面板。每条轴各占一行、互不干扰，
   「全部」也不再出现两次（频道一个、性别一个，长得一模一样最容易看错）。
   面板默认收起：常驻只留「筛选」按钮，按钮上带已选条件数。 */
.plaza-toolrow { display: flex; align-items: center; gap: 8px; }
.plaza-spacer { flex: 1; min-width: 0; }
.plaza-filterbtn { display: inline-flex; align-items: center; gap: 5px; }
.plaza-fb-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--primary-fill); color: var(--on-primary);
  font-size: 11px; line-height: 17px; text-align: center;
}
.plaza-filterpanel {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border: 1px solid var(--outline);
  border-radius: var(--r-ctl); background: var(--surface-variant);
}
.plaza-filterpanel[hidden] { display: none; }
.plaza-fp-label { font-size: 12px; color: var(--on-surface-variant); }
.plaza-fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plaza-fp-hint { font-size: 11px; color: var(--on-surface-variant); }
.plaza-gender-seg {
  align-self: flex-start; display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--outline); border-radius: 999px; background: var(--surface);
}
.plaza-gender-btn {
  min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: none; color: var(--on-surface-variant);
  font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.plaza-gender-btn.active { background: var(--primary-deep, var(--primary)); color: var(--on-primary); }
.plaza-filterpanel .plaza-tags { margin-left: 0; padding-left: 0; }
.plaza-tags[hidden] { display: none; }
.plaza-tags .chip {
  flex-shrink: 0; min-height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; white-space: nowrap;
}
.plaza-tags .chip.active { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); color: var(--primary-text); }
.plaza-tag-n { font-size: 10px; opacity: .55; }

.plaza-counter {
  display: flex; align-items: center; justify-content: space-between; min-height: 32px;
  font-size: var(--fs-meta); color: var(--on-surface-variant);
}
.plaza-clear { min-height: 30px; padding: 0 12px; font-size: 12px; }
.plaza-clear[hidden] { display: none; }

.plaza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* 统一的 3:4 海报卡：position:relative 是修「收下」键飞到页面右上角的关键 */
.plaza-card {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  background: #1b1512;
  color: #fff; cursor: pointer;
  isolation: isolate;
}
@supports not (aspect-ratio: 1 / 1) { .plaza-card { height: 220px; } }
.plaza-card:active { transform: scale(.985); }
.plaza-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 卡片图位。2026-10-02 从 <img src="整张大图"> 改成 <div> + 缩略图 background：
   卡片图线上 61 张共 56MB（最大 2.58MB），整张挂 DOM 上会让中低端安卓的渲染进程
   被回收（工单 fb2447e2「部分图加载不出来 / 重叠」）。现在只挂几KB 的缩略图 data:。

   ⚠️ object-fit 只对 <img> 有效，<div> 的背景图必须靠 background-size/position。
   缩略图是按比例缩下来的一张图，尺寸和卡片不一致 —— 不写 cover 就会按原尺寸铺、右边露底色，
   看起来就是「图片错位」。这三行不能省。 */
.plaza-card-img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
}
/* 缩略图还没到的过渡态：铺底色 + 首字，不留空白。
   ⚠️ 这里只能用 background-color，不能用 background 简写 —— 简写会把上面
   background-size/position/repeat 一起重置回 auto/repeat/0% 0%（这个坑踩过：图铺成原尺寸、错位）。
   图铺上后由 JS 把首字 hidden 掉 —— 不用 CSS :has()，旧安卓 WebView 不支持。 */
.plaza-thumb-poster {
  display: flex; align-items: flex-start; justify-content: center; padding-top: 18%;
  background-color: #1b1512;
  background-image: linear-gradient(160deg, #6f4535 0%, #16110e 100%);
  font-family: var(--font-display); font-size: 72px; color: rgba(255, 255, 255, .18);
}
.plaza-thumb-ch { line-height: 1; }
.plaza-card-poster {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -2;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 18%;
  background: linear-gradient(160deg, #6f4535 0%, #16110e 100%);
  font-family: var(--font-display); font-size: 72px; color: rgba(255, 255, 255, .18);
}
.plaza-card-fade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0) 38%, rgba(10, 8, 6, .86) 100%);
}
.plaza-card-info {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.plaza-card-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plaza-card-nm {
  font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plaza-card-name.solo {
  font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.25;
}
.plaza-card-sep { display: none; }
.plaza-card-role {
  font-size: 11px; color: rgba(255, 255, 255, .78);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plaza-card-tagline {
  font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, .86);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chip.plaza-take {
  position: absolute; top: 10px; right: 10px;
  /* 触达（2026-10-15）：视觉仍是小胶囊（横幅卡上放 44px 会压图），命中面用 ::after 扩一圈到 ~44px */
  min-height: 34px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary);
  font-size: 12px; font-weight: 600;
}
.chip.plaza-take::after { content: ''; position: absolute; top: -5px; right: -5px; bottom: -5px; left: -5px; inset: -5px; border-radius: 999px; }
.chip.plaza-take.adopted, .chip.plaza-take:disabled {
  background: rgba(10, 8, 6, .55); color: rgba(255, 255, 255, .9); font-weight: 400; opacity: 1;
}
.plaza-empty {
  grid-column: 1 / -1; padding: 40px 16px; text-align: center;
  border: 1.5px dashed var(--outline); border-radius: var(--r-card);
  font-size: 15px; color: var(--on-bg);
}
.plaza-empty p + p { margin-top: 6px; }

.plaza-pager { display: flex; justify-content: center; }
.chip.plaza-more { min-height: var(--tap); padding: 0 24px; font-size: 13px; }
.plaza-end { font-size: 12px; color: var(--on-surface-variant); opacity: .7; padding: 6px 0; }

/* ---------- 角色广场：角色小传与人物档案抽屉 ---------- */
.plaza-detail-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 17, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade 0.2s ease-out;
}
.plaza-detail-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  background-color: var(--surface);
  background-image: var(--bg-paper-grain);
  border: 1px solid var(--outline);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(38, 24, 10, 0.36);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 640px) {
  .plaza-detail-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .plaza-detail-modal {
    max-width: 100%;
    max-height: 88vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .plaza-detail-overlay,
  .plaza-detail-modal {
    animation: none;
  }
}
.plaza-detail-hero {
  position: relative;
  width: 100%;
  height: 210px;
  flex-shrink: 0;
  overflow: hidden;
  background: #0d1017;
}
.plaza-detail-cover {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.plaza-detail-hero-fade {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: linear-gradient(
    to top,
    var(--bg) 0%,
    rgba(10, 12, 17, 0.85) 45%,
    rgba(10, 12, 17, 0.25) 75%,
    rgba(10, 12, 17, 0.45) 100%
  );
  pointer-events: none;
}
.plaza-detail-hero-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}
.plaza-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 12, 17, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.1s;
}
.plaza-detail-close:hover {
  background: rgba(10, 12, 17, 0.85);
}
.plaza-detail-close:active {
  transform: scale(0.92);
}
.plaza-detail-close-ghost {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--surface-variant);
  color: var(--on-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.plaza-detail-close-ghost:hover {
  background: var(--surface);
}
.plaza-detail-close-ghost:active {
  transform: scale(0.92);
}
.plaza-detail-art-zoom {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 12, 17, 0.6);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.1s;
}
.plaza-detail-art-zoom:hover {
  background: rgba(10, 12, 17, 0.85);
}
.plaza-detail-art-zoom:active {
  transform: scale(0.95);
}
.plaza-detail-hero-info {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plaza-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.plaza-detail-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  line-height: 1.3;
}
.plaza-detail-gender {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.plaza-detail-gender.male {
  background: rgba(56, 125, 240, 0.35);
  color: #a8cdfc;
  border: 1px solid rgba(56, 125, 240, 0.45);
}
.plaza-detail-gender.female {
  background: rgba(230, 80, 140, 0.35);
  color: #fcb1d0;
  border: 1px solid rgba(230, 80, 140, 0.45);
}
.plaza-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.plaza-detail-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.plaza-detail-noart-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--outline);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.plaza-detail-noart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plaza-detail-noart-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
}
.plaza-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  display: block;
}
.plaza-detail-body > * + * { margin-top: 14px; }
.plaza-detail-quote {
  padding: 10px 14px;
  border-left: 3px solid var(--primary);
  background: var(--surface-variant);
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--on-surface);
  font-style: italic;
  font-family: var(--font-serif, var(--font-display));
}
.plaza-detail-slot { display: block; }
.plaza-detail-slot > * + * { margin-top: 14px; }
.plaza-detail-sec { display: block; }
.plaza-detail-sec > * + * { margin-top: 6px; }
.plaza-detail-sec-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-text);
  letter-spacing: 0.5px;
}
.plaza-detail-sec-body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--on-surface);
  white-space: pre-wrap;
  word-break: break-word;
}
.plaza-detail-firstmes {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  display: block;
}
.plaza-detail-firstmes > * + * { margin-top: 6px; }
.plaza-firstmes-line {
  font-size: 13px;
  line-height: 1.75;
  color: var(--on-surface);
  word-break: break-word;
}
.plaza-firstmes-line.action {
  font-style: italic;
  color: var(--on-surface-variant);
  font-size: 12.5px;
}
.plaza-memory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plaza-memory-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(197, 160, 89, 0.12);
  color: var(--primary-text);
  border: 1px solid rgba(197, 160, 89, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plaza-detail-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--outline);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.plaza-detail-btn {
  min-height: 38px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
}

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; padding-top: 2px; }
.chip {
  white-space: nowrap;
  background: var(--surface-variant); color: var(--on-surface);
  border: 1px solid var(--outline); border-radius: 999px;
  padding: 7px 14px; font-size: 13px;
  /* 触达（2026-10-19）：`.chip` 原来约 33px 高，低于 44px 触控线。
     这里**直接加高**而不是用 ::after 扩命中面 —— 因为父级 `.chips` 是
     overflow-x:auto 的横滚容器，overflow-y 会被一并算成 auto，把 ::after
     上下扩出来的部分裁掉（实测只有下边生效、上边被裁）。 */
  min-height: 44px;
  display: inline-flex; align-items: center;
}
.chip.active { background: var(--primary-deep, var(--primary)); color: var(--on-primary); border-color: var(--primary-deep, var(--primary)); }
/* 「指令模式」标记（2026-10-23 工单 726bce3a）：快捷指令现在是一条要做的事、不是用户说的话。
   必须让用户看见 —— 点完指令模型忽然照着做了，否则会被当成角色抽风。
   主色描边 + 淡底，与 .chip.active 同一套语义色；点一下取消（退回普通发言）。 */
.chip--cmd {
  gap: 6px; padding: 4px 10px 4px 12px;
  background: var(--primary-container, var(--surface));
  border-color: var(--primary);
  color: var(--on-surface);
  align-self: flex-start;
}
.chip--cmd svg { color: var(--primary); flex: none; }
.chip-cmd-txt { font-weight: 600; }
.chip-cmd-x {
  font-size: 12px; line-height: 1; opacity: .6;
  padding: 4px 2px 4px 4px; margin-right: -2px;
}
.chip--cmd:active .chip-cmd-x { opacity: 1; }

/* ---------- 加载骨架屏（聊天卷宗：消息气泡占位） ---------- */
.skeleton-thread, .skeleton-hall {
  display: flex; flex-direction: column; gap: 14px;
  padding: 8px 0 16px; pointer-events: none;
}
.skeleton-hall .sk-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.skeleton-hall .sk-card {
  height: 216px; border-radius: 14px; border: 1px solid var(--outline);
  background: linear-gradient(160deg, var(--surface-variant), var(--surface));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.skeleton-hall .sk-avatar { width: 72px; height: 72px; border-radius: 50%; }
.skeleton-hall .sk-name { width: 60px; height: 12px; }
.sk-avatar, .sk-name, .sk-line, .sk-bubble {
  background: linear-gradient(90deg, var(--surface-variant) 25%, var(--surface) 37%, var(--surface-variant) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.sk-msg { display: flex; flex-direction: column; gap: 6px; max-width: 86%; }
.sk-msg.user { align-self: flex-end; align-items: flex-end; }
.sk-msg.assistant { align-self: flex-start; }
.sk-line { height: 14px; border-radius: 8px; }
.sk-bubble { border-radius: 14px; }
.sk-bubble.long { width: 78%; height: 34px; }
.sk-bubble.mid { width: 58%; height: 34px; }
.sk-bubble.short { width: 40%; height: 26px; }
.sk-bubble.user { background: color-mix(in srgb, var(--primary) 22%, var(--surface-variant)); }
.sk-name { width: 64px; height: 10px; }
@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-avatar, .sk-name, .sk-line, .sk-bubble { animation: none; }
}

/* ---------- 对话线程 ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 16px; }
/* 长卷宗的分页入口（窗口化渲染配套，见 chat.js 2026-09-27）。
   :empty 必须藏起来：.thread 是 gap:14px 的 flex 列，空占位会凭空多一道缝。 */
.thread-more:empty, .thread-win-end { display: none; }
.thread-more { display: flex; justify-content: center; align-items: center; }
.thread-more-btn { font-size: 12px; padding: 6px 14px; }
.thread-more-note { font-size: 11px; color: var(--on-surface-variant); opacity: .65; }
/* 整窗重画出来的气泡不走入场动画：一次滑窗 200 个节点同时 msg-in 既费帧又像整页在抖；
   真正新产生的消息（发送 / 收尾）不加这个类，入场动画照旧。 */
.msg-group.no-anim { animation: none; }
.msg-group { display: flex; flex-direction: column; gap: 6px; max-width: 86%; animation: msg-in .22s ease-out; }
.msg-live .msg-group { animation: none; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .msg-group { animation: none; }
}
.msg-group.user { align-self: flex-end; }
.msg-group.assistant { align-self: flex-start; }
.msg-role {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 2px; color: var(--on-surface-variant); opacity: .9;
}
.msg-role.user { color: var(--primary-text); text-align: right; }
.msg-bubble {
  font-family: var(--bubble-font);
  font-size: calc(15px * var(--chat-scale, 1)); line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  padding: 12px 16px; border-radius: var(--bub-r); border: var(--bub-bw) solid var(--outline);
  background: var(--surface); color: var(--on-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.msg-group.user .msg-bubble {
  background: var(--bub-user-bg); color: var(--bub-user-color); border-color: var(--primary);
  border-bottom-right-radius: var(--bub-tail);
  /* 一条消息拆成几段时，每段气泡各自贴着自己的文字、靠右；以前竖列里全被拉到最长那段的宽度（工单 7332d2da「跟着最下面那句的长短变化」） */
  align-self: flex-end;
}
.msg-group.assistant .msg-bubble {
  /* 纸感：纵向极淡的纸页明暗，替代平涂 */
  background: linear-gradient(180deg, var(--surface), var(--surface-variant));
  border-color: var(--outline);
  border-bottom-left-radius: var(--bub-tail);
}
.story-forum {
  max-width: 100%;
  width: min(100%, 34rem);
  min-width: 0;
  margin: 4px 0;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: calc(14px * var(--chat-scale, 1));
  line-height: 1.65;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.story-forum-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--outline);
  background: var(--surface-variant);
}
.story-forum-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: calc(17px * var(--chat-scale, 1));
  line-height: 1.4;
}
.story-forum-by {
  margin: 6px 0 0;
  color: var(--on-surface-variant);
  font-size: calc(12px * var(--chat-scale, 1));
}
.story-forum-body { margin: 0; padding: 14px 16px; }
.story-forum-replies { padding: 10px 16px 12px; border-top: 1px solid var(--outline); }
.story-forum-replies-title, .story-forum-reply-author {
  margin: 0;
  color: var(--primary-text);
  font-size: calc(12px * var(--chat-scale, 1));
  font-weight: 600;
}
.story-forum-reply { padding: 8px 0; }
.story-forum-reply + .story-forum-reply { border-top: 1px solid var(--outline); }
.story-forum-reply-text { margin: 2px 0 0; }
.story-forum-raw { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-math-inline { display: inline-block; max-width: 100%; white-space: nowrap; overflow-x: auto; vertical-align: middle; }
.chat-math-display { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
.chat-math-display .katex-display { margin: .5em 0; overflow: visible; }
.msg-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--on-surface-variant); opacity: .7;
  margin-top: 2px; padding: 0 4px;
}
.msg-group.user .msg-meta { text-align: right; }

/* ---------- 消息气泡快捷操作（重新生成 / 撤回重编 / 复制） ---------- */
.msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  padding: 0 4px;
  user-select: none;
  transition: opacity 0.15s;
}
.msg-group.user .msg-actions {
  justify-content: flex-end;
}
/* 仅最新消息默认展示；历史消息在 hover / 聚焦时显现，避免长列表过度杂乱 */
.msg-group:not(.is-latest) .msg-actions {
  opacity: 0;
  pointer-events: none;
}
.msg-group:not(.is-latest):hover .msg-actions,
.msg-group:not(.is-latest):focus-within .msg-actions {
  opacity: 0.85;
  pointer-events: auto;
}
.msg-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, sans-serif);
  font-size: 11px;
  color: var(--on-surface-variant);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 2px 7px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  /* 触达（2026-10-19 走查）：视觉仍是一行小字（实测 20px 高），但命中面用 ::after
     扩到 44px —— 这几个按钮里「撤回重编」会毁掉一条消息，点错代价太高。
     扩命中面而不撑视觉，是因为它们要跟气泡贴着排，撑开会把消息流撑散。
     20 + 8(上) + 16(下) = 44px。z-index 必须给：否则上方气泡的层叠顺序会压住
     向上扩的那 8px，命中面只剩下半边（实测 up=false / down=true）。 */
  position: relative;
  z-index: 1;
}
.msg-act-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -9px;
  bottom: -17px;
}
.msg-act-btn:hover {
  opacity: 1;
  color: var(--on-bg);
  background: var(--surface-variant);
  border-color: var(--outline);
}
.msg-act-btn:active {
  transform: scale(0.96);
}
.msg-act-btn.is-busy {
  pointer-events: none;
  opacity: 0.4;
}

/* ---------- 旁白场景块（对话/旁白分离渲染） ---------- */
.msg-live { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; }
.scene-block {
  width: 100%;
  padding: 1px 22px;
  text-align: center;
}
.scene-text {
  font-family: var(--font-display);
  font-size: calc(13px * var(--chat-scale, 1));
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--on-surface-variant);
  opacity: .85;
  white-space: pre-wrap;
  word-break: break-word;
}
.scene-text::before { content: "✦ "; font-style: normal; font-size: 9px; opacity: .5; vertical-align: 2px; }
/* 用户侧的旁白块（2026-09-25 工单「分不清括号里面和括号外面内容」）
   上面那套排版是给助手列（左对齐、整行居中像舞台提示）写的；用户列靠右，
   直接套用会让 TA 自己写的动作看起来像系统提示。这里只改对齐与留白，
   字号/字体/✦ 标记/透明度与助手侧保持一致——同一套约定要在两侧长成一个样子
   （曾试过再压一档 opacity .72，实测对比度掉到 2.56:1，比助手侧还淡，已回退）。 */
.msg-group.user .scene-block {
  width: auto;
  max-width: 100%;
  align-self: flex-end;
  padding: 0 6px 0 12px;
  text-align: right;
}
.msg-live-empty { min-height: 24px; display: block; }

.composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
  background: var(--bg);
  position: relative; bottom: auto; z-index: 2;
}
.composer textarea {
  flex: 1; resize: none;
  background: var(--surface);
  border: 1px solid var(--outline); border-radius: 20px;
  padding: 12px 16px; font-size: calc(15px * var(--chat-input-scale, 1)); line-height: 1.5; color: var(--on-bg);
  outline: none; min-height: 46px; max-height: 140px;
  transition: border-color .15s, box-shadow .15s;
  /* 输入框内不显示滚动条（内容超长时仍可滚动） */
  scrollbar-width: none;
}
.composer textarea::-webkit-scrollbar { display: none; }
.composer textarea::placeholder { color: var(--on-surface-variant); opacity: .55; }
.composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(204,120,92,.12); }
@supports (color: color-mix(in srgb, red 12%, transparent)) {
  .composer textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
}
.send-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--primary-fill); color: var(--on-primary); font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: transform .12s, opacity .15s;
}
.send-btn:active { transform: scale(.96); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }
.send-btn.is-stop { background: var(--on-surface-variant); }
.send-btn.is-advance {
  background: var(--surface-variant);
  color: var(--primary-text);
  border: 1px solid var(--outline);
  font-size: 15px;
  cursor: pointer;
  opacity: .9;
}
.send-btn.is-advance:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* ---------- 相遇大厅 · 案头续卷（Plan A 横滑微卡架） ---------- */
.hall-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ---------- 入梦世界书 ---------- */
.dream-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .dream-grid { grid-template-columns: 1fr 1fr; }
}
.dream-book-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.dream-book-head {
  display: flex;
  gap: 6px;
  align-items: center;
}
.dream-book-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.dream-book-tagline {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  line-height: 1.7;
}
.dream-book-meta {
  font-size: 11px;
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  letter-spacing: .05em;
}
/* 自己的书：一眼能从官方书里分出来（左边一道主色竖线 + 「我的」小签） */
.dream-book-mine { border-left: 3px solid var(--primary); }
.dream-book-ops {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}
/* 自定义入口卡：虚线边框，与"已经有的世界"区分开 */
.dream-book-new {
  border: 1px dashed var(--outline, rgba(128, 128, 128, .5));
  background: transparent;
}
/* 编辑器里的可增删行（NPC / 事件） */
.dream-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.dream-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-variant);
}
.dream-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dream-row-head .field { flex: 1; min-width: 0; }
.dream-row-head .chip { flex-shrink: 0; }
/* ---------- 入梦沉浸剧本流 ---------- */
/* ---------- 梦境会话（openDreamSession，2026-09-27 重做外观；IM 骨架不动） ----------
   整页是一个纵向 flex：顶栏 / 记忆条 / 剧本流（自己滚）/ 事件条 / 输入区（固定在底） */
.dream-stage { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; }
.dream-top { flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.dream-top-back {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--outline); background: var(--surface); color: var(--on-bg); cursor: pointer;
}
.dream-top-back:active { background: var(--surface-variant); }
.dream-top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dream-top-name {
  font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dream-top-act { font-size: 12px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dream-script {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1; min-height: 0; /* 覆盖 flex 子项的自动最小尺寸，允许收缩 */
  overflow-y: auto; /* 剧本流自身滚动——此前外溢出盒子，把输入区盖住 */
  padding: 6px 2px 8px;
  overscroll-behavior: contain;
}
.dream-line { font-size: calc(14px * var(--chat-scale, 1)); line-height: 1.8; }
/* 旁白 = 舞台指示：不带底框的衬线正文 */
.dream-line.narrator {
  font-family: var(--font-display); font-size: calc(15px * var(--chat-scale, 1)); line-height: 1.95;
  color: var(--on-surface);
  padding: 0 6px;
  white-space: pre-wrap;
}
.dream-line.narrator.dream-opening { color: var(--on-surface-variant); text-align: center; font-size: calc(14px * var(--chat-scale, 1)); padding: 24px 12px; }
.dream-line.narrator.pending { color: var(--on-surface-variant); letter-spacing: .3em; animation: dream-pulse 1.2s ease-in-out infinite; }
@keyframes dream-pulse { 50% { opacity: .35; } }
.dream-line.player { align-self: flex-end; max-width: 82%; }
.dream-line.player .dream-line-body {
  background: var(--primary-fill); color: var(--on-primary);
  border-radius: 18px 6px 18px 18px;
  padding: 10px 14px; white-space: pre-wrap;
}
.dream-line.npc { align-self: flex-start; max-width: 88%; display: flex; align-items: flex-start; gap: 8px; }
.dream-npc-avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-variant); border: 1px solid var(--outline);
  font-family: var(--font-display); font-size: 14px; color: var(--primary-text);
}
.dream-npc-main { min-width: 0; }
.dream-line.npc .dream-line-body {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: 6px 18px 18px 18px;
  padding: 10px 14px; white-space: pre-wrap;
}
.dream-line-label { font-size: 11px; color: var(--on-surface-variant); margin: 0 0 4px 2px; }
.dream-load-older {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 10px;
  border-bottom: 1px dashed var(--outline);
}
.dream-load-older-btn { min-height: 38px; padding: 7px 14px; font-size: 12px; }
.dream-load-older-note { margin-top: 4px; font-size: 10.5px; color: var(--on-surface-variant); }

.dream-event {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  max-height: 50vh; overflow-y: auto;
  padding: 10px 12px 12px; border-radius: var(--r-ctl);
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--outline));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--on-surface);
}
.dream-event[hidden] { display: none; }
.dream-event-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dream-event-toggle {
  width: 100%; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.dream-event-toggle:active { opacity: .72; }
.dream-event-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.dream-event-title {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0;
  font-size: 12.5px; font-weight: 600; color: var(--primary-text); overflow-wrap: anywhere;
}
.dream-event-toggle-label {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-size: 11px; color: var(--on-surface-variant); white-space: nowrap;
}
.dream-event-chev { transition: transform .16s ease; transform: rotate(90deg); }
.dream-event.is-collapsed { max-height: none; gap: 0; overflow: hidden; }
.dream-event.is-collapsed .dream-event-chev { transform: rotate(0deg); }
.dream-event.is-collapsed .dream-event-body { display: none; }
.dream-event-body { display: flex; flex-direction: column; gap: 8px; }
.dream-event-tip { font-size: 10.5px; color: var(--on-surface-variant); }
.dream-event-content { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--on-surface); }
.dream-event-choices { display: flex; flex-direction: column; gap: 6px; }
.dream-event-choice {
  width: 100%; min-height: 40px; padding: 7px 10px;
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  border: 1px solid var(--outline); border-radius: 10px;
  background: var(--bg); color: var(--on-surface); font: inherit; font-size: 12.5px; line-height: 1.5;
  cursor: pointer;
}
.dream-event-choice:active { background: var(--surface-variant); }
.dream-event-choice-n {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-fill); color: var(--on-primary); font-size: 11px; font-weight: 700;
}
.dream-event-choice-t { min-width: 0; }

/* 记忆折叠条：默认收起一行；展开体内部滚动（上限 40vh），不吃对话区 */
.dream-memory {
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--outline));
  border-radius: var(--r-ctl);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  padding: 0 14px;
}
.dream-memory summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px;
  cursor: pointer; list-style: none; user-select: none;
}
.dream-memory summary::-webkit-details-marker { display: none; }
.dream-memory-t { font-size: 13px; color: var(--primary-text); }
.dream-memory-chev { color: var(--primary-text); font-size: 16px; transition: transform .15s; }
.dream-memory[open] .dream-memory-chev { transform: rotate(90deg); }
.dream-memory-body {
  max-height: 40vh; overflow-y: auto;
  padding: 10px 0 12px;
  border-top: 1px dashed var(--outline);
  font-size: 13px; color: var(--on-surface); line-height: 1.8; white-space: pre-wrap;
}

/* 输入区固定在剧本流底部，不随内容滚走（IM 骨架） */
.dream-input {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--outline);
  padding-top: 10px;
}
/* 入梦输入区停到正文上方（2026-10-19，应用设置 → 外观与显示 → 入梦输入区）
   只换 .dream-stage 四段的 order 与分隔线方向：标题(0) → 输入(1) → 正文(2) → 事件卡(3)。
   键盘弹起时正文留在下方，能边看边写；默认仍是底部，靠 <html data-dream-input> 切换。 */
html[data-dream-input='top'] .dream-stage > .dream-input {
  order: 1;
  border-top: 0;
  border-bottom: 1px solid var(--outline);
  padding-top: 0;
  padding-bottom: 10px;
}
html[data-dream-input='top'] .dream-stage > .dream-script { order: 2; }
html[data-dream-input='top'] .dream-stage > .dream-event { order: 3; }
.dream-input-row { display: flex; align-items: flex-end; gap: 8px; }
.dream-input-field {
  flex: 1; min-width: 0; resize: none;
  min-height: 44px; max-height: 30vh; overflow-y: auto;
  padding: 11px 16px; border-radius: 22px;
  border: 1px solid var(--outline); background: var(--surface); color: var(--on-bg);
  font: inherit; font-size: calc(16px * var(--chat-input-scale, 1)); line-height: 1.5; outline: none;
}
.dream-input-field:focus { border-color: var(--primary); }
.dream-input-field::placeholder { color: var(--on-surface-variant); }
.dream-send {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: var(--primary-fill); color: var(--on-primary); cursor: pointer;
}
.dream-send:disabled { opacity: .5; }
.dream-send:active:not(:disabled) { transform: scale(.94); }
.dream-status { font-size: 12px; color: var(--error); min-height: 0; }
.dream-status:empty { display: none; }

/* ---------- 入梦玩家发图（2026-11-12 工单 a121cc3f） ---------- */.dream-img-btn {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--outline); background: var(--surface);
  color: var(--on-surface-variant); cursor: pointer;
}
.dream-img-btn:active { transform: scale(.94); }
.dream-img-preview { display: flex; align-items: flex-start; gap: 8px; padding: 6px 2px 0; }
.dream-img-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--outline);
}
.dream-img-remove {
  width: 20px; height: 20px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .28); color: #fff; cursor: pointer;
  margin-left: -14px; margin-top: -6px;
}
.dream-line-img {
  display: block; max-width: 240px; max-height: 240px;
  margin-top: 8px; border-radius: 10px; object-fit: cover;
}
@media (prefers-reduced-motion: reduce) {
  .dream-line.narrator.pending { animation: none; }
}

.char-card {
  position: relative; overflow: hidden;
  border-radius: 14px; /* 画框收紧，退后成框 */
  border: 1px solid var(--outline); cursor: pointer;
  background: linear-gradient(160deg, var(--surface-variant), var(--surface));
  transition: transform .18s ease, box-shadow .22s ease, border-color .18s ease;
  /* backwards：下面是 nth-child 阶梯延迟入场，both 会让每张卡都常驻一个合成层（几十张卡 = 几十个层） */
  animation: msg-in .28s ease-out backwards;
}

.char-card:hover {
  transform: translateY(-2px);
  border-color: rgba(204, 120, 92, .45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
}
.char-card:active { transform: scale(.985); }
.char-card-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background-size: cover; background-position: center 15%; }

.char-banner {
  position: relative; height: 128px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--outline); background: var(--surface-variant);
  animation: msg-in .3s ease-out;
}
.char-banner-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background-size: cover; background-position: center 20%; }
.char-banner-fade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg) 100%);
}
.char-banner.no-art .char-banner-fade { background: linear-gradient(160deg, var(--surface-variant), var(--surface)); }
.char-banner-info { position: absolute; left: 14px; right: 40px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.char-banner-info .char-banner-name-row { display: flex; align-items: baseline; gap: 8px; max-width: 100%; }
.char-banner-info strong { font-family: var(--font-display); font-size: 20px; letter-spacing: .03em; color: var(--on-bg); }
.char-banner-status { font-size: 11px; color: var(--tertiary); letter-spacing: .08em; }
.char-banner-recall {
  background: none; border: none; padding: 0;
  font-family: var(--font-display); font-size: 11px; letter-spacing: .06em;
  color: var(--on-surface-variant); cursor: pointer; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.char-banner-recall:hover { color: var(--primary-text); }

.cavatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background-size: cover; background-position: center 20%;
  border: 1px solid var(--outline);
  display: inline-flex; align-items: center; justify-content: center;
}
.cavatar.fallback {
  background: var(--surface-variant); color: var(--primary-text);
  font-family: var(--font-display); font-size: 15px;
}
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.msg-head.user { justify-content: flex-end; }

/* 立绘预览（2026-10-02 从 72×72 方框改成 3:4 大图）：
   原来那么小一块，站在那儿根本看不清 AI 画成了什么样，只能反复生成。
   现在按立绘本身的 3:4 竖构图铺满弹窗宽度，点一下还能开全屏 + 保存。 */
.art-preview {
  width: 100%; aspect-ratio: 3 / 4; max-width: 260px; border-radius: 14px; flex-shrink: 0;
  background-color: var(--surface-variant); background-size: cover; background-position: center 18%;
  border: 1px dashed var(--outline);
  display: block; padding: 0; cursor: zoom-in;
  position: relative; overflow: hidden;
}
.art-preview:disabled { cursor: default; opacity: .6; }
.art-preview:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 有图时提示「点得开」：靠 hover 提亮边框，不用图标（emoji 的 🔍 各平台长得都不一样，
   上一版挂在缩略图上就是因为这个被否掉了）。 */
.art-preview.has { border-style: solid; cursor: zoom-in; }
.art-preview.has:hover { border-color: var(--primary); }
@media (hover: hover) { .art-preview.has:hover { filter: brightness(1.06); } }
.art-preview.generating { border-style: solid; border-color: var(--primary); }
.art-preview.generating::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(204, 120, 92, .28) 50%, transparent 70%);
  animation: art-sweep 1.4s ease-in-out infinite;
}
@keyframes art-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .art-preview.generating::after { animation: none; }
}
.sec-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--tertiary);
  margin-bottom: 8px;
}
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.style-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px 11px; border-radius: 12px;
  background: var(--surface); border: 1.5px solid var(--outline);
  color: inherit; transition: border-color .15s ease, background-color .15s ease;
}
.style-tile.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-variant); }
.style-tile .st-icon { font-size: 22px; line-height: 1; }
.style-tile .st-label { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.style-tile .st-sub { font-size: 10.5px; color: var(--on-surface-variant); }

.chip.mini {
  padding: 3px 9px; font-size: 11px;
  background: rgba(10, 12, 17, .5); color: #fff;
  border-color: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.chip.mini.danger { color: #ffb4a0; }

/* VN 沉浸模式 */
.vn-wrap { gap: 0 !important; min-height: 0; }
.vn-stage {
  position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-variant), var(--surface));
  border: 1px solid var(--outline);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.vn-stage.has-art { background: #0d0f14; }
.vn-backdrop {
  position: absolute; top: -20px; right: -20px; bottom: -20px; left: -20px; inset: -20px;
  background-size: cover; background-position: center 15%;
  filter: blur(18px) brightness(.55); opacity: .8;
}
.vn-figure {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background-size: contain; background-repeat: no-repeat; background-position: center bottom;
  animation: msg-in .4s ease-out;
}
.vn-top {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 3;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.vn-top .chip { background: rgba(10, 12, 17, .45); color: #f0efea; border-color: rgba(255,255,255,.15); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.vn-top .chip.active { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }
.vn-top .mono-label { color: rgba(240,239,234,.75); }
.vn-box {
  position: relative; z-index: 2;
  margin: 12px; padding: 14px 16px 10px;
  border-radius: 14px;
  background: rgba(250, 249, 245, .88);
  border: 1px solid var(--outline);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  min-height: 120px;
  max-height: min(42vh, 380px);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
}
@supports (color: color-mix(in srgb, red 88%, transparent)) {
  .vn-box { background: color-mix(in srgb, var(--bg) 88%, transparent); }
}
.vn-box::-webkit-scrollbar { width: 4px; }
.vn-box::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 999px; }
.vn-box::-webkit-scrollbar-track { background: transparent; }
.vn-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vn-name-row .cavatar { width: 26px; height: 26px; font-size: 13px; }
.vn-nameplate { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--primary-text); }
.vn-nameplate.user { color: var(--tertiary); }
.vn-counter { font-family: var(--font-mono); font-size: 10px; color: var(--on-surface-variant); }
.vn-content { flex: 1; min-height: 0; font-size: calc(15px * var(--chat-scale, 1)); line-height: 1.8; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.vn-line { white-space: pre-wrap; word-break: break-word; }
.vn-line.error { color: var(--error); font-size: 13px; }
.vn-narr { font-family: var(--font-display); font-size: calc(13px * var(--chat-scale, 1)); letter-spacing: .04em; color: var(--on-surface-variant); margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.vn-steppers { display: flex; justify-content: space-between; }
.vn-steppers .chip { padding: 8px 14px; min-height: 36px; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .char-banner, .vn-figure { animation: none; }
}

.reply-waiting {
  color: var(--on-surface-variant);
  font-size: calc(14px * var(--chat-scale, 1));
  line-height: 1.6;
  padding-block: 4px;
}
.vn-wrap .reply-waiting { color: rgba(243, 239, 232, .7); }

.typing-dots::after {
  content: "▍";
  animation: blink 1s steps(2) infinite;
  color: var(--primary-text);
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .typing-dots::after { animation: none; }
}

/* ---------- 长按操作单 / Toast / 下拉刷新 ---------- */
.sheet-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 110;
  background: rgba(10, 12, 17, .4);
  animation: modal-fade .18s ease-out;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px;
  animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1.1);
}
/* 消息操作项会随版本增长（编辑 / 重生成 / 复制 / 选字 / 收藏 / 删除…）。
   键盘弹起或横屏短视口时允许菜单自己在可视区内滚动，避免最后几项被裁掉。 */
.msg-action-sheet {
  max-height: calc(100% - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-btn {
  border: none; background: none; text-align: left;
  padding: 14px 16px; min-height: 48px; border-radius: 10px;
  font-size: 15px; color: var(--on-bg);
}
.sheet-btn:active { background: var(--surface-variant); }
.sheet-btn.danger { color: var(--error); }
.sheet-btn.cancel {
  text-align: center; color: var(--on-surface-variant);
  border-top: 1px solid var(--outline); border-radius: 0;
}
.toast {
  position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); /* 2026-10-15：96→104，别压发布页的快捷条 */
  transform: translateX(-50%) translateY(8px);
  background: rgba(10, 12, 17, .85); color: #f0efea;
  /* 2026-10-20：left:50% 定位时盒子缩宽只能用到半屏，长提示被挤成四五行、999px 圆角再把它压成黑椭圆。
     改为按内容撑开、最宽到两侧各留 24px；圆角 18px（单行仍是胶囊，多行不变椭圆） */
  width: max-content; max-width: calc(100vw - 48px); text-align: center; text-wrap: balance;
  padding: 9px 18px; border-radius: 18px;
  /* 2026-11-13：原来 120，压在看图器（9999）/ 微信侧边闸门（10000）下面 ——
     从大图里点「保存」成功/失败都弹在这两层背后，用户看到的就是「点了完全没反应」。
     toast 是最终反馈，必须永远在最上层。 */
  font-size: 13px; z-index: 10050; pointer-events: none;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ---------- 上下文水位环：conic-gradient 圆环 + 中心镂空。
   --pct 由 JS 写入（0-100）；≥70% 琥珀、≥90% 红。token 越多，彩色弧越长，顺时针填满一圈 ---------- */
.ctx-ring {
  width: 24px; height: 24px; border-radius: 50%;
  flex-shrink: 0; cursor: pointer; position: relative;
  background: conic-gradient(var(--ctx-color, var(--primary)) calc(var(--pct, 0) * 1%), var(--outline) 0);
  transition: background .35s cubic-bezier(.4,0,.2,1);
}
.ctx-ring::after {
  content: ''; position: absolute; top: 3px; right: 3px; bottom: 3px; left: 3px; inset: 3px;
  border-radius: 50%; background: var(--bg);
}
/* 圆心读数：已知显示水位百分比数字，未知显示 ? */
.ctx-ring-txt {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 8px; line-height: 1;
  color: var(--on-surface-variant);
}
.ctx-ring.warn .ctx-ring-txt { color: #d97706; }
.ctx-ring.danger .ctx-ring-txt { color: var(--error); }
.ctx-ring.unknown { cursor: help; }
.ctx-ring.unknown .ctx-ring-txt { font-size: 11px; color: var(--on-surface-variant); }
.ctx-ring.warn { --ctx-color: #d97706; }
.ctx-ring.danger { --ctx-color: var(--error); }

/* 卷宗的手动存忆：文字保持轻，点击区域与输入框齐高。 */
.composer-weave {
  position: relative; flex: 0 0 32px; width: 32px; min-height: 46px; padding: 0;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--primary-text); font-family: var(--font-display);
  font-size: 13px; line-height: 1.4; white-space: nowrap; cursor: pointer;
}
/* 加号的热区向左伸出 3px，织的热区更多放在左侧，二者刚好相接。 */
.composer-weave::before { content: ''; position: absolute; inset: 0 -3px 0 -9px; }
.composer-weave:hover { background: var(--surface); }
.composer-weave:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.composer-weave:disabled { color: var(--on-surface-variant); cursor: wait; font-size: 11px; }
.vn-wrap .composer-weave { color: #f0a88c; }
.vn-wrap .composer-weave:hover { background: rgba(243, 239, 232, .06); }
.vn-wrap .composer-weave:disabled { color: rgba(243, 239, 232, .7); }
.ctx-capacity-hint {
  flex-shrink: 0; width: 100%; padding: 7px 12px;
  border: 0; background: var(--surface); color: var(--primary-text);
  text-align: left; font-size: 12px; cursor: pointer;
}
.ctx-capacity-hint[hidden] { display: none; }
.ctx-capacity-hint:focus-visible { outline: 2px solid var(--primary-text); outline-offset: -2px; }
.ctx-pop-context { margin-top: 12px; color: var(--on-bg); font-size: 12px; line-height: 1.6; }

/* ---------- 卷宗条数提醒条（modules/conv-capacity.js capacityBar，2026-10-24 工单 fd881fc3）----------
   输入栏上方一条：剩 ≤100 条时琥珀色提醒，写满（放不下一轮对话）换成红色 + 出路按钮。
   卷宗 / Ta / 梦信三处共用；沉浸舞台（.vn-wrap）压在深色背景上，单独调色。 */
.cap-bar {
  flex-shrink: 0; /* 卷宗 / Ta 的外层都是纵向 flex：别被正文挤扁 */
  position: relative; /* 右侧那颗「关掉」按绝对定位钉在角上，不占正文那一行 */
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 0 12px 6px; padding: 8px 34px 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #d97706 45%, var(--outline));
  background: color-mix(in srgb, #d97706 8%, var(--bg));
  color: var(--on-surface);
  font-size: 12px; line-height: 1.6;
}
.cap-bar[hidden] { display: none; }
.cap-bar.is-full {
  border-color: color-mix(in srgb, var(--error) 50%, var(--outline));
  background: color-mix(in srgb, var(--error) 8%, var(--bg));
}
.cap-bar-txt { flex: 1 1 200px; min-width: 0; }
.cap-bar-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.cap-bar-acts[hidden] { display: none; }
.cap-bar-btn {
  min-height: 32px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--outline); background: var(--surface); color: var(--on-bg);
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.cap-bar-btn:active { background: var(--surface-variant); }
/* 关掉这条提醒（2026-10-24 会员工单「希望提醒可以在看到以后关闭」）：
   卷写满后回看这一卷，这条提醒会一直贴着输入栏（400×512 视口下占 94px，可见聊天区的 18%），
   而它没有任何关闭入口。角上一颗 ×，只关当前这一档，记在本机（见 conv-capacity.js 文件头）。 */
.cap-bar-x {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--on-surface-variant); font-size: 18px; line-height: 1; cursor: pointer;
}
.cap-bar-x:active { background: var(--surface-variant); }
/* 免费次数快用完的提醒条（2026-10-25，economy.js quotaAdBar）：借 .cap-bar 的骨架，换成主色调，
   与「条数快满」的琥珀色区分；放在梦信 / 剧场版的覆盖规则之前，让那两处的配色照样生效 */
/* 边框写全：.cap-bar 的 border 用了 color-mix，Chrome 81/83 内核整条丢掉 ⇒ 只改 border-color 会没有边 */
.cap-bar.quota-bar { border: 1px solid rgba(204, 120, 92, .45); background: rgba(204, 120, 92, .08); }
.quota-bar .cap-bar-txt { flex-basis: 120px; } /* 一句话很短：360 宽也和按钮排在一行 */
.cap-bar-btn.quota-bar-go { background: var(--primary-fill); color: var(--on-primary); border-color: transparent; font-weight: 600; }
/* 梦信页（.wx-light）有自己的一套底色变量（--wx-*），跟着它走，不然深色主题下是一块暗条压在浅色聊天页上 */
.wx-light .cap-bar {
  margin: 6px 10px; color: var(--wx-text);
  background: color-mix(in srgb, #d97706 10%, var(--wx-bar));
}
.wx-light .cap-bar.is-full { background: color-mix(in srgb, var(--error) 10%, var(--wx-bar)); }
.vn-wrap .cap-bar { background: rgba(13, 15, 20, .82); color: rgba(243, 239, 232, .88); }
.wx-light .cap-bar-x { color: var(--wx-text); opacity: .6; }
.vn-wrap .cap-bar-x { color: rgba(243, 239, 232, .7); }
.vn-wrap .cap-bar-btn { background: rgba(255, 255, 255, .08); color: rgba(243, 239, 232, .92); border-color: rgba(255, 255, 255, .18); }
/* 「本卷记忆」弹窗里的条数进度（与上下文水位分开写：两个不是一个量） */
.ctx-pop-cap { margin-top: 10px; font-size: 12px; color: var(--on-surface-variant); line-height: 1.7; }
.ctx-pop-cap-bar { height: 4px; border-radius: 2px; background: var(--outline); overflow: hidden; margin-top: 4px; }
.ctx-pop-cap-fill { height: 100%; background: var(--primary); }
.ctx-pop-cap.warn .ctx-pop-cap-fill { background: #d97706; }
.ctx-pop-cap.danger .ctx-pop-cap-fill { background: var(--error); }

/* 圆环右侧的 token 消耗小字——不挤进圆心，圆环本职保持不变 */
.ctx-tokens {
  flex-shrink: 0;
  background: none; border: none; padding: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--on-surface-variant);
  letter-spacing: .02em;
  cursor: pointer;
  min-width: 28px;
  text-align: left;
}
.ctx-tokens:hover { color: var(--primary-text); }
.ctx-ring:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .ctx-ring { transition: none; }
}
/* ---------- 水位弹窗 ---------- */
.ctx-pop-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 90;
  background: rgba(10, 12, 17, .25);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 24px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  animation: overlay-in .15s ease-out backwards;
}
.ctx-pop {
  width: 100%; max-width: 360px;
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  animation: card-in .18s ease-out backwards;
}
/* 梦笔条目多时必须在卡片内部滚动。不能只写 dvh：Chrome 99 的壳内 WebView 不认，
   整条 max-height 会被丢掉，卡片从底部溢出到屏幕上方，手指也滚不动。 */
.ctx-pop.prose-pop {
  max-height: calc(100vh - 140px);
  max-height: calc(var(--vvh, 100vh) - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.ctx-pop-status {
  min-height: 18px; margin-top: 8px;
  font-size: 12px; color: var(--on-surface-variant);
  white-space: pre-wrap;
}
.ctx-pop-usage {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-variant);
  border-radius: 10px;
  border: 1px solid var(--outline);
}
.ctx-pop-usage-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--primary-text);
  margin-bottom: 8px;
}
.ctx-pop-usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
}
.ctx-pop-usage-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}
.ctx-pop-usage-cap {
  font-size: 10.5px;
  color: var(--on-surface-variant);
  margin-top: 2px;
  letter-spacing: .08em;
}
.ctx-pop-usage-split {
  display: flex; justify-content: space-around;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--outline);
  font-size: 11px;
  color: var(--on-surface-variant);
}
@media (prefers-reduced-motion: reduce) {
  .ctx-pop-overlay, .ctx-pop { animation: none; }
}

/* ---------- 页面与弹窗过渡（克制：淡入 + 轻位移，尊重系统减少动态） ---------- */
@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes card-in {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}
.app-shell, .conn-shell, .auth-wrap, .thread-wrap, .view-in {
  animation: view-in .22s ease-out backwards;
}
/* ⛔ 为什么这里是 backwards —— 2026-09-19「composerband」热修的教训：
   上一轮只把 fill-mode 改在 .thread-wrap 上（.thread-wrap{animation-fill-mode:backwards}），
   结果**完全无效**：页节点同时还命中文件上方 #app-body > * { animation: page-in … both }，
   那条特异性 (1,0,0) 压过 .thread-wrap 的 (0,1,0)，与先后顺序无关。实测该元素 computed 仍是
   matrix(1,0,0,1,0,0)、fill-mode 仍是 both —— 等于没修，线上照旧偶发白条
   （当时 --verify 只 grep 了「字符串在不在」，没量 computed，这是漏网的原因）。
   ⇒ 摘「常驻合成层」必须改**真正生效的那条规则**，改完要用脚本量 computed transform
     （scripts/guard-repaint.mjs），不能只 grep。
   ⇒ 新增任何入场动画时，若终帧（opacity:1 / transform:none）与元素自然基态一致，一律用 backwards。 */
/* 弹窗入场同理：终帧（opacity:1 / transform:none）与基态一致 → 一律 backwards。
   注：下面第 2096/2105 行还有一组同选择器的声明且更靠后，实际生效的是那一组；
   这里改成 backwards 是为了不给「常驻元素 + both」留下任何可被后人抄走的样本。 */
.modal-overlay { animation: overlay-in .15s ease-out backwards; }
.modal-card { animation: card-in .18s ease-out backwards; }
@media (prefers-reduced-motion: reduce) {
  .app-shell, .conn-shell, .auth-wrap, .thread-wrap, .view-in,
  .modal-overlay, .modal-card { animation: none; }
}

/* ---------- 梦茧页「破茧」入场：羁绊先落定，星屑如微尘次第浮现。
   仅 transform/opacity；子项阶梯延迟封顶 0.3s；reduced-motion 退为轻淡入 ---------- */
@keyframes cocoon-unfurl {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.cocoon-unfurl > * {
  /* backwards：阶梯延迟期间照样不可见（from 态），但跑完不留恒等 transform */
  animation: cocoon-unfurl .45s cubic-bezier(.16, 1, .3, 1) backwards;
}
.cocoon-unfurl > *:nth-child(2) { animation-delay: .06s; }
.cocoon-unfurl > *:nth-child(3) { animation-delay: .12s; }
.cocoon-unfurl > *:nth-child(4) { animation-delay: .18s; }
.cocoon-unfurl > *:nth-child(5) { animation-delay: .24s; }
.cocoon-unfurl > *:nth-child(n+6) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .cocoon-unfurl > * { animation-duration: .22s; animation-delay: 0s; }
}

.ptr-ind {
  height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-surface-variant); font-size: 12px; font-family: var(--font-mono);
  transition: height .2s ease;
}

/* ---------- 应用内弹窗 ---------- */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 17, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: modal-fade .18s ease-out;
}
.modal-card {
  width: 100%; max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  animation: modal-pop .2s cubic-bezier(.2, .9, .3, 1);
  max-height: 85vh;
  max-height: min(85vh, 85dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-card { animation: none; }
}
.modal-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  margin-bottom: 6px;
}
.modal-msg {
  font-size: 13.5px; line-height: 1.75;
  color: var(--on-surface);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-card .field { margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-btn { min-width: 76px; min-height: 44px; padding: 10px 16px; }
.modal-danger { background: var(--error); border-color: var(--error); }

/* 移动端：通用轻弹窗居中并自适应剩余高度，支持局部滚动避免软键盘遮挡操作按钮 */
@media (max-width: 767px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .modal-card {
    max-width: min(340px, calc(100vw - 32px));
    max-height: 80vh;
    max-height: min(80vh, 80dvh);
  }
}

/* ---------- 角色创建/编辑大弹窗（支持移动端抽屉与大表单顺滑滚动） ---------- */
.char-modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 17, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modal-fade .18s ease-out;
  overscroll-behavior: contain;
}
.char-modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: min(88vh, 760px);
  background: var(--bg);
  border: 1px solid var(--outline);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop .2s cubic-bezier(.2, .9, .3, 1);
}
.char-modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg);
}
.char-modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--on-bg);
}
.char-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all .15s ease;
}
.char-modal-close:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}
.char-modal-close:active {
  transform: scale(.92);
}
.char-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 20px 20px;
}
.char-modal-body .sec-label {
  margin-top: 14px;
  margin-bottom: 4px;
}
.char-modal-body .sec-label:first-child {
  margin-top: 0;
}
.char-modal-body .field {
  margin-top: 10px;
  touch-action: pan-y;
  overscroll-behavior-y: auto;
}
.char-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--bg);
}
@media (max-width: 640px) {
  .char-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .char-modal-card {
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
  }
  .char-modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  .char-modal-footer {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .char-modal-overlay, .char-modal-card { animation: none; }
}

/* ---------- 角色编辑器 v2（2026-09-27 反馈「完善角色时框太小」） ----------
   桌面：卡片加宽加高；手机：直接铺满可见区域（不再是 90vh 抽屉 + 键盘再吃掉一半）。 */
.char-modal-card { max-width: 680px; max-height: min(92vh, 960px); }
/* 底栏次要操作组：桌面不参与布局（保持原来一行），手机在下面的媒体查询里改成独占一行 */
.char-modal-secondary { display: contents; }
@media (max-width: 640px) {
  .char-modal-card {
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .char-modal-header { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .char-modal-body { padding: 0 16px 24px; }
  .char-modal-footer { padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .char-modal-footer { flex-wrap: wrap; gap: 8px; }
  .char-modal-footer .modal-btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
  .char-modal-footer > .modal-btn:last-child { flex: 1; }
  .char-modal-secondary { display: flex; flex: 0 0 100%; gap: 8px; }
  .char-modal-secondary .cm-ico { display: none; }
  @media (min-width: 361px) { .char-modal-secondary .cm-ico { display: inline; } }
  .char-modal-secondary .modal-btn { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
}
.char-modal-body { padding-top: 0; scroll-behavior: smooth; }

/* 分段条：粘在正文顶部，只做跳转 + 高亮 */
.cm-tabs {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 6px;
  margin: 0 -20px 4px; padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--outline);
}
@media (max-width: 640px) { .cm-tabs { margin: 0 -16px 4px; padding: 8px 16px; } }
.cm-tab {
  border: 1px solid var(--outline); background: var(--surface);
  color: var(--on-surface-variant);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cm-tab.on { background: var(--primary-fill); border-color: var(--primary-fill); color: var(--on-primary); }

.cm-form { gap: 0; margin-top: 0; }
.cm-sec { padding: 16px 0 8px; }
.cm-sec + .cm-sec { border-top: 1px dashed var(--outline); }
.char-modal-body .cm-sec > .sec-label { margin-top: 0; }

/* 头部：立绘与名字并排 */
.cm-hero { display: flex; gap: 14px; align-items: flex-start; }
.cm-hero-fields { flex: 1; min-width: 0; }
.cm-hero-fields .cf:first-child { margin-top: 0; }
/* 立绘区：预览占主位，「上传」缩成一条小按钮挂在旁边（2026-10-02）。
   以前预览被套在上传按钮里（嵌套 button，非法），点击全被上传抢走。 */
.cm-hero-art { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: 200px; flex-shrink: 0; }
.cm-art-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 12px; border: 1px dashed var(--outline);
  border-radius: 10px; background: none; color: var(--on-surface-variant);
  font: inherit; font-size: 13px; cursor: pointer;
}
.cm-art-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.cm-art-up { font-size: 14px; }
/* 没有立绘时，预览框本身提示「点这里上传」 */
.cm-hero-art .art-preview:not(.has) { cursor: pointer; }
.cm-hero-art .art-preview:not(.has)::before {
  content: "还没有立绘\A点这里上传"; white-space: pre;
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; line-height: 1.7; color: var(--on-surface-variant);
}
.cm-sec .chips { margin-top: 10px; }

/* 字段：标签在上、计数与「展开」在右 */
.cf { margin-top: 14px; }
.cf-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.cf-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--on-bg); }
.cf-count { font-size: 11px; color: var(--on-surface-variant); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-count.warn { color: var(--tertiary); }
.cf-count.full { color: var(--error); }
.cf-expand {
  border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--primary-text);
  padding: 4px 2px; margin: -4px 0;
}
.cf-hint { font-size: 11px; color: var(--on-surface-variant); margin-top: 4px; }
.cf-over { font-size: 11px; color: var(--tertiary); margin-top: 2px; }
.char-modal-body .cf .field { margin-top: 0; }
textarea.field { resize: vertical; line-height: 1.7; display: block; }
textarea.field.autogrow { resize: none; overflow-y: auto; max-height: 55vh; max-height: 55dvh; }

/* 「我在故事里」折叠段 */
.cm-fold > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: 10px;
}
.cm-fold > summary::-webkit-details-marker { display: none; }
.cm-fold > summary .sec-label { margin: 0; }
.cm-fold > summary::after {
  content: "›"; margin-left: auto; font-size: 18px; line-height: 1;
  color: var(--on-surface-variant); transition: transform .2s;
}
.cm-fold[open] > summary::after { transform: rotate(90deg); }
.cm-fold-sub { font-size: 12px; color: var(--on-surface-variant); }

/* 全屏写作面板 */
.cm-focus {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  background: var(--bg);
  animation: modal-fade .15s ease-out;
}
.cm-focus-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--outline);
}
.cm-focus-title { flex: 1; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--on-bg); }
.cm-focus-done { min-height: 36px; padding: 6px 18px; }
.cm-focus-input {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  border: 0; outline: none; resize: none;
  background: transparent; color: var(--on-bg);
  font-size: 16px; line-height: 1.85;
  padding: 16px;
}
.cm-focus-input::placeholder { color: var(--on-surface-variant); }
.cm-focus-note {
  font-size: 12px; color: var(--on-surface-variant);
  padding: 8px 16px; padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
}
.cm-focus-note:empty { display: none; }
.cm-focus-note.over { color: var(--tertiary); }
@media (prefers-reduced-motion: reduce) {
  .cm-focus { animation: none; }
  .char-modal-body { scroll-behavior: auto; }
}

/* ---------- 世界 ---------- */
.world-clock {
  text-align: center; padding: 22px;
  background: var(--surface-variant);
  border: 1px solid var(--outline); border-radius: 12px;
}
.world-day {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  color: var(--primary-text);
}
.world-time {
  font-family: var(--font-display); font-size: 42px; margin: 8px 0 6px;
}

/* ---------- 表单卡 ---------- */
.form-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* ---------- 设置页 ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; font-size: 14px;
}
.setting-group {
  background: var(--surface-variant);
  border: 1px solid var(--outline); border-radius: 12px;
  overflow: hidden;
}
.setting-group .setting-row + .setting-row { border-top: 1px solid var(--outline); }

/* 心动开关：粉渐变小爱心（纯爱模式的加料项） */
.heart-ic {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #ff9eb5 0%, #f43f6e 100%);
  box-shadow: 0 4px 12px rgba(244, 63, 110, .35);
}
.heart-row.on .heart-ic { animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.14); }
  24% { transform: scale(1); }
  36% { transform: scale(1.08); }
  48% { transform: scale(1); }
}
.heart-row .switch.on { background: linear-gradient(135deg, #ff7ba9, #f43f6e); }
.setting-row.heart-row.disabled { opacity: .6; }
/* 生日三段输入：年月日横排，各端长相一致（不用原生 date 控件） */
.bdate-row { display: flex; align-items: center; gap: 6px; }
.bdate-row .field { padding-left: 8px; padding-right: 8px; }
.bdate-unit { flex: none; font-size: 13px; color: var(--on-surface-variant); }
/* 心动确认弹窗：顶部粉光带 + 跳动大爱心 + 渐变确认钮 */
.modal-card.heart-modal { position: relative; overflow: hidden; border: none; padding: 26px 22px 20px; text-align: center; }
.modal-card.heart-modal::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 84px;
  background: linear-gradient(135deg, #ffe3ec 0%, #ffc9da 45%, #f6a9c6 100%);
}
.heart-modal-hero {
  position: relative; z-index: 1;
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #ff9eb5 0%, #f43f6e 100%);
  box-shadow: 0 10px 24px rgba(244, 63, 110, .45), 0 0 0 8px rgba(244, 63, 110, .12);
  animation: heartbeat 1.6s ease-in-out infinite;
}
.heart-modal-title { font-size: 18px; }
.heart-modal .modal-msg { font-size: 12.5px; }
.heart-modal .conn-label { justify-content: center; margin-top: 14px; }
.heart-modal .bdate-row .field { border-radius: 12px; padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
.heart-modal .modal-actions { justify-content: stretch; margin-top: 20px; }
.heart-modal .modal-actions .btn { flex: 1; }
.btn.heart-go {
  background: linear-gradient(135deg, #ff7ba9, #f43f6e);
  border: none; color: #fff;
  box-shadow: 0 6px 16px rgba(244, 63, 110, .4);
}
.btn.heart-go:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .heart-modal-hero { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .heart-row.on .heart-ic { animation: none; }
}

.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary-fill); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 26px;
  margin: 0 auto 12px;
}

/* ==========================================================================
   编辑连接（LLM 配置页）
   ========================================================================== */
.conn-header {
  display: flex; align-items: center; flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--outline);
}
.conn-back {
  width: 42px; height: 42px;
  background: none; border: none;
  font-size: 20px; color: var(--on-bg);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease;
}
.conn-back:hover, .conn-back:active {
  background: var(--surface-variant);
}
.conn-title {
  flex: 1; text-align: center;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  margin-right: 42px; /* 平衡左侧返回键宽度 */
}

.conn-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 20px 2px 8px;
  font-size: 13px; color: var(--on-bg);
}
.conn-hint { font-size: 11px; color: var(--on-surface-variant); }

.vendor-row {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vendor-row::-webkit-scrollbar { display: none; }
.vendor-tile {
  min-width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--outline); border-radius: 14px;
  padding: 13px 8px 11px;
  color: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.vendor-tile:hover {
  border-color: var(--primary);
  background: var(--surface-variant);
}
.vendor-tile.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: var(--surface-variant);
}
.vendor-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, .08);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.vendor-logo img {
  width: 22px; height: 22px;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
}
.vendor-name { font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--on-bg); }

/* ---- 滚动可见性提示（scanScrollHints）：边缘渐隐 + 细进度条，横竖通用 ---- */
.shint-host {
  position: relative;
}
.shint {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.shfade {
  position: absolute;
  opacity: 0;
  transition: opacity .15s ease;
}
.shfade.l { left: 0; top: 0; bottom: 0; width: 24px; background: linear-gradient(90deg, var(--bg) 15%, transparent); }
.shfade.r { right: 0; top: 0; bottom: 0; width: 24px; background: linear-gradient(270deg, var(--bg) 15%, transparent); }
.shfade.t { top: 0; left: 0; right: 0; height: 20px; background: linear-gradient(180deg, var(--bg) 15%, transparent); }
.shfade.b { bottom: 0; left: 0; right: 0; height: 20px; background: linear-gradient(0deg, var(--bg) 15%, transparent); }
.shfade.show { opacity: 1; }
.shrail {
  position: absolute;
  display: none;
  border-radius: 3px;
  background: var(--surface-variant);
}
.shrail.x { left: 6px; right: 6px; bottom: 2px; height: 3px; }
.shrail.y { top: 6px; bottom: 6px; right: 2px; width: 3px; }
.shint.has-x .shrail.x { display: block; }
.shint.has-y .shrail.y { display: block; }
.shthumb {
  position: absolute;
  border-radius: 3px;
  background: var(--on-surface-variant);
  opacity: .45;
}
.shrail.x .shthumb { top: 0; left: 0; height: 100%; min-width: 24px; }
.shrail.y .shthumb { left: 0; top: 0; width: 100%; min-height: 24px; }

.conn-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 14px;
  padding: 16px;
}

.input-wrap { position: relative; display: flex; }
.input-wrap .field { padding-right: 46px; }
.input-adorn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: var(--on-surface-variant); font-size: 15px;
  pointer-events: none;
}
button.input-adorn { pointer-events: auto; cursor: pointer; }

.warn-line {
  font-size: 12px; color: #C77E1F;
  margin-top: 10px; min-height: 16px;
}

.test-btn {
  width: 100%; justify-content: center;
  margin-top: 20px;
  background: transparent;
  border: 1.5px solid var(--primary-text); color: var(--primary-text);
}
.test-result {
  text-align: center;
  font-family: var(--font-mono); font-size: 12px;
  margin-top: 8px; min-height: 16px;
}

.conn-footer {
  display: flex; gap: 12px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
  background: var(--bg);
}

/* ==========================================================================
   全新设置页与 LLM 连接页样式（Notion / Apple 质感）
   ========================================================================== */

/* 设置分区小标题 */
.settings-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.5px;
  margin: 22px 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.settings-section-title:first-child {
  margin-top: 6px;
}

/* 设置卡片容器 */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}
.settings-card .setting-row + .setting-row,
.settings-card .settings-item + .settings-item,
.settings-card .setting-row + .settings-item,
.settings-card .settings-item + .setting-row,
.settings-card .setting-theme-row + .setting-row,
.settings-card .setting-row + .setting-theme-row {
  border-top: 1px solid var(--outline);
}

/* 主题分段选择行 */
.setting-theme-row {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setting-theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-bg);
}

/* 点击型设置行（关于、教程、导出、退出等） */
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: 14px;
  color: var(--on-bg);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.settings-item:hover {
  background: var(--surface-variant);
}
.settings-item:active {
  background: var(--surface-variant);
  opacity: 0.85;
}
.settings-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.settings-item-main {
  flex: 1;
  min-width: 0;
}
.settings-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-bg);
}
.settings-item-sub {
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-top: 2px;
  line-height: 1.45;
}
.settings-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--on-surface-variant);
  font-size: 13px;
  flex-shrink: 0;
}
.settings-item.danger .settings-item-title {
  color: var(--error);
}
.settings-item.danger .settings-item-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* LLM 连接页提示条 */
.conn-banner {
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin: 6px 0 16px;
}
.conn-banner-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary-text);
}

/* LLM 表单分组卡片 */
.conn-field-group {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 8px;
}
.conn-field-row {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  min-height: 52px;
  gap: 12px;
}
.conn-field-row + .conn-field-row {
  border-top: 1px solid var(--outline);
}
.conn-field-label {
  width: 76px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
}
.conn-field-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
}
.conn-field-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 15px;
  color: var(--on-bg);
  outline: none;
  font-family: inherit;
}
.conn-field-input::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.5;
}
.conn-field-adorn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
}
button.conn-field-adorn {
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
button.conn-field-adorn:hover {
  background: var(--surface-variant);
  color: var(--on-bg);
}

/* 模型管理卡片 */
.conn-model-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 8px;
}
.conn-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conn-model-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-bg);
}
.conn-model-sub {
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-top: 2px;
}
.conn-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary-text);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-model-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 连通性测试卡片 */
.conn-test-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.conn-test-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conn-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--primary-text);
  background: transparent;
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.conn-test-btn:hover {
  background: var(--surface-variant);
}
.conn-test-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.conn-test-pill {
  font-size: 12px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
}

/* 安全隐私说明条 */
.conn-security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin: 14px 4px 10px;
  opacity: 0.85;
}
.conn-security-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--on-surface-variant);
}

/* 底部文学寄语页脚 */
.profile-quote-foot {
  text-align: center; margin-top: 20px; padding: 0 16px 8px;
}
.profile-quote-text {
  font-size: 12px; color: var(--on-surface-variant); opacity: .7; letter-spacing: .04em;
}
.profile-quote-ver {
  font-family: var(--font-mono); font-size: 11px; color: var(--on-surface-variant); opacity: .45; margin-top: 4px;
}

/* 性别徽标：极简素雅微标签，与字标和暗色/亮色背景协调 */
.gender-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  border: 1px solid var(--outline);
  line-height: 1.4;
  letter-spacing: .02em;
  vertical-align: middle;
}

/* ---------- 组件库 · ui-*（js/modules/ui-kit.js；2026-09-27 起） ----------
   只吃令牌。分组 = 小标题 + 一张卡；行 ≥ 56px 高、整行可点；数字条 = 一张卡里横排。 */
.ui-group { display: flex; flex-direction: column; gap: 8px; }
.ui-group-title {
  font-size: var(--fs-meta); font-weight: 500;
  color: var(--on-surface-variant);
  letter-spacing: .06em;
  padding: 0 4px;
}
.ui-group-body {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.ui-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px;
  padding: 10px 16px;
  background: none; border: 0; text-align: left;
  font: inherit; color: var(--on-bg);
  -webkit-user-select: none; user-select: none;
}
button.ui-row, summary.ui-row { cursor: pointer; transition: background-color .12s ease; }
button.ui-row:active, summary.ui-row:active { background: var(--surface-variant); }
@media (hover: hover) {
  button.ui-row:hover, summary.ui-row:hover { background: var(--surface-variant); }
}
.ui-row + .ui-row { border-top: 1px solid var(--outline); }
.ui-row-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-ctl);
  background: var(--surface-variant);
  color: var(--on-surface);
}
.ui-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ui-row-title { font-size: var(--fs-title); font-weight: 500; line-height: 1.35; }
.ui-row-sub {
  font-size: var(--fs-meta); color: var(--on-surface-variant); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ui-row-value {
  flex-shrink: 0; max-width: 40%;
  font-size: 13px; color: var(--on-surface-variant);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 值太长时允许折成两行（2026-10-23）：免费模型通道那行的值现在是
   「MiniMax 系列 · M3.1（半梦特调）」，单行 40% 宽度会被截成「MiniMax 系列 · M…」——
   等于没说当前在哪个档，而这行的全部意义就是让人不点进去也知道选的是哪个。
   宽度只放到 46%：58% 会把左边的「免费模型通道」挤到折行（实测过，更丑）。
   `keep-all` 让中文不被从中间劈开（否则会断成「半梦特 / 调」），只在「 · 」处折。 */
.ui-row-value.wrap {
  max-width: 46%; white-space: normal; text-align: right; line-height: 1.35;
  word-break: keep-all; overflow-wrap: break-word;
}
.ui-row-chev { flex-shrink: 0; display: flex; color: var(--on-surface-variant); opacity: .7; margin-right: -4px; }
.ui-row.danger .ui-row-title, .ui-row.danger .ui-row-icon { color: var(--error); }

.ui-stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.ui-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 64px; padding: 12px 4px;
  background: none; border: 0; font: inherit; color: var(--on-bg);
  justify-content: center;
}
.ui-stat + .ui-stat { border-left: 1px solid var(--outline); }
button.ui-stat { cursor: pointer; transition: background-color .12s ease; }
button.ui-stat:active { background: var(--surface-variant); }
.ui-stat-num {
  font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ui-stat-label { font-size: 11px; color: var(--on-surface-variant); letter-spacing: .04em; }

/* 骨架占位：与真实版面同形，数据回来不跳版 */
.me-skel {
  display: block;
  background: linear-gradient(90deg, var(--surface-variant) 0%, var(--surface) 50%, var(--surface-variant) 100%);
  background-size: 200% 100%;
  animation: me-skel 1.2s ease-in-out infinite;
  border-radius: var(--r-ctl);
}
@keyframes me-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- 我的页 v3（整页重塑 · 2026-10-23） ----------
   扉页讲你是谁（大字名字、人设引语、四个数字），下半是能做的事。
   v3 的三件事：
   ① 层级更硬 —— 姓名是本页唯一的重音，其余一律降级；
   ② 可点的地方看得出来 —— 头像行给一枚安静的箭头，行/数字带补 hover 反馈；
   ③ 材质统一 —— 全页只有纸面（--surface）+ 一道描边（--outline）+ 一个赤陶重音。
      原先那块深色石块（会员卡）已改成纸面笺，见下方 .mc-* 段。
   class 名一律沿用 v2 —— guard-member-badge / guard-back-nav / profile-check 都指着它们。 */
.me-shell #app-body { padding: 0; }
.me-page { display: flex; flex-direction: column; min-height: 100%; }

.me-hero {
  padding: calc(22px + env(safe-area-inset-top)) 20px 0;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--outline);
}
.me-hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.me-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  color: var(--primary-text);
}
.me-edit {
  border: 1px solid var(--outline); background: var(--bg);
  color: var(--on-surface); font: inherit; font-size: var(--fs-meta);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  /* 触达（2026-10-19）：视觉 31px 的胶囊，页面右上角孤立按钮，
     直接长到 44px 也不会挤到别人（旁边只有留白）。 */
  min-height: 44px;
  display: inline-flex; align-items: center;
  transition: border-color .15s ease, background-color .15s ease;
}
.me-edit:hover { border-color: var(--primary); }
.me-edit:active { background: var(--surface-variant); }

.me-id {
  display: flex; align-items: center; gap: 16px;
  width: 100%; margin-top: 20px; padding: 0;
  border: 0; background: none; text-align: left; font: inherit; color: var(--on-bg);
  cursor: pointer;
}
.me-avatar {
  width: 80px; height: 80px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-variant) center / cover no-repeat;
  border: 1px solid var(--outline);
  font-family: var(--font-display); font-size: 30px; color: var(--on-surface-variant);
  transition: border-color .15s ease;
}
/* 可点暗示：头像描边亮一圈 + 右侧一枚安静的箭头（不抢姓名的重音） */
.me-id:hover .me-avatar { border-color: var(--primary); }
.me-id-go {
  flex: none; align-self: center;
  color: var(--on-surface-variant); opacity: .45; font-size: 20px; line-height: 1;
}
.me-id-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.me-name {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.15;
  letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-tags { display: flex; align-items: center; gap: 6px; min-width: 0; }
.me-tag {
  flex-shrink: 0;
  font-size: 11px; line-height: 1.6; padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-variant); color: var(--on-surface-variant);
}
/* 会员徽标：旧 WebView 不认 color-mix ⇒ 先给实底再覆盖 */
.me-tag.accent { background: var(--surface-variant); color: var(--primary-text); }
@supports (background: color-mix(in srgb, var(--primary) 14%, transparent)) {
  .me-tag.accent { background: color-mix(in srgb, var(--primary) 14%, transparent); }
}
.me-mail {
  min-width: 0; font-size: var(--fs-meta); color: var(--on-surface-variant);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 人设引语：茧丝竖线（本页唯一的装饰手势）
   2026-10-23：改成一段一行（最多三行，各自带省略号），不再用「 · 」把三段拦腰连断。 */
.me-quote {
  display: block; width: 100%; margin-top: 20px;
  padding: 2px 0 2px 14px;
  border: 0; border-left: 3px solid var(--primary);
  background: none; text-align: left; cursor: pointer;
  font-family: var(--font-display); font-size: 16px; line-height: 1.7;
  color: var(--on-surface);
}
.me-quote-line { display: block; }
.me-quote-line + .me-quote-line { margin-top: 2px; }
.me-quote.empty { color: var(--primary-text); }

.me-numbers {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 24px -20px 0;
  border-top: 1px solid var(--outline);
}
.me-num {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 0 18px;
  border: 0; background: none; font: inherit; color: var(--on-bg); cursor: pointer;
  transition: background-color .15s ease;
}
.me-num + .me-num { border-left: 1px solid var(--outline); }
.me-num:hover, .me-num:active { background: var(--surface-variant); }
.me-num-n {
  font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.me-num-l { font-size: 11px; letter-spacing: .12em; color: var(--on-surface-variant); }

/* 冷启动：四个数字全是 0 时，给一句人话 + 一个主操作（契约 Finish Gate 第一问：
   新用户首屏能否识别对象与主操作？）。有内容时这一行不出现。 */
.me-first {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-card);
}
.me-first-main { flex: 1; min-width: 0; }
.me-first-t { font-size: var(--fs-title); font-weight: 500; color: var(--on-bg); }
.me-first-s { margin-top: 3px; font-size: var(--fs-meta); color: var(--on-surface-variant); line-height: 1.5; }
.me-first .btn { flex: none; }

.me-sections { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 8px; }

/* 入场错峰（2026-10-23）：
   手法照抄梦茧页的 .cocoon-unfurl（nth-child 逐级 delay），但契约写死「入场 stagger ≤0.2s」
   ⇒ 这里的 delay 封顶 .2s、每段 .26s。
   ⚠️ fill-mode 只能用 backwards：both/forwards 会把终帧 transform:none 留成常驻合成层，
      安卓 WebView 在键盘开合时会漏绘出一条白线（app.css 顶部有完整记录，guard-repaint 守这条）。 */
@keyframes me-rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
.me-hero-top, .me-id, .me-quote, .me-numbers { animation: me-rise .26s cubic-bezier(.16, 1, .3, 1) backwards; }
.me-hero-top { animation-delay: 0s; }
.me-id { animation-delay: .05s; }
.me-quote { animation-delay: .1s; }
.me-numbers { animation-delay: .15s; }
.me-sections > * { animation: me-rise .26s cubic-bezier(.16, 1, .3, 1) backwards; }
.me-sections > *:nth-child(1) { animation-delay: .04s; }
.me-sections > *:nth-child(2) { animation-delay: .08s; }
.me-sections > *:nth-child(3) { animation-delay: .12s; }
.me-sections > *:nth-child(4) { animation-delay: .16s; }
.me-sections > *:nth-child(n + 5) { animation-delay: .2s; }

/* 字数：一个大数字当题眼 */
.me-words {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.me-words > summary {
  list-style: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 18px 16px;
}
.me-words > summary::-webkit-details-marker { display: none; }
.me-words-kicker { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.me-words-big { display: flex; align-items: baseline; gap: 2px; }
.me-words-n {
  font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1.1;
  color: var(--on-bg); font-variant-numeric: tabular-nums;
}
.me-words-u { font-family: var(--font-display); font-size: 17px; color: var(--on-surface); }
.me-words-sub {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-meta); color: var(--on-surface-variant);
}
.me-words-more { margin-left: auto; color: var(--primary-text); }
.me-words-more::after { content: " ›"; display: inline-block; transition: transform .2s ease; }
.me-words[open] .me-words-more::after { transform: rotate(90deg); }
.me-words-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--outline);
}
.me-words-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; }
.me-words-cell:nth-child(n + 4) { border-top: 1px solid var(--outline); }
.me-words-cell:not(:nth-child(3n + 1)) { border-left: 1px solid var(--outline); }
.me-words-cell-n { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.me-words-cell-l { font-size: 11px; color: var(--on-surface-variant); }

/* ---------- 星尘织茧榜：卡片 + 榜单页 ---------- */
.dust-medal {
  width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--primary-text);
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 60px color-mix(in srgb, var(--primary) 12%, transparent);
  font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--primary-text);
}
.dust-medal.lg { width: 88px; height: 88px; font-size: 38px; border-width: 2px; box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 80px color-mix(in srgb, var(--primary) 12%, transparent); }
.dust-bar {
  display: block; height: 4px; border-radius: 2px;
  background: var(--surface-variant); overflow: hidden;
}
.dust-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--primary); }

.dust-card {
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--outline));
  border-radius: var(--r-card);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--surface)) 0%, var(--surface) 60%);
  overflow: hidden;
}
.dust-card-main {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 18px 14px 16px 16px;
  border: 0; background: none; text-align: left; font: inherit; color: var(--on-bg); cursor: pointer;
}
.dust-card-main:active { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.dust-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dust-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--primary-text); }
.dust-tier { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.3; }
.dust-card-body .dust-bar { margin-top: 4px; }
.dust-next { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.dust-rank { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.dust-rank b { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--on-bg); }
.dust-rank small { font-size: 11px; color: var(--on-surface-variant); margin-top: 4px; }
.dust-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 16px;
  border-top: 1px dashed color-mix(in srgb, var(--primary) 30%, var(--outline));
}
.dust-foot-stat { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.dust-cta {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.dust-cta:active { opacity: .85; }

.app-body.dust-page { padding: 0; }
.dust-wrap { display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 28px; max-width: 560px; margin: 0 auto; }
.dust-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 28px 20px 22px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--outline));
  border-radius: var(--r-card);
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--primary) 10%, var(--surface)) 0%, var(--surface) 70%);
}
.dust-hero-tier { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 14px; }
.dust-hero-rank { font-size: 13px; color: var(--on-surface-variant); margin-top: 4px; letter-spacing: .06em; }
.dust-hero-prog { width: 100%; margin-top: 20px; text-align: left; }
.dust-hero-prog-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: var(--fs-meta); color: var(--on-surface); margin-bottom: 8px;
}
.dust-hero-count { font-family: var(--font-mono); color: var(--primary-text); flex-shrink: 0; }
.dust-cta-lg { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; }

.dust-steps {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.dust-steps li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--surface);
}
.dust-step-n {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--surface-variant); color: var(--primary-text);
  margin-bottom: 4px;
}
.dust-step-t { font-size: 13px; font-weight: 600; }
.dust-step-s { font-size: 11px; color: var(--on-surface-variant); }

.dust-board { list-style: none; }
.dust-board-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 16px;
}
.dust-board-row + .dust-board-row { border-top: 1px solid var(--outline); }
.dust-board-rank {
  width: 28px; flex-shrink: 0; text-align: center;
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--on-surface-variant);
}
.dust-board-row.top .dust-board-rank { color: var(--primary-text); font-size: 22px; }
.dust-board-row.me { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.dust-board-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dust-board-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dust-board-tier { font-size: 11px; color: var(--on-surface-variant); }
.dust-board-score { flex-shrink: 0; font-size: 12px; color: var(--on-surface-variant); }
.dust-board-score b { font-family: var(--font-display); font-size: 17px; color: var(--on-bg); }
.dust-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--on-surface-variant); }

.dust-ladder { list-style: none; padding: 6px 0; position: relative; }
.dust-ladder::before {
  content: ""; position: absolute; left: 23px; top: 26px; bottom: 26px;
  width: 2px; background: var(--outline);
}
.dust-ladder li {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 16px;
}
.dust-ladder-dot {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--outline); background: var(--bg);
  position: relative; z-index: 1;
}
.dust-ladder li.reached .dust-ladder-dot { border-color: var(--primary); background: var(--primary); }
.dust-ladder li.cur .dust-ladder-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.dust-ladder-roman { width: 22px; font-family: var(--font-display); font-size: 15px; color: var(--on-surface-variant); }
.dust-ladder-name { font-size: 14px; }
.dust-ladder li.cur .dust-ladder-name { font-weight: 700; color: var(--primary-text); }
.dust-ladder li:not(.reached) .dust-ladder-name { color: var(--on-surface-variant); }
.dust-ladder-min { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--on-surface-variant); }
.dust-contact { text-align: center; font-size: 11px; color: var(--on-surface-variant); opacity: .8; }
.dust-error { align-items: center; text-align: center; padding-top: 60px; }

/* ---------- 个人资料页 v3（2026-10-23，与「我的」页 v3 同一套视觉） ----------
   v2 是一面表单墙：三屏高、每字段四层 chrome（标题+计数+输入框+提示）、
   可编辑的输入卡和只读的预览卡长得一模一样。
   v3 做三件事：① 压页高（头像区、字段间距、说明文案都收紧）；
   ② 只读预览显式标出来（虚线框 + 「预览」角标）；
   ③ 字段仍是行内输入（点「展开」进全屏编辑器，ui-kit 的 openFocusEditor 早就有）。 */
.app-body.acc-body { padding: 0; }
.acc-hero {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 20px 16px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--outline);
}
.acc-avatar-btn { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.acc-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-variant) center / cover no-repeat;
  border: 1px solid var(--outline);
  font-family: var(--font-display); font-size: 32px; color: var(--on-surface-variant);
  transition: border-color .15s ease;
}
.acc-avatar-btn:hover .acc-avatar { border-color: var(--primary); }
.acc-avatar-badge {
  position: absolute; right: 0; bottom: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-fill); color: var(--on-primary);
  border: 2px solid var(--bg);
}
.acc-avatar-actions { display: flex; gap: 16px; }
.acc-link {
  border: 0; background: none; font: inherit; font-size: 13px; color: var(--primary-text);
  padding: 6px 2px; cursor: pointer;
}
.acc-link.muted { color: var(--on-surface-variant); }

.acc-sections { display: flex; flex-direction: column; gap: 20px; padding: 20px 20px 28px; max-width: 640px; margin: 0 auto; width: 100%; }
.acc-fields { padding: 0 16px 14px; }
.acc-fields > .cf:first-child { margin-top: 14px; }
.acc-fields > .cf { margin-top: 12px; }
.acc-fields .cf-hint { margin-top: 3px; line-height: 1.5; }
.acc-seg { display: flex; }
.acc-seg .seg-btn { min-height: 38px; }
.acc-note { font-size: var(--fs-meta); line-height: 1.55; color: var(--on-surface-variant); padding: 0 2px; margin-top: 6px; }

.acc-email {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 16px;
  border-top: 1px solid var(--outline);
}
.acc-email .cf-label { flex: 0 0 auto; }
.acc-email-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.acc-email-addr {
  min-width: 0; font-size: 13px; color: var(--on-surface);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-email-status { flex-shrink: 0; font-size: 11px; color: var(--on-surface-variant); }
.acc-email-status.ok { color: var(--tertiary); }
.acc-email-status.warn { color: var(--error); }
.acc-chip {
  flex-shrink: 0; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--primary-text); border-radius: 999px;
  background: none; color: var(--primary-text); font: inherit; font-size: 12px; cursor: pointer;
}
/* 次要操作（「更换邮箱」，2026-10-19）：与主操作并排时不能抢视线 ——
   描边降到中性色，只有 hover/active 才回到主题色。 */
.acc-chip-ghost {
  border-color: var(--outline, rgba(128,128,128,.4));
  color: var(--text-dim, inherit);
  opacity: .85;
}
.acc-chip-ghost:hover { opacity: 1; border-color: var(--primary); color: var(--primary-text); }

/* 「角色会这样认识你」：茧丝竖线（本页唯一的装饰手势） */
.acc-preview {
  padding: 14px 16px 14px 18px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.acc-preview-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--primary-text); margin-bottom: 8px; }
.acc-preview-kicker::after {
  content: '预览';
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--on-surface-variant);
  border: 1px solid var(--outline); border-radius: 999px; padding: 1px 7px;
}
.acc-preview-body { display: flex; flex-direction: column; gap: 6px; }
.acc-preview-body p { font-family: var(--font-display); font-size: 14px; line-height: 1.7; color: var(--on-bg); overflow-wrap: anywhere; }
.acc-preview-k {
  display: inline-block; margin-right: 8px;
  font-family: var(--font-sans); font-size: 11px; color: var(--on-surface-variant);
}
.acc-preview-body p.acc-preview-empty { color: var(--on-surface-variant); }

.acc-footer {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
  background: var(--bg);
}
.acc-dirty { flex: 1; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.acc-dirty.on { color: var(--primary-text); }
.acc-dirty.on::before { content: "● "; font-size: 9px; vertical-align: 1px; }
.acc-save { min-width: 132px; min-height: var(--tap); }
/* 没改动时是置灰的：别留一块浅粉（看着像「可点但点不动」），
   换成中性面；有改动时自然回到主色实心。 */
.acc-save:disabled {
  opacity: 1; background: var(--surface-variant); color: var(--on-surface-variant);
}

/* ---------- 相遇大厅 v2 视觉（hall-legacy.js，2026-09-27 重做） ----------
   问候 → 一张大的「继续上次」→ 另外两卷 → 伙伴墙。底部留出 Ta 悬浮球的位置。 */
.stack.hl { gap: 22px; padding-bottom: 80px; }
.hl-offline {
  font-size: var(--fs-meta); color: var(--on-surface-variant);
  padding: 8px 12px; border-radius: var(--r-ctl); background: var(--surface-variant);
}
.hl-head { padding-top: 2px; }
.hl-head-top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.hl-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--primary-text); }
.hl-daily {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface); color: var(--on-surface);
  font: inherit; font-size: 12px; cursor: pointer;
}
.hl-daily:active { background: var(--surface-variant); }
.hl-head-actions {
  display: flex;
  align-items: center;
}
.app-phone-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.app-phone-entry-face {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
}
.app-phone-entry svg {
  flex: 0 0 auto;
  margin-right: 5px;
  stroke-width: 1.65;
}
.app-phone-entry:active .app-phone-entry-face { background: var(--surface-variant); }
.hl-greet {
  margin-top: 12px;
  font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.25;
  color: var(--on-bg); letter-spacing: .01em;
}
.hl-sub { margin-top: 6px; font-size: 14px; color: var(--on-surface-variant); line-height: 1.6; }

.hl-feature {
  position: relative; display: block; width: 100%;
  height: 208px; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--r-card);
  background: var(--surface-variant);
  text-align: left; font: inherit; color: #fff; cursor: pointer;
  isolation: isolate;
}
.hl-feature-art {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -2;
  background-size: cover; background-position: center 22%;
}
.hl-feature-art.none {
  background: linear-gradient(135deg, #7d4838 0%, #1b1512 100%);
}
.hl-feature-shade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0) 30%, rgba(10, 8, 6, .78) 100%);
}
.hl-feature-tag {
  position: absolute; top: 14px; left: 14px;
  font-size: 11px; letter-spacing: .08em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(20, 16, 12, .55); color: #fff;
}
.hl-feature-body {
  position: absolute; left: 18px; right: 76px; bottom: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.hl-feature-name {
  font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.15;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-feature-meta {
  font-size: 13px; color: rgba(255, 255, 255, .86);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-feature-go {
  position: absolute; right: 16px; bottom: 16px;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-fill); color: var(--on-primary);
  font-size: 20px;
}
.hl-feature:active .hl-feature-go { transform: scale(.94); }

.hl-sec { display: flex; flex-direction: column; gap: 10px; }
.hl-sec-head { display: flex; align-items: baseline; gap: 8px; }
.hl-sec-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--on-bg); }
.hl-sec-count { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.hl-sec-link {
  margin-left: auto; border: 0; background: none; font: inherit;
  font-size: 13px; color: var(--primary-text); cursor: pointer; padding: 4px 0;
  /* 触达（2026-10-19）：27px 高，右侧行尾孤立，上下补到 44px 不挤邻座。 */
  position: relative;
}
.hl-sec-link::after {
  content: '';
  position: absolute;
  left: -8px; right: -8px;
  top: 50%; height: 44px;
  transform: translateY(-50%);
}

.hl-recents {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--r-card); overflow: hidden;
}
.hl-recent {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 60px; padding: 10px 14px;
  border: 0; background: none; text-align: left; font: inherit; color: var(--on-bg); cursor: pointer;
}
.hl-recent + .hl-recent { border-top: 1px solid var(--outline); }
.hl-recent:active { background: var(--surface-variant); }
.cavatar.hl-recent-avatar { width: 40px; height: 40px; }
.hl-recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hl-recent-name { font-size: var(--fs-title); font-weight: 600; }
.hl-recent-title {
  font-size: var(--fs-meta); color: var(--on-surface-variant);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-recent-time { flex-shrink: 0; font-size: 11px; color: var(--on-surface-variant); }
.hl-chev { flex-shrink: 0; color: var(--on-surface-variant); opacity: .6; font-size: 18px; }

.hl-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.hl-card.char-card {
  display: block; width: 100%; padding: 0;
  height: 216px; aspect-ratio: auto;
  border-radius: var(--r-card);
  text-align: left; font: inherit; color: #fff;
  animation: none;
}
@supports (aspect-ratio: 1 / 1) {
  .hl-card.char-card { height: auto; aspect-ratio: 3 / 4; }
}
.hl-card.char-card:hover { transform: none; }
.hl-card.char-card:active { transform: scale(.98); }
.hl-card.no-art { background: linear-gradient(160deg, #6a4233 0%, #1b1512 100%); }
.hl-card-initial {
  position: absolute; top: 0; right: 0; bottom: 30%; left: 0; inset: 0 0 30% 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 64px; color: rgba(255, 255, 255, .22);
}
.hl-card-shade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0) 45%, rgba(10, 8, 6, .8) 100%);
}
.hl-card-new {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary);
}
.hl-card-body {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.hl-card-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-card-meta { font-size: 11px; color: rgba(255, 255, 255, .85); }
.hl-card-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  height: 216px; padding: 12px;
  border: 1.5px dashed var(--outline); border-radius: var(--r-card);
  background: none; font: inherit; color: var(--on-surface-variant); cursor: pointer;
}
@supports (aspect-ratio: 1 / 1) {
  .hl-card-add { height: auto; aspect-ratio: 3 / 4; }
}
.hl-card-add:active { background: var(--surface-variant); }
.hl-card-add-plus {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--primary-text); color: var(--primary-text);
  font-size: 24px; line-height: 1; margin-bottom: 6px;
}
.hl-card-add-t { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--on-bg); }
.hl-card-add-s { font-size: 11px; }

.hl-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 40px 20px;
  border: 1.5px dashed var(--outline); border-radius: var(--r-card);
}
.hl-empty-mark { font-size: 28px; color: var(--primary-text); }
.hl-empty-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.hl-empty-sub { font-size: 13px; color: var(--on-surface-variant); margin-bottom: 8px; }

/* ---------- 角色页 · 群像（characters.js redraw，2026-09-27 重做） ----------
   大厅是"去见谁"（大立绘墙），这里是"管理谁"：一行一位，缩略立绘 + 标签 + 性格摘要。 */
.stack.cast { gap: 18px; padding-bottom: 80px; }
.cast-head { padding-top: 2px; }
.cast-title-row { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.cast-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.25; color: var(--on-bg); }
.cast-count { font-size: 14px; color: var(--on-surface-variant); }
.cast-sub { margin-top: 6px; font-size: 14px; color: var(--on-surface-variant); line-height: 1.6; }

.cast-actions { display: flex; gap: 10px; }
.cast-dream {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--outline));
  border-left: 3px solid var(--primary);
  border-radius: var(--r-card);
  background: var(--surface);
  background: linear-gradient(120deg, var(--surface-variant), var(--surface));
  color: var(--on-bg);
  text-align: left;
  font: inherit;
}
.cast-dream:active { transform: scale(.985); }
.cast-dream-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--outline));
  background: var(--surface-variant);
  color: var(--primary-text);
  box-shadow: 0 3px 9px rgba(21, 16, 13, .06);
}
.cast-dream-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.cast-dream-copy strong {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.3;
}
.cast-dream-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--on-surface);
}
.cast-dream-copy small {
  font-size: 10.5px;
  color: var(--primary-text);
}
.cast-dream-go {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-text);
}
@media (max-width: 430px) {
  .cast-dream { gap: 9px; padding: 11px 12px; }
  .cast-dream-mark { flex-basis: 34px; width: 34px; height: 34px; }
  .cast-dream-copy strong { font-size: 16px; }
  .cast-dream-copy span { font-size: 11px; }
  .cast-dream-go { font-size: 11px; }
}
.cast-create.char-card {
  flex: 1; height: auto; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--primary-fill); color: var(--on-primary);
  font: inherit; font-size: 15px; font-weight: 600;
  animation: none;
}
.cast-create.char-card:hover { transform: none; box-shadow: none; }
.cast-create.char-card:active { opacity: .88; transform: none; }
.cast-create-plus { font-size: 20px; line-height: 1; }
.cast-import { min-height: 48px; padding: 0 22px; flex-shrink: 0; }

.cast-search { margin-bottom: 2px; }
.cast-list {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--r-card); overflow: hidden;
}
.cast-item.char-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; height: auto; padding: 12px 14px;
  border: 0; border-radius: 0; background: none;
  text-align: left; font: inherit; color: var(--on-bg);
  animation: none;
  /* 「看大图」角标要绝对定位到缩略图上（见 .cast-zoom） */
  position: relative;
}
.cast-item.char-card + .cast-item.char-card { border-top: 1px solid var(--outline); }
.cast-item.char-card:hover { transform: none; box-shadow: none; }
@media (hover: hover) { .cast-item.char-card:hover { background: var(--surface-variant); } }
.cast-item.char-card:active { background: var(--surface-variant); transform: none; }
.cast-item.char-card[hidden] { display: none; }
.cast-item.ta { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cast-thumb {
  width: 60px; height: 80px; flex-shrink: 0; border-radius: var(--r-ctl);
  background: var(--surface-variant) center 18% / cover no-repeat;
  border: 1px solid var(--outline);
}
.cast-thumb.none {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #6a4233 0%, #1b1512 100%);
  font-family: var(--font-display); font-size: 26px; color: rgba(255, 255, 255, .5);
}
.cast-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cast-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cast-name {
  font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cast-traits { display: flex; gap: 5px; flex-wrap: wrap; }
.cast-trait {
  font-size: 11px; line-height: 1.6; padding: 0 7px;
  border-radius: var(--r-ctl); border: 1px solid var(--outline);
  color: var(--on-surface-variant);
}
.cast-blurb {
  font-size: 12.5px; line-height: 1.55; color: var(--on-surface);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cast-blurb.empty { color: var(--primary-text); }
.cast-nomatch { padding: 20px; text-align: center; font-size: 13px; color: var(--on-surface-variant); }

/* 导入弹层：底部抽屉 */
.cast-sheet-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 12, 17, .45);
  animation: modal-fade .15s ease-out;
}
.cast-sheet {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 8px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--bg); border-radius: var(--r-card) var(--r-card) 0 0;
  border: 1px solid var(--outline); border-bottom: 0;
}
.cast-sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--outline); margin: 2px auto 4px; }
/* 弹层打开时焦点收进容器（tabindex=-1），容器自身不出焦点环（2026-10-17 可达性） */
.cast-sheet:focus { outline: none; }
/* 弹层内容滚到头不再把手势传给页面（手机浏览器的下拉刷新 / 页面回弹会把整个弹层带没） */
.ui-sheet-body { overscroll-behavior: contain; }
.cast-sheet-overlay { overscroll-behavior: contain; }
.cast-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cast-sheet-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; padding: 0 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-sheet-x { flex-shrink: 0; width: 44px; height: 44px; margin: -6px -8px -6px 0; border: 0; border-radius: 50%; background: transparent; color: var(--on-surface-variant); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cast-sheet-x:hover { background: var(--surface-variant); }
.cast-sheet-x:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cast-sheet .ui-group-body .ui-row-sub { white-space: normal; }
.cast-sheet-cancel { min-height: var(--tap); }
@media (min-width: 641px) {
  .cast-sheet-overlay { align-items: center; }
  .cast-sheet { border-radius: var(--r-card); border-bottom: 1px solid var(--outline); }
}

/* ---------- 世界 · 入口 / 纪元 / 入梦书墙（worlds.js，2026-09-27 重做） ----------
   入口两扇门代替每次进 tab 都弹的选择窗；列表沿用大厅的问候页头与列表行。 */
.stack.wd { gap: 18px; padding-bottom: 80px; }
.wd-back {
  align-self: flex-start; margin-bottom: -6px;
  border: 0; background: none; padding: 6px 0;
  font: inherit; font-size: 13px; color: var(--on-surface-variant); cursor: pointer;
  /* 触达（2026-10-19）：实测 31px 高，补到 44px。它是页顶孤立的返回键，
     两边都是留白，加高不会挤到任何东西。 */
  min-height: 44px;
  display: inline-flex; align-items: center;
}
.wd-head { padding-top: 2px; }
.wd-title {
  margin-top: 12px;
  font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.25; color: var(--on-bg);
}
.cast-title-row .wd-title { margin-top: 0; }
.wd-sub { margin-top: 6px; font-size: 14px; color: var(--on-surface-variant); line-height: 1.6; }

.wd-door {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  width: 100%; min-height: 168px; padding: 20px 76px 20px 20px;
  border: 0; border-radius: var(--r-card);
  text-align: left; font: inherit; color: #fff; cursor: pointer;
}
.wd-door.aeon { background: radial-gradient(120% 140% at 85% 0%, #3b3a63 0%, #1d1c33 45%, #0f0e1a 100%); }
/* 共梦门（2026-10-26）：顶替原来纪元的位置。
   配色**沿用**纪元那套夜空渐变 —— 它线上跑了一个多月、与赤陶那扇的对比度是验证过的
   （深底白字的渐变必须写定值，color-mix()+var() 在老 WebView 上会整条失效成透明，
   见下面那条注释）。.wd-door.aeon 的规则保留着：纪元将来回归时直接可用。 */
.wd-door.room { background: radial-gradient(120% 140% at 85% 0%, #3b3a63 0%, #1d1c33 45%, #0f0e1a 100%); }
/* 深底白字的装饰渐变一律用定值：color-mix()+var() 在老 WebView 上会整条失效成透明（不是回退到上一条），白字就看不见了 */
.wd-door.dream { background: radial-gradient(120% 140% at 85% 0%, #a3614b 0%, #2a1812 50%, #140c09 100%); }
/* 星点：纯 CSS，两扇门各一层，不加图片 */
.wd-door::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 18% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 62% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 78%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 34%, #fff 50%, transparent 51%);
}
.wd-door.dream::before { opacity: .25; }
.wd-door:active { transform: scale(.99); }
.wd-door-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .24em; color: rgba(255, 255, 255, .6); }
.wd-door-title { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.1; }
.wd-door-sub { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.wd-door-meta {
  margin-top: 6px; font-size: 11px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .9);
}
.wd-door-meta:empty { display: none; }
.wd-door-go {
  position: absolute; right: 18px; bottom: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); font-size: 18px;
}
.wd-door.dream .wd-door-go { background: var(--primary-fill); color: var(--on-primary); }
/* 纪元功能锁（worlds.js lockEraDoor）：整扇压暗、不给按压反馈、右侧换成锁图标。
   与 .feat-card 的锁定卡同一套语言（opacity 降 + 锁），但门是深底白字，
   所以降透明度而不改字色——改色会在两套渐变背景上出现不可控的对比度。 */
.wd-door.is-locked { opacity: .5; cursor: default; }
.wd-door.is-locked:active { transform: none; }
.wd-door.is-locked .wd-door-go { background: rgba(255, 255, 255, .1); }
.wd-kind {
  flex-shrink: 0; min-width: 40px; text-align: center;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, #3b3a63 18%, var(--surface-variant)); color: var(--on-surface);
}
.wd-kind.dream { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-text); }

/* 纪元：生成 / 创造 */
.wd-gen { flex: 1; min-height: 48px; font-size: 15px; }
.wd-create-toggle { min-height: 48px; padding: 0 18px; flex-shrink: 0; }
.wd-create {
  padding: 4px 16px 16px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface);
  display: flex; flex-direction: column;
}
.wd-create[hidden] { display: none; }
.wd-create-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-top: 14px; }
.wd-create > .btn { margin-top: 16px; min-height: var(--tap); }
.wd-seg { display: flex; }
.wd-seg .seg-btn { min-height: 36px; }
.wd-empty-note { font-size: 13px; color: var(--on-surface-variant); text-align: center; padding: 12px; }

.wd-list { display: flex; flex-direction: column; gap: 10px; }
.wd-world {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  width: 100%; padding: 16px 40px 16px 16px;
  border: 1px solid var(--outline); border-left: 3px solid #5b5a8f; border-radius: var(--r-card);
  background: var(--surface); text-align: left; font: inherit; color: var(--on-bg); cursor: pointer;
}
.wd-world:active { background: var(--surface-variant); }
.wd-world-top { display: flex; align-items: center; gap: 8px; }
.wd-world-day { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--primary-text); }
.wd-world-mode { font-size: 11px; color: var(--on-surface-variant); }
.wd-world-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.3; }
.wd-world-desc {
  font-size: 13px; line-height: 1.6; color: var(--on-surface);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wd-world-desc.empty { color: var(--on-surface-variant); }
.wd-world-time { font-size: 11px; color: var(--on-surface-variant); margin-top: 2px; }
.wd-world-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }

/* 入梦书墙 */
.wd-quota { margin-left: auto; font-size: 12px; color: var(--primary-text); }
.wd-quota.full { color: var(--on-surface-variant); }
.dream-book-new.wd-book-new {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1.5px dashed var(--outline); border-radius: var(--r-card);
}
.wd-book-new .hl-card-add-plus { margin-bottom: 0; flex-shrink: 0; }
.wd-book-new.full .hl-card-add-plus { border-color: var(--outline); color: var(--on-surface-variant); }
.wd-book-new-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-book-new-t { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.wd-book-new-s { font-size: 12px; color: var(--on-surface-variant); line-height: 1.5; }
.dream-book-card.wd-book {
  padding: 18px 16px 14px;
  border: 1px solid var(--outline); border-radius: var(--r-card);
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 5%, var(--surface)) 0%, var(--surface) 55%);
  gap: 8px;
}
.dream-book-card.wd-book.dream-book-mine { border-left: 3px solid var(--primary); }
.wd-book .dream-book-name { font-size: 20px; font-weight: 700; line-height: 1.3; }
.wd-book .dream-book-tagline { font-size: 13px; color: var(--on-surface); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wd-book-cat {
  font-size: 11px; padding: 1px 9px; border-radius: 999px;
  border: 1px solid var(--primary-text); color: var(--primary-text);
}
.wd-book-src { font-size: 11px; color: var(--on-surface-variant); }
.wd-book-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.wd-book-enter { min-height: 40px; padding: 0 22px; flex-shrink: 0; }
.wd-book .dream-book-ops { justify-content: flex-start; padding-top: 8px; border-top: 1px dashed var(--outline); }

/* ---------- 世界详情（openWorld，2026-09-27 重做）：扉页 + 居民 / 日志 / 记忆 三段 ---------- */
.stack.wd-detail { gap: 16px; }
.wd-hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 240px; padding: 14px 16px 20px;
  border-radius: var(--r-card); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 140% at 85% 0%, #3b3a63 0%, #1d1c33 45%, #0f0e1a 100%);
}
.wd-hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 18% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 62% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 78%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 34%, #fff 50%, transparent 51%);
}
.wd-hero.has-scene::before { background: linear-gradient(180deg, rgba(8, 8, 12, .35) 0%, rgba(8, 8, 12, .15) 40%, rgba(8, 8, 12, .8) 100%); opacity: 1; }
.wd-hero-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -2; background: center / cover no-repeat; }
.wd-hero-top { display: flex; justify-content: space-between; gap: 8px; }
.wd-hero-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fff;
  font: inherit; font-size: 13px; cursor: pointer;
}
.wd-hero-btn:active { background: rgba(255, 255, 255, .24); }
.wd-hero-body { margin-top: 24px; }
.wd-hero-name {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}
.wd-hero-clock { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.wd-hero .world-day { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: rgba(255, 255, 255, .75); }
.wd-hero .world-time { margin: 0; font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.wd-hero-sub { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.wd-desc { font-family: var(--font-display); font-size: 15px; line-height: 1.9; color: var(--on-surface); padding: 0 4px; }

.wd-tabs {
  position: sticky; top: -14px; z-index: 2;
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--outline); border-radius: 999px; background: var(--bg);
}
.wd-tab {
  flex: 1; min-height: 38px; border: 0; border-radius: 999px;
  background: none; color: var(--on-surface-variant);
  font: inherit; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.wd-tab.on { background: var(--on-bg); color: var(--bg); font-weight: 600; }
.wd-tab-n { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }
.wd-pane { display: flex; flex-direction: column; gap: 12px; }
.wd-pane-note { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; padding: 0 4px; }
.btn.wd-wide { width: 100%; min-height: var(--tap); }
.wd-resident { cursor: default; }
.wd-resident .hl-recent-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wd-pull { display: flex; flex-direction: column; gap: 8px; }
.wd-pull-title { font-size: 12px; color: var(--on-surface-variant); padding: 0 4px; }
.wd-pull-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-pull-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px 0 4px;
  border: 1px dashed var(--outline); border-radius: 999px; background: none;
  font: inherit; font-size: 13px; color: var(--on-surface); cursor: pointer;
}
.wd-pull-chip:active { background: var(--surface-variant); }
.cavatar.wd-pull-avatar { width: 28px; height: 28px; font-size: 12px; }

/* 日志：一根竖线串起来的时间线（茧丝竖线的变体） */
.wd-timeline { list-style: none; position: relative; padding-left: 18px; }
.wd-timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--outline); }
.wd-timeline li { position: relative; padding: 0 0 16px; }
.wd-timeline li::before {
  content: ""; position: absolute; left: -18px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--primary-text);
}
.wd-timeline-text { font-family: var(--font-display); font-size: 14px; line-height: 1.8; color: var(--on-bg); }
.wd-timeline-time { font-size: 11px; color: var(--on-surface-variant); }

/* 记忆碎片 */
.wd-mem {
  padding: 12px 14px 14px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface);
}
.wd-mem.pinned { border-left: 3px solid var(--primary); }
.wd-mem-new { border-style: dashed; }
.wd-mem-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.wd-mem-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--on-surface-variant); text-transform: uppercase; }
.wd-mem-time { margin-left: auto; font-size: 11px; color: var(--on-surface-variant); }
.wd-mem-op {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--on-surface-variant); cursor: pointer;
}
.wd-mem-op:active { background: var(--surface-variant); }
.wd-mem-op.danger { color: var(--error); }
.wd-mem-text { font-family: var(--font-display); font-size: 15px; line-height: 1.75; margin-top: 4px; color: var(--on-bg); }
.wd-kws { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wd-kw {
  font-size: 11px; padding: 1px 8px; border-radius: var(--r-ctl);
  background: var(--surface-variant); color: var(--on-surface-variant);
}
.wd-kw::before { content: "#"; opacity: .6; margin-right: 1px; }
.wd-memform .cf:first-child { margin-top: 4px; }
.wd-memform-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.wd-memform-actions .btn { min-height: 40px; padding: 0 20px; }

/* 设置弹层 */
.ui-sheet-body { display: flex; flex-direction: column; max-height: 70vh; max-height: min(70vh, 70dvh); max-height: min(70vh, 70dvh, calc(var(--vvh, 100vh) - 150px)); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 0 2px 4px; }
/* ⚠️ overflow-x:hidden 不能删（2026-10-17 工单「查看会员权益能左右滑」）：
   只写 overflow-y:auto 时，横向 overflow 的 visible 会按规范**计算成 auto**——
   只要弹层里有一个横向超宽的子元素（典型：.mx-cta 的 -20px 出血负边距），
   整个弹层就被赋予横向滚动、手指能左右拖。横向出血该被裁掉，不该能滑。 */
/* 旧 WebView 兜底：这块是滚动区，子项本就该"装不下就滚"，绝不允许被压得比内容还矮
   （老引擎会把 flex 子项压扁，内容溢出后互相叠——另一条「字跑到上面去了」的来源）。
   flex-shrink:0 在现代引擎上是空操作（自动最小尺寸本来就保着）。 */
.ui-sheet-body > * { flex-shrink: 0; }
.ui-sheet-body > .cf:first-child { margin-top: 0; }
.wd-sheet-actions { margin-top: 16px; }
.wd-sheet-actions .btn { width: 100%; min-height: var(--tap); }
.wd-sheet-sub { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--outline); }
.wd-sheet-sub .btn { flex: 1; min-height: 40px; font-size: 13px; }
.btn.wd-danger { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, var(--outline)); }

/* ---------- 梦境书编辑器（renderDreamBookEditor，2026-09-27 重做版面；字段用 ui-kit 的 uiField） ---------- */
.stack.wdb { padding-bottom: 12px; }
/* 导入设定文件：提到标签页上面的一整块（2026-10-27，工单「能不能加个导入文件功能」——
   功能早就有，只是按钮埋在「粘贴导入」页底部没人找得到）。
   视觉上比普通卡片重一点：左侧一道主色竖线，跟页面里其他 card 区分开。 */
.wdb .wdb-import { border-left: 3px solid var(--primary); }
.wdb .wdb-import .mono-label { margin-bottom: 6px; }
/* 导入后那条预算提示：告诉用户这份设定要占多少上下文，常驻超了会怎样 */
.wdb-budget {
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--r-ctl); background: var(--bg);
  border: 1px solid var(--outline);
  font-size: 12px; line-height: 1.75; color: var(--on-surface-variant);
}
.wdb-budget-title {
  font-weight: 600; color: var(--on-surface); margin-bottom: 2px;
}
.wdb-budget-line { color: var(--on-surface-variant); }
.wdb-budget-warn { margin-top: 6px; color: var(--primary-text); }
.wdb-budget.is-over { border-color: var(--primary); }
.wdb-form { display: flex; flex-direction: column; gap: 14px; }
.wdb-sec {
  padding: 4px 16px 16px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface);
}
.wdb-sec-title {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 14px;
  font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--on-bg);
}
.wdb-sec-sub { font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--on-surface-variant); }
.wdb-sec-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 8px 0 10px; font-size: 12px; color: var(--on-surface-variant);
}
.wdb-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 641px) {
  .wdb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
}
.wdb .dream-rows { margin-bottom: 10px; gap: 12px; }
.wdb .dream-row {
  gap: 0; padding: 12px 12px 14px;
  border: 1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--bg);
}
.wdb .dream-row .cf { margin-top: 10px; }
.wdb .dream-row-head .field { font-weight: 600; }
.wdb .dream-npc-here { min-height: 34px; padding: 0 12px; font-size: 12px; }
.wdb .dream-npc-here.active { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); color: var(--primary-text); }
.wdb .dream-npc-source {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--primary-text);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--outline));
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.wdb-npc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wdb-npc-actions .btn { width: 100%; min-height: 42px; }
.wdb-danger:empty { display: none; }
.wdb-danger .btn { width: 100%; min-height: 40px; font-size: 13px; }
/* 固定保存栏：贴在滚动区底部，长表单写到哪都够得着 */
.wdb-savebar {
  position: sticky; bottom: -14px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -14px -14px; padding: 10px 14px;
  background: var(--bg); border-top: 1px solid var(--outline);
}
@media (min-width: 768px) {
  .wdb-savebar { bottom: -20px; margin: 0 -20px -20px; padding: 12px 20px; }
}
.wdb-savebar .dream-status { flex: 1; color: var(--on-surface-variant); }
.wdb-savebar .dream-status:empty { display: block; }
.btn.wdb-save { min-height: var(--tap); padding: 0 24px; }

/* 世界书 · 从角色卡导入 NPC */
.wbnpc-sheet { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.wbnpc-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--outline));
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--primary) 22%, transparent) 0 62px, transparent 63px),
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--primary)), var(--surface));
}
.wbnpc-hero::after {
  content: "↳";
  position: absolute;
  right: 20px;
  bottom: -17px;
  font: 700 76px/1 var(--font-serif, Georgia, serif);
  color: color-mix(in srgb, var(--primary) 18%, transparent);
  transform: rotate(-12deg);
  pointer-events: none;
}
.wbnpc-kicker {
  margin-bottom: 7px;
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.wbnpc-lead {
  max-width: 42em;
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.75;
}
.wbnpc-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}
.wbnpc-metrics > span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--on-surface-variant);
  background: color-mix(in srgb, var(--surface-variant) 78%, transparent);
  font-size: 11px;
  line-height: 1.4;
}
.wbnpc-search-row { display: flex; gap: 8px; }
.wbnpc-search { width: 100%; min-height: 42px; }
.wbnpc-result-count { color: var(--primary-text); }
.wbnpc-list { display: flex; flex-direction: column; gap: 8px; }
.wbnpc-item {
  display: grid;
  grid-template-columns: 22px 46px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--outline);
  border-radius: 15px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.wbnpc-item:active { transform: scale(.992); }
.wbnpc-item.is-selected {
  border-color: color-mix(in srgb, var(--primary) 72%, var(--outline));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.wbnpc-item.is-disabled { opacity: .52; cursor: not-allowed; }
.wbnpc-check { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.wbnpc-avatar {
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wbnpc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wbnpc-avatar.is-letter {
  color: var(--primary-text);
  font: 700 19px/1 var(--font-serif, Georgia, serif);
}
.wbnpc-main { min-width: 0; }
.wbnpc-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.wbnpc-name {
  min-width: 0;
  color: var(--on-bg);
  font-size: 14px;
  font-weight: 650;
}
.wbnpc-desc {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.wbnpc-badge {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--on-surface-variant);
  background: var(--surface-variant);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}
.wbnpc-badge.is-update,
.wbnpc-badge.is-warn {
  color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.wbnpc-badge.is-soft { opacity: .8; }
.wbnpc-empty {
  padding: 28px 16px;
  border: 1px dashed var(--outline);
  border-radius: 16px;
  color: var(--on-surface-variant);
  text-align: center;
  font-size: 13px;
}
.wbnpc-secret {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-variant) 64%, transparent);
  cursor: pointer;
}
.wbnpc-secret input { margin-top: 3px; accent-color: var(--primary); }
.wbnpc-secret span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wbnpc-secret strong { font-size: 13px; color: var(--on-bg); }
.wbnpc-secret small { color: var(--on-surface-variant); font-size: 11px; line-height: 1.55; }
.wbnpc-foot { display: grid; grid-template-columns: minmax(84px, .42fr) minmax(140px, 1fr); gap: 9px; }
.wbnpc-foot .btn { width: 100%; min-height: var(--tap); }
@media (max-width: 420px) {
  .wbnpc-hero { padding: 15px; }
  .wbnpc-item { grid-template-columns: 20px 42px minmax(0, 1fr); gap: 9px; padding: 10px; }
  .wbnpc-avatar { width: 42px; height: 42px; border-radius: 12px; }
  .wdb-npc-actions { grid-template-columns: 1fr; }
}

/* ---------- 记忆 · 梦茧（cocoon.js，2026-09-27 重做） ---------- */
.cc-layers { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.cc-layer { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; text-align: center; }
.cc-layer + .cc-layer { border-left: 1px solid var(--outline); }
.cc-layer-ic { color: var(--primary-text); margin-bottom: 4px; display: flex; }
.cc-layer-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.cc-layer-desc { font-size: 11px; color: var(--on-surface-variant); }

.cc-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-card); overflow: hidden; }
.cc-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px; border: 0; background: none;
  text-align: left; font: inherit; color: var(--on-bg); cursor: pointer;
}
.cc-row + .cc-row { border-top: 1px solid var(--outline); }
.cc-row:active { background: var(--surface-variant); }
.cavatar.cc-row-avatar { width: 48px; height: 48px; font-size: 18px; }
.cc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-row-name { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.cc-row-stat { margin-left: auto; font-family: var(--font-sans); font-size: 11px; font-weight: 400; color: var(--on-surface-variant); white-space: nowrap; }
.cc-row-bond {
  font-family: var(--font-display); font-size: 13px; line-height: 1.6; color: var(--on-surface);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cc-row-bond.empty { color: var(--on-surface-variant); }
.cc-row-note { font-size: 11px; color: var(--on-surface-variant); line-height: 1.5; }

/* 详情扉页：立绘 + 名字 + 织茧 */
.cc-back { margin-bottom: -6px; }
.stack.cc-unfurl { gap: 14px; margin-top: 0; }
.cc-hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 220px; border-radius: var(--r-card);
  display: flex; align-items: flex-end;
  background: #1b1512; color: #fff;
}
.cc-hero-art { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -2; background: center 18% / cover no-repeat; }
.cc-hero-art.none { background: radial-gradient(120% 140% at 85% 0%, #955845 0%, #1b1512 70%); }
.cc-hero-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 8, 6, .1) 20%, rgba(10, 8, 6, .85) 100%); }
.cc-hero-body { width: 100%; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.cc-hero-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: rgba(255, 255, 255, .7); }
.cc-hero-name { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.cc-hero-stat { font-size: 13px; color: rgba(255, 255, 255, .85); }
.cc-hero-act { display: flex; align-items: center; gap: 12px; margin-top: 10px; min-height: 44px; }
.cc-weave {
  flex-shrink: 0; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.cc-weave:disabled { opacity: .7; }
.cc-hero .weave-status { font-size: 12px; color: rgba(255, 255, 255, .9); line-height: 1.5; }
.cc-hero .weave-status.error { color: #ffb4a2; }

.cc-body { display: flex; flex-direction: column; gap: 14px; }
.cc-card, .cc-bond {
  padding: 14px 16px 16px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface);
}
.cc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.cc-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cc-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary-text); letter-spacing: .04em; }
.cc-card-note { font-size: 11px; color: var(--on-surface-variant); }
.cc-edit {
  /* 触达（2026-10-19）：原来是 32px 高的小胶囊，提到 44px。
     它在「修正这一栏」行尾，单独一个，加高不会挤邻座。 */
  min-height: 44px; padding: 0 12px; border: 1px solid var(--outline); border-radius: 999px;
  background: var(--bg); font: inherit; font-size: 12px; color: var(--on-surface); cursor: pointer;
  display: inline-flex; align-items: center;
}
.cc-edit:active { background: var(--surface-variant); }
.cc-edit[hidden] { display: none; }
/* 羁绊引语：茧丝竖线（本页唯一的装饰手势） */
.cc-bond .bond-text {
  margin-top: 10px; padding: 2px 0 2px 14px;
  border-left: 3px solid var(--primary);
  font-family: var(--font-display); font-size: 16px; line-height: 1.85; color: var(--on-bg);
}
.cc-bond .bond-text.empty { color: var(--on-surface-variant); font-size: 14px; }
.cc-bond .field, .cc-mind-row .field { margin-top: 10px; }
.cc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cc-actions .btn { min-height: 40px; padding: 0 20px; }
.cc-mind { display: flex; flex-direction: column; gap: 14px; }
.cc-mind-row + .cc-mind-row { padding-top: 14px; border-top: 1px dashed var(--outline); }
.cc-mind-head { display: flex; align-items: center; gap: 8px; }
.cc-mind-label { flex: 1; font-size: 14px; font-weight: 600; }
.cc-mind-text { margin-top: 6px; font-size: 13.5px; line-height: 1.75; color: var(--on-surface); }
.cc-mind-text.empty { color: var(--on-surface-variant); }
.cc-mind-bar { height: 3px; margin-top: 10px; border-radius: 2px; background: var(--surface-variant); overflow: hidden; }
.cc-mind-bar > span { display: block; height: 100%; background: var(--primary); }
/* 留住的版本（2026-10-25 建议 6273ab6e）：羁绊正文与心象共用，折叠入口 + 原文 */
.cc-saves { margin-top: 10px; }
.cc-saves[hidden] { display: none; }
.cc-saves-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; color: var(--on-surface-variant); font-size: 12.5px; cursor: pointer; }
.cc-saves-toggle[hidden] { display: none; }
.cc-saves-chev { font-size: 14px; line-height: 1; }
.cc-saves-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cc-saves-list[hidden] { display: none; }
.cc-save-row { padding: 8px 10px; border-radius: 10px; background: var(--surface-variant); }
.cc-save-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-save-at { font-size: 11.5px; color: var(--on-surface-variant); }
.cc-save-text { margin: 4px 0 0; font-size: 13px; line-height: 1.65; color: var(--on-surface); }
.cc-branch-seg { margin: 10px 0 8px; }
.cc-note { font-size: 12px; line-height: 1.6; color: var(--on-surface-variant); padding: 0 4px; }

.cc-pane { display: flex; flex-direction: column; gap: 10px; }
.cc-atom-new { display: flex; gap: 8px; }
.cc-atom-new .field { flex: 1; min-width: 0; border-radius: 999px; padding-left: 16px; }
.cc-atom-add {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: var(--primary-fill); color: var(--on-primary); cursor: pointer;
}
.cc-atom-add:disabled { opacity: .5; }
.cc-atom {
  display: flex; align-items: flex-start; gap: 4px;
  padding: 12px 8px 12px 14px;
  border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--surface);
}
.cc-atom.fading { opacity: .72; border-style: dashed; }
.cc-atom-main { flex: 1; min-width: 0; }
.cc-atom-text { font-size: 14px; line-height: 1.7; color: var(--on-bg); }
.cc-atom-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--on-surface-variant); }
.cc-fading { padding: 0 6px; border-radius: var(--r-ctl); background: var(--surface-variant); }
/* 暂停召回的星屑（工单「更新后星屑没了」）：视觉上比"变淡"更弱，但必须仍可辨认——
   它们是用户自己的记忆，不是噪音。虚线 + 降饱和，不隐藏。 */
.cc-paused { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--outline); }
.cc-atom.cc-atom-paused { background: transparent; border-style: dashed; opacity: .78; }
.cc-atom.cc-atom-paused .cc-atom-text { color: var(--on-surface-variant); }
.cc-chapter { padding: 14px 10px 14px 16px; border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); }
.cc-chapter-head { display: flex; align-items: center; gap: 8px; }
.cc-chapter-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.cc-chapter .chapter-summary { margin-top: 6px; padding-right: 6px; font-size: 13.5px; line-height: 1.8; color: var(--on-surface); }
.cc-reset {
  align-self: center; margin-top: 8px; min-height: 36px; padding: 0 14px;
  border: 0; background: none; font: inherit; font-size: 12px; color: var(--error); opacity: .8; cursor: pointer;
}

/* ---------- 角色名：「名字 · 身份」拆成大字名 + 小字身份（ui-kit 的 uiName） ---------- */
.ui-name { display: flex; flex-direction: column; min-width: 0; }
.ui-name-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-name-sep { display: none; }
.ui-name-role {
  font-family: var(--font-sans); font-size: 12px; font-weight: 400; line-height: 1.45;
  opacity: .78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hl-feature-name .ui-name-role { font-size: 13px; margin-top: 2px; }
.hl-card-name .ui-name-role { font-size: 11px; }
.hl-recent-name .ui-name-role, .cast-name .ui-name-role, .cc-row-name .ui-name-role { color: var(--on-surface-variant); opacity: 1; }
.cc-hero-name .ui-name-role { font-size: 13px; margin-top: 4px; }
.cast-name, .cc-row-name .ui-name { min-width: 0; }
.cc-row-name { align-items: flex-start; }
.cc-row-name .ui-name { flex: 1; }
.cc-row-stat { margin-top: 4px; }

/* ---------- 应用设置（renderSettings，2026-09-27 换皮：分组 = ui-group，行 = ui-row） ---------- */
.stack.st-page { gap: 22px; padding-bottom: 24px; }
.ui-row.ui-switch-row { cursor: default; }
.ui-row.ui-switch-row .setting-sub { font-size: var(--fs-meta); margin-top: 2px; }
.ui-row.setting-row.heart-row { gap: 12px; }
.ui-row.ui-seg-row { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
.ui-seg-row .setting-theme-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ui-seg-row .seg-control { display: flex; }
.ui-seg-row .seg-btn { min-height: 36px; }
.ui-group-note {
  padding: 10px 16px 14px; border-top: 1px solid var(--outline);
  font-size: var(--fs-meta); line-height: 1.6; color: var(--on-surface-variant);
}
.st-foot { text-align: center; font-size: 12px; color: var(--on-surface-variant); padding: 0 16px; }

/* 我的页 v3 的错峰入场：开「减少动态效果」就全部关掉（契约：reduced-motion 全关） */
@media (prefers-reduced-motion: reduce) {
  .me-hero-top, .me-id, .me-quote, .me-numbers, .me-sections > * { animation: none; }
}

/* 梦境会话里 *……* 的动作 / 旁白描写：去掉星号、颜色退一档 */
.dream-act { color: var(--on-surface-variant); }
.dream-line.npc .dream-act::before { content: "（"; }
.dream-line.npc .dream-act::after { content: "）"; }

@media (prefers-reduced-motion: reduce) {
  button.ui-row, button.ui-stat, .me-words-more::after { transition: none; }
  .cast-sheet-overlay { animation: none; }
  .me-skel { animation: none; }
}

/* 分段选择器：iOS 灵感分段控制，无 emoji，素雅精致 */
.seg-control {
  display: inline-flex;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  border-radius: 10px;
  padding: 2.5px;
  gap: 2px;
  width: 100%;
}
.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 7.5px;
  padding: 6.5px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
  cursor: pointer;
  text-align: center;
  transition: all .15s ease;
}
.seg-btn:active {
  transform: scale(0.97);
}
.seg-btn.active {
  background: var(--surface);
  color: var(--on-bg);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.feat-card {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left; color: inherit;
  background: var(--surface);
  border: 1px solid var(--outline); border-radius: 14px;
  padding: 15px 16px;
}
.feat-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--surface-variant);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.feat-main { flex: 1; min-width: 0; }
.feat-title { font-weight: 600; font-size: 15px; }
.feat-sub {
  font-size: 12px; color: var(--on-surface-variant); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feat-arrow { color: var(--on-surface-variant); }

.ver-foot {
  text-align: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--on-surface-variant);
  padding: 8px 0 4px;
}

/* 设置宫格 */
.tile-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--outline); border-radius: 14px;
  padding: 20px 4px 13px;
  color: inherit; font-size: 11px;
}
.tile .t-icon { font-size: 20px; line-height: 1; }
.tile:disabled { opacity: .5; }

/* 开关行 */
.setting-main { flex: 1; min-width: 0; }
.setting-sub {
  font-size: 11px; color: var(--on-surface-variant);
  margin-top: 3px; line-height: 1.55;
}
.switch {
  position: relative; flex-shrink: 0;
  width: 46px; height: 26px; border-radius: 999px;
  background: #C9CFDA; border: none;
  transition: background .2s ease;
}
/* 触达（2026-10-19）：开关本体 26px 高（微信原生比例），拉到 44px 会变形。
   ::after 已被滑钮占用，这里用 ::before 铺一层透明的 44px 命中面。
   只在纵向扩，横向保持 46px（这一列里没有别的可点元素）。 */
.switch::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%; height: 44px;
  transform: translateY(-50%);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }

/* ==========================================================================
   移动端适配（手机优先的触控体验）
   ========================================================================== */
@media (max-width: 767px) {
  /* 输入类 16px 起，彻底杜绝 iOS Safari 聚焦时强制放大视口导致界面错位 */
  input,
  textarea,
  select,
  .field,
  .composer textarea,
  .ta-composer textarea,
  .conn-field-input,
  .profile-input,
  .plaza-search,
  .wx-search input,
  .wx-ds-field-input,
  .wx-detail-input,
  .wx-tr-amount-input,
  .wx-tr-note-input,
  .wx-rp-amount-input,
  .wx-rp-note-input,
  .wx-mic-input {
    font-size: 16px !important;
  }
  /* 对话输入框（四套）：在上面「≥16px」的基础上随「对话字号」放大（只放大不缩小：--chat-input-scale = max(1, 缩放)），
     写在上一条之后，同为 !important 时后写的赢。 */
  .composer textarea,
  .ta-composer textarea,
  .wx-input,
  .dream-input-field {
    font-size: calc(16px * var(--chat-input-scale, 1)) !important;
  }

  .app-header { padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
  .app-notice { padding: calc(10px + env(safe-area-inset-top)) 14px 0; }
  .app-notice.after-header { padding-top: 10px; }

  .conn-header { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .app-title { font-size: 18px; }
  .app-body { padding: 14px 14px 20px; }
  .card { padding: 15px 16px; border-radius: 10px; }

  /* 触控目标放大 */
  .chip { padding: 9px 16px; font-size: 13px; }
  .btn { padding: 12px 18px; }
  .send-btn { width: 46px; height: 46px; flex-shrink: 0; }

  .composer {
    position: relative;
    bottom: auto;
    background: var(--bg);
    padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  }
  body.kb-open .composer,
  body.kb-open .ta-composer {
    padding-bottom: 8px;
  }

  /* 小屏输入栏一行 5 控件太挤（水位环+token 小字+图+输入框+发送）：
     隐藏 token 小字，点击水位环弹窗照样看完整明细 */
  .composer .ctx-tokens { display: none; }

  .auth-wrap { padding: 16px; align-items: flex-start; padding-top: calc(12vh + env(safe-area-inset-top)); }
  .auth-logo { font-size: 34px; }
  .world-time { font-size: 36px; }
}

/* 横屏矮窗口：压缩头部留白（仍保留安全区以避开侧边刘海） */
@media (max-height: 520px) {
  .app-header { padding: calc(8px + env(safe-area-inset-top)) 20px 6px; }
  
  .conn-header { padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
}

/* ==========================================================================
   桌面网页版（2026-10-10，工单「电脑打开网页，界面小就算了；这个显示问题我直接
   没办法选中编辑」）
   旧做法：≥768px 且有鼠标时，把整个手机界面塞进一个 390×844 的假手机壳、居中摆在
   星空背景上 —— 电脑上内容只剩屏幕中间一小条（1912 宽视口左右各空 761px），
   「长按一行可删」只剩右键一个入口，鼠标用户根本不知道怎么管，看起来就是"坏了"。
   新做法：**真桌面不套壳**，整站按网页排——左侧导航栏 + 顶部品牌条 + 右侧内容区，
   列表转多列、输入区限宽居中、弹层贴着内容区右边走。
   判定沿用原来的三重条件（≥768px + hover:hover + pointer:fine）：
   iPad 竖屏与手机横屏宽度也 ≥768px，但它们指针粗糙，继续走原来的满屏移动布局。
   （display-mode: standalone 的满屏兜底在下面那条 @media 里，保持不变。）
   ========================================================================== */
/* 三层包装（stage / phone / caption）现在永远只是 display: contents：
   桌面上不套壳，手机上等于没有这层。caption 那行说明文字已在 mount() 里删掉。 */
.phone-stage { display: contents; }
.phone { display: contents; }

/* 大屏骨架（侧栏 + 内容两栏）。
   ⚠️ 这里**只按宽度**判断，不再要求 (hover:hover) and (pointer:fine)：
   iPad / 触屏笔记本是「大屏 + 粗指针」，旧条件把它们全挡在外面，于是它们拿到
   移动端单列布局，却又被 .app-shell 的 max-width:720px 卡住 —— 1024×768 的 iPad 上
   内容只剩中间 720px，左右各空 152px（2026-10-19 走查实测，iPad Pro 竖屏空 196px）。
   悬停效果单独用 (hover:hover) 包住（见文件末尾「仅悬停指针」段），
   免得触屏点一下之后 :hover 粘在元素上不消失。 */
@media (min-width: 768px) {
  /* 侧栏宽度。它同时是下面几个"贴内容区右边走"的浮层的左偏移量 */
  :root { --side-w: 216px; }
  /* ---------- 外壳：左侧导航 + 顶部品牌条 + 右侧内容 ----------
     原来的假手机壳（390×844、圆角、星空背景）整个撤掉：桌面上内容只该受
     视口宽度约束，不该被一个手机的宽度约束。 */
  .app-shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    /* 三行：header / 公告槽 / 内容+侧栏。
       公告槽（.app-notice）原来没有 grid-area，在 grid 里被自动放置 ⇒ 掉进侧栏那一列的
       最后一行（实测平板 slotTop=912、桌面 788，宽度只有 216，文字被截断）。
       它必须跟 header 一样横跨两列，所以单独占一行。空置时 :empty 是 display:none，该行 auto 高度为 0。 */
    grid-template-rows: auto auto minmax(0, 1fr);
    max-width: 1480px;
    margin: 0 auto;
    background: var(--bg);
    border-left: 1px solid var(--outline);
    border-right: 1px solid var(--outline);
  }
  .app-header {
    grid-area: 1 / 1 / 2 / 3;
    padding: 16px 26px 14px;
    border-bottom: 1px solid var(--outline);
  }
  .app-title { font-size: 20px; }
  .app-notice { grid-area: 2 / 1 / 3 / 3; }
  .app-body {
    grid-area: 3 / 2 / 4 / 3;
    padding: 28px 36px 48px;
  }

  /* 底部 tab 栏 → 左侧导航栏（同一份 DOM，只改排法） */
  .app-nav {
    grid-area: 3 / 1 / 4 / 2;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 20px 14px;
    border-top: 0;
    border-right: 1px solid var(--outline);
    background: var(--surface);
    overflow-y: auto;
  }
  .nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14.5px;
    letter-spacing: .06em;
  }
  .nav-btn.active { color: var(--primary-text); background: color-mix(in srgb, var(--primary) 10%, transparent); }
  /* 「我的」上的未读红点：从图标右上角挪到行尾 */
  .nav-btn .nav-dot { position: static; margin-left: auto; top: auto; }

  /* Ta 沉浸态、卷宗对话满屏（thread-mode，chat.js markThreadShell）：这两种状态都会把
     页眉与导航藏起来（display:none），grid 留着就空出那 216px 左列——聊天内容会整体
     偏右、左边一条死区。这两种状态下退回单列满宽（对话自己限宽 860 居中）。 */
  .app-shell.ta-mode,
  .app-shell.thread-mode { display: flex; flex-direction: column; max-width: none; border: 0; }

  /* ---------- 内容宽度：别把一行文字拉到 1400px ---------- */
  .app-body .stack { max-width: 1080px; margin-inline: auto; width: 100%; }
  /* 对话页：消息与输入框限宽居中（阅读行宽） */
  .app-body.body-thread .thread-wrap { max-width: 860px; margin: 0 auto; width: 100%; }
  /* 入梦会话页：剧本流同样限宽——1190px 一行旁白没法读 */
  .app-body .dream-stage { max-width: 860px; margin: 0 auto; width: 100%; }

  /* ---------- 列表：一行一条 → 多列卡片 ---------- */
  .cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .cast-item.char-card {
    border: 1px solid var(--outline);
    border-radius: var(--r-card);
    background: var(--surface);
  }
  .cast-item.char-card + .cast-item.char-card { border-top: 1px solid var(--outline); }
  .dream-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
  .acc-sections { max-width: 900px; }
  .dust-wrap { max-width: 900px; }

  /* ---------- 悬停反馈见文件末尾「仅悬停指针」段 ----------
     上面这条大屏骨架现在按宽度生效（触屏大屏也要两栏），
     :hover 规则必须挪到 (hover:hover) 里，否则 iPad 点一下会留下粘住的悬停底色。 */

  /* ---------- 弹层与全屏页：贴着内容区右边走，别压住左侧导航 ----------
     只在"侧栏可见"时成立：Ta/梦信沉浸页（body[data-ta-mode="1"]）里侧栏是藏掉的，
     浮层再缩进 216px 会和内容错开，所以用 body 状态把沉浸态摘出去（回落到默认的 left:0）。 */
  body:not([data-ta-mode='1']) .sheet-overlay { left: var(--side-w); }
  body:not([data-ta-mode='1']) .wx-as-root { left: var(--side-w); }
  body:not([data-ta-mode='1']) .wx-rp-page,
  body:not([data-ta-mode='1']) .wx-tr-page { left: var(--side-w); border-radius: 0; box-shadow: none; }

  /* ---------- 梦信系沉浸页（keepShell）：微信 UI 按手机宽度设计 ----------
     壳还在的时候它们是 390px 框；壳撤了不能跟着拉到 1262px——桌面下居中一条窄列，
     两侧留沉浸底色（桌面版微信本来也就是窄列）。ta-fullscreen 的真全屏页（Ta 单聊）
     不管：它以前就是全宽，现在也全宽。 */
  body:not(.ta-fullscreen)[data-ta-mode='1'] .app-shell.ta-mode .app-body .ta-wechat {
    max-width: 430px; margin: 0 auto; width: 100%; height: 100%;
    border-left: 1px solid var(--wx-sep); border-right: 1px solid var(--wx-sep);
  }
  /* 沉浸列里的全屏页（转账/红包）：跟着缩成同一条窄列，别满屏 */
  body:not(.ta-fullscreen)[data-ta-mode='1'] .wx-tr-page,
  body:not(.ta-fullscreen)[data-ta-mode='1'] .wx-rp-page {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(430px, 100%); top: 0; bottom: 0; height: auto;
    border-radius: 0; box-shadow: none;
  }
  /* 沉浸列里的底部动作面板：同样居中收窄（动画要带着 translateX(-50%) 一起走，
     否则弹出瞬间会横跳——以前 wx-as-in-desk 就是干这个的，壳撤时误删了，这次补回来，
     但只在沉浸列里用；主站的面板已经跟着 .wx-as-root 走了，不需要它） */
  @keyframes wx-as-in-desk {
    from { transform: translateX(-50%) translateY(40%); opacity: .6; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
  }
  body:not(.ta-fullscreen)[data-ta-mode='1'] .wx-action-sheet {
    left: 50%; right: auto; width: min(430px, 100%);
    transform: translateX(-50%);
    animation-name: wx-as-in-desk;
  }
  /* 通用底部 sheet（梦信「我 → 性别」那类小选择器）：同样居中收窄。
     它的动画 sheet-up 只动 translateY，这里要带着 translateX(-50%) 一起走，
     否则弹出瞬间会横跳——跟上面 wx-as-in-desk 同一个道理。遮罩本身不用动：
     沉浸态下侧栏是藏掉的，全屏遮罩正好当调暗。 */
  @keyframes sheet-up-desk {
    from { transform: translateX(-50%) translateY(40%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
  }
  body:not(.ta-fullscreen)[data-ta-mode='1'] .sheet {
    left: 50%; right: auto; width: min(430px, 100%);
    transform: translateX(-50%);
    animation-name: sheet-up-desk;
  }

  /* Ta 全屏（沉浸态）：外侧留的边距全部让位 */
  body.ta-fullscreen .app-shell { border: 0; max-width: none; }
  body.ta-fullscreen .app-body { padding: 0; }
}

/* PWA「添加到主屏幕」：无论屏幕多宽一律满屏，绝不套手机壳。
   这条是给 iPad / 横屏手机准备的兜底——它们是触屏但带上鼠标（妙控键盘/台前调度）时
   可能报 hover:hover，指针条件就兜不住了；而"从主屏幕打开"本来就是 App 形态，不该有壳。 */
@media (display-mode: standalone) {
  .phone, .phone-stage { display: contents !important; }
}

/* 每日小记半屏（dailies.js，新旧大厅共用，样式只放这里一份） */
.dailies-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: rgba(38, 34, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 90;
}
.dailies-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #FBF7EF;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.dailies-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid #EBDFC9;
}
.dailies-title { font-size: 16px; font-weight: 700; color: #26222A; }
.dailies-sub { font-size: 11px; color: #8A7B6E; margin-top: 2px; }
.dailies-close { flex-shrink: 0; }
.dailies-body { overflow-y: auto; padding: 12px 14px 20px 14px; -webkit-overflow-scrolling: touch; }
.dailies-loading, .dailies-empty {
  padding: 22px 6px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: #8A7B6E;
}
.dailies-list { display: flex; flex-direction: column; gap: 8px; }
.dailies-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #EBDFC9;
  border-radius: 12px;
  background: #FFFDF8;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.dailies-row:active { transform: scale(0.985); }
.dailies-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #E8DCCB;
  flex-shrink: 0;
}
.dailies-avatar-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #8A7B6E;
}
.dailies-row-name { flex: 1; font-size: 14px; font-weight: 600; color: #26222A; }
.dailies-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.dailies-badge.on { background: #E7F6E9; color: #2E7D43; }
.dailies-badge.wait { background: #FFF3DC; color: #9A6B1F; }
.dailies-badge.mute { background: #F1EDE6; color: #9A938A; }
.dailies-back { align-self: flex-start; margin-bottom: 8px; }
.dailies-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dailies-detail-name { font-size: 16px; font-weight: 700; color: #26222A; }
.dailies-sec { margin-top: 12px; }
.dailies-sec-title { font-size: 12px; letter-spacing: 2px; color: #9A6B1F; margin-bottom: 8px; }
.dailies-card {
  border: 1px solid #EBDFC9;
  border-radius: 12px;
  background: #FFFDF8;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.dailies-card-date { font-size: 11px; color: #9A938A; }
.dailies-card-title { font-size: 15px; font-weight: 700; color: #26222A; margin: 2px 0 6px 0; }
.dailies-card-body { font-size: 13.5px; line-height: 1.75; color: #3D3742; }
.dailies-card-quote { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: #7D5A2E; }
.dailies-jump { margin-top: 4px; width: 100%; }
.dailies-lock {
  border: 1px dashed #D8BE8E;
  border-radius: 12px;
  background: #FFF9EE;
  padding: 14px 13px;
  text-align: center;
}
.dailies-lock-title { font-size: 14px; font-weight: 700; color: #26222A; }
.dailies-lock-sub { font-size: 12px; line-height: 1.7; color: #8A7B6E; margin: 6px 0 10px 0; }
.dailies-invite-btn { width: 100%; }

.bond-text {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 15px; line-height: 1.9;
  color: var(--on-bg);
}

.weave-status {
  font-size: 12px; line-height: 1.6;
  color: var(--on-surface-variant);
  min-height: 16px;
}
.weave-status.ok { color: var(--tertiary); }
.weave-status.error { color: var(--error); }

/* ---------- 聊天图片（附件选择 + 消息气泡渲染）---------- */
.attach-btn {
  flex-shrink: 0; align-self: center;
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: transparent; color: var(--on-surface-variant);
  font-size: 18px; line-height: 1; cursor: pointer;
  /* 触达（2026-10-19）：视觉 38px 圆形（再大就压不住输入栏那一行的比例），
     命中面补到 44px。输入栏不是横滚容器，::after 不会被裁。 */
  position: relative;
}
.attach-btn::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
.attach-btn:hover { background: var(--surface); }
.attach-btn:disabled { opacity: .5; cursor: default; }

/* ---------- 按住说话（语音输入）---------- */
/* touch-action:user-select 全压掉：长按默认会弹系统选择菜单并触发页面滚动，录音会中途断 */
.voice-btn {
  flex-shrink: 0; align-self: center;
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: transparent; color: var(--on-surface-variant);
  font-size: 18px; line-height: 1; cursor: pointer;
  touch-action: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, transform .12s;
}
.voice-btn:hover { background: var(--surface); }
.voice-btn.is-rec {
  background: var(--error); color: #fff; font-size: 13px; font-weight: 600;
  animation: voice-pulse 1.1s ease-in-out infinite;
}
/* 手指滑出按钮 = 取消：先变灰给反馈，不直接停，滑回来还能继续录 */
.voice-btn.is-cancel { filter: grayscale(1); transform: scale(.92); }
.voice-btn.is-busy { opacity: .55; cursor: progress; }
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 86, 62, .45); }
  50% { box-shadow: 0 0 0 7px rgba(179, 86, 62, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-btn.is-rec { animation: none; }
}
.img-preview {
  position: absolute; bottom: calc(100% + 8px); left: 12px;
  display: flex; align-items: flex-end; gap: 6px; z-index: 5;
}
.img-thumb {
  max-width: 120px; max-height: 120px; border-radius: 10px;
  border: 1px solid var(--outline); box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.img-remove {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.msg-img {
  display: block; max-width: min(260px, 72%);
  border-radius: 12px; margin: 2px 0; cursor: zoom-in;
  border: 1px solid var(--outline);
}
.msg-group.user .msg-img { margin-left: auto; }

.ta-gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ta-gender-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--outline);
  cursor: pointer; transition: border-color .15s, background .15s, transform .12s;
}
.ta-gender-btn.active { border-color: var(--primary); background: var(--surface-variant); box-shadow: inset 0 0 0 1px var(--primary); }
.ta-gender-btn:active { transform: scale(.97); }
.ta-gender-icon { font-size: 28px; line-height: 1; }
.ta-gender-label { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.ta-gender-sub { font-size: 11px; color: var(--on-surface-variant); }


/* ---------- Ta 微信式单会话（沉浸全屏，对齐微信官方 WeUI 设计令牌） ---------- */
.app-shell.ta-mode .app-nav,
.app-shell.ta-mode .app-header { display: none; }
/* Ta 沉浸态：壳内背景与聊天区对齐，避免顶部听筒让位区（padding-top 34px）透出页面底色形成"白边"；
   同时切断 overscroll 链（滚动到消息顶/底不再回弹出底色） */
.app-shell.ta-mode { background: #EDEDED; }
.app-shell.ta-mode .app-body { padding: 0; overflow: hidden; min-height: 0; }
@media (prefers-color-scheme: dark) {
  .app-shell.ta-mode { background: #111111; }
}
.ta-wechat {
  position: relative;
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  background: var(--wx-bg);
}
@media (prefers-color-scheme: dark) {
  .ta-wechat { background: #111111; }
}
/* ---------- 梦信配色令牌（微信式）：深色模式由「我 → 深色模式」独立控制 ----------
   data-wx-theme=dark/light 显式设置；auto（无标记）走系统 prefers-color-scheme。
   与半梦主题（data-theme）互不影响。
   令牌同时挂 body：action sheet / 搜索弹层等挂在 document.body 的面板不在
   .ta-wechat 子树内，只在容器上定义会令 var() 全部失效（面板透明裸文本）。 */
.ta-wechat,
body {
  --wx-bg: #EDEDED; --wx-page: #FFFFFF; --wx-bar: #F7F7F7; --wx-bar-alpha: rgba(247, 247, 247, 0.94);
  --wx-cell: #FFFFFF; --wx-text: #191919; --wx-text2: #999999; --wx-text3: #B2B2B2;
  --wx-sep: rgba(0, 0, 0, 0.06); --wx-press: #E5E5E5; --wx-avatar-ph: #C8C8CC;
  --wx-bubble-ta: #FFFFFF; --wx-bubble-user: #95EC69; --wx-bubble-user-text: rgba(0, 0, 0, 0.9);
  --wx-link: #576B95; color-scheme: light;
}
html[data-wx-theme='dark'] .ta-wechat,
html[data-wx-theme='dark'] body {
  --wx-bg: #111111; --wx-page: #111111; --wx-bar: #1E1E1E; --wx-bar-alpha: rgba(30, 30, 30, 0.94);
  --wx-cell: #1E1E1E; --wx-text: rgba(255, 255, 255, 0.92); --wx-text2: #8D8D8D; --wx-text3: #6E6E6E;
  --wx-sep: rgba(255, 255, 255, 0.08); --wx-press: rgba(255, 255, 255, 0.08); --wx-avatar-ph: #3A3A3A;
  --wx-bubble-ta: #2C2C2C; --wx-bubble-user: #3EB575; --wx-bubble-user-text: rgba(255, 255, 255, 0.95);
  --wx-link: #7D90B5; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-wx-theme='light']) .ta-wechat,
  html:not([data-wx-theme='light']) body {
    --wx-bg: #111111; --wx-page: #111111; --wx-bar: #1E1E1E; --wx-bar-alpha: rgba(30, 30, 30, 0.94);
    --wx-cell: #1E1E1E; --wx-text: rgba(255, 255, 255, 0.92); --wx-text2: #8D8D8D; --wx-text3: #6E6E6E;
    --wx-sep: rgba(255, 255, 255, 0.08); --wx-press: rgba(255, 255, 255, 0.08); --wx-avatar-ph: #3A3A3A;
    --wx-bubble-ta: #2C2C2C; --wx-bubble-user: #3EB575; --wx-bubble-user-text: rgba(255, 255, 255, 0.95);
    --wx-link: #7D90B5; color-scheme: dark;
  }
}
/* 壳底色跟随 wx 主题（overscroll 透出时不穿帮） */
html[data-wx-theme='dark'] .app-shell.ta-mode { background: #111111; }
html[data-wx-theme='light'] .app-shell.ta-mode { background: #EDEDED; }
/* 梦信顶栏/时间胶囊/头像底：跟随 wx 主题 */
.wx-light .ta-wechat-header {
  background: var(--wx-bar-alpha); border-bottom-color: var(--wx-sep);
}
.wx-light .ta-wechat-header .ta-wx-name,
.wx-light .ta-wechat-header .ta-wx-back,
.wx-light .ta-wechat-header .ta-wx-more { color: var(--wx-text); }
.wx-light .ta-time { color: var(--wx-text3); }
.wx-light .ta-avatar { background-color: var(--wx-avatar-ph); }
.ta-wechat-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 0;
  /* 顶部安全区：min-height 吸收 env，内容下移至安全区下方；桌面 env 为 0 保持 50px */
  min-height: 50px;
  min-height: calc(50px + env(safe-area-inset-top));
  padding: 0 8px;
  padding: env(safe-area-inset-top) 8px 0;
  /* 微信导航栏材质（WeUI MATERIAL_NAVIGATIONBAR）：半透明 + 毛玻璃，消息从其下滚过 */
  background: rgba(237, 237, 237, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
@media (prefers-color-scheme: dark) {
  .ta-wechat-header { background: rgba(18, 18, 18, 0.9); border-color: rgba(255, 255, 255, 0.15); }
}
/* 微信聊天页顶栏只有居中标题（无头像/副标题）：两侧按钮各 44px，flex:1 标题几何居中 */
.ta-wechat-header .ta-wx-name {
  flex: 1; min-width: 0; text-align: center;
  font-weight: 600; font-size: 17px; line-height: 1.2;
  color: rgba(0, 0, 0, 0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .ta-wechat-header .ta-wx-name { color: rgba(255, 255, 255, 0.8); }
}
/* 微信聊天页右上角「⋯」与左上角返回键：44px 触区、图标居中 */
.ta-wechat-header .ta-wx-more,
.ta-wechat-header .ta-wx-back {
  width: 44px; height: 44px; margin: 0 -6px; border-radius: 8px;
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; color: #1F2329;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ta-wechat-header .ta-wx-more:active,
.ta-wechat-header .ta-wx-back:active { background: rgba(0,0,0,.06); }
@media (prefers-color-scheme: dark) {
  .ta-wechat-header .ta-wx-more,
  .ta-wechat-header .ta-wx-back { color: rgba(255, 255, 255, 0.8); }
  .ta-wechat-header .ta-wx-more:active,
  .ta-wechat-header .ta-wx-back:active { background: rgba(255,255,255,.08); }
}
.ta-thread {
  flex: 1; min-height: 0; overflow-y: auto;
  /* 顶栏改为覆盖式毛玻璃：滚动区从其下穿过，这里补出内容起始位 */
  padding: 58px 12px 20px;
  padding: calc(58px + env(safe-area-inset-top)) 12px 20px;
  background: #EDEDED; background-size: cover; background-position: center; background-repeat: no-repeat;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* 滚到顶/底不回弹外层，消除"滑滑的"橡皮筋感 */
}
@media (prefers-color-scheme: dark) {
  .ta-thread { background-color: #111111; } /* 只改底色：写 background 简写会把下面的 size / position 重置回 auto（聊天背景因此不再铺满居中） */
}
.ta-thread.has-bg { background-color: #EDEDED; }
/* 微信式消息时间胶囊：居中灰字（无边框，微信原生样式，FG-2 令牌） */
.ta-time {
  text-align: center; font-size: 11px; color: rgba(0, 0, 0, 0.3); line-height: 1.4;
  margin: 16px auto 8px; max-width: 80%;
  white-space: pre-wrap; word-break: break-word;
}
@media (prefers-color-scheme: dark) {
  .ta-time { color: rgba(255, 255, 255, 0.3); }
}
/* 旁白/系统条：微信系统消息同款——去斜体，小号灰字 */
.ta-system {
  text-align: center; font-size: 12px; color: rgba(0, 0, 0, 0.3); margin: 12px auto 6px;
  line-height: 1.6; max-width: 80%; letter-spacing: .01em;
}
@media (prefers-color-scheme: dark) {
  .ta-system { color: rgba(255, 255, 255, 0.3); }
}
/* 消息行：换方间距 16px，同方连续（.cont）收紧到 4px——微信分组节奏 */
.ta-msg { display: flex; gap: 8px; margin: 16px 0 0; width: 100%; align-items: flex-start; }
.ta-msg.cont { margin-top: 4px; }
/* 用户消息：row-reverse 主轴起点在视觉右侧，flex-start 才能把头像贴右缘（flex-end 会推到左边） */
.ta-msg.user { justify-content: flex-start; flex-direction: row-reverse; }
.ta-msg.ta { justify-content: flex-start; }
.ta-msg .ta-bubble .msg-img {
  max-height: 320px; /* 超长截图限高，避免撑爆气泡 */
}
.ta-msg .ta-bubble {
  position: relative; max-width: 68%; min-width: 0;
  padding: 9px 12px; border-radius: var(--ta-r); font-size: calc(17px * var(--chat-scale, 1)); line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  /* 禁长按选择/系统菜单：长按已让位给微信式胶囊菜单 */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* 「选择文字」态（2026-10-20 建议单 3d7ac0a5「可以像dp一样直接文字复制吗」）
   —— 只有被点中、且点了菜单里「选择文字」的**那一个**气泡会带上这个 class。
   ⚠️ 不要把这几个属性挪到 .ta-bubble 上：长按会被系统选择菜单抢走，
      app.css 里 4408 那条注释记着当年的坑（长按弹系统菜单 + 页面滚动，录音都断）。
   ⚠️ 必须把 -webkit-touch-callout 改回 default：iOS 上它是"长按是否弹系统菜单"的开关，
      留 none 的话即使能选中也不会出现「拷贝」气泡按钮，用户选完没法复制。 */
.ta-msg .ta-bubble.wx-text-select {
  -webkit-touch-callout: default;
  -webkit-user-select: text; user-select: text;
  /* 选择态给个视觉提示（不然用户不知道可以拖了）；用 outline 不占布局，不推动气泡 */
  outline: 2px solid var(--primary, #CC785C); outline-offset: 1px;
}
/* 选中文字的高亮：默认蓝在绿色气泡上偏脏，这里统一成主题色淡底 */
.ta-msg .ta-bubble.wx-text-select ::selection,
.ta-msg .ta-bubble.wx-text-select::selection { background: rgba(204, 120, 92, .35); }
/* 卷宗 / 入梦 / Ta / 群聊共用同一套局部选字态。只给当前正文节点加 class，
   不放开整页 user-select，避免系统选择菜单抢走长按与录音手势。 */
.msg-bubble.bm-text-select,
.scene-block.bm-text-select,
.dream-line.bm-text-select,
.dream-line-body.bm-text-select,
.ta-msg .ta-bubble.bm-text-select,
.wx-narr.bm-text-select {
  -webkit-touch-callout: default;
  -webkit-user-select: text; user-select: text;
  cursor: text;
  outline: 2px solid var(--primary, #CC785C); outline-offset: 1px;
}
.msg-bubble.bm-text-select ::selection,
.scene-block.bm-text-select ::selection,
.dream-line.bm-text-select ::selection,
.dream-line-body.bm-text-select ::selection,
.ta-msg .ta-bubble.bm-text-select ::selection,
.wx-narr.bm-text-select ::selection,
.msg-bubble.bm-text-select::selection,
.scene-block.bm-text-select::selection,
.dream-line.bm-text-select::selection,
.dream-line-body.bm-text-select::selection,
.ta-msg .ta-bubble.bm-text-select::selection,
.wx-narr.bm-text-select::selection {
  background: rgba(204, 120, 92, .35);
}
.ta-msg.user .ta-bubble { background: #95EC69; color: rgba(0, 0, 0, 0.9); border-radius: var(--ta-r) var(--ta-tail) var(--ta-r) var(--ta-r); margin-left: 12px; }
.ta-msg.user .ta-bubble::after {
  content: ""; position: absolute; right: -5px; top: 13px; width: 0; height: 0;
  border: 5px solid transparent; border-left-color: #95EC69; border-right: none;
}
.ta-msg.ta .ta-bubble { background: #FFFFFF; color: rgba(0, 0, 0, 0.9); border-radius: var(--ta-tail) var(--ta-r) var(--ta-r) var(--ta-r); margin-right: 12px; }
/* 表情包气泡：透明背景，图片居中（Ta 和用户共用；提高特异性压过明暗气泡底色） */
.ta-msg.user .ta-bubble.ta-sticker,
.ta-msg.ta .ta-bubble.ta-sticker { background: transparent; padding: 4px; text-align: center; }
.ta-msg .ta-bubble.ta-sticker .ta-sticker-img { width: 64px; height: 64px; display: block; margin: 0 auto; object-fit: contain; }
.ta-msg.ta .ta-bubble::after {
  content: ""; position: absolute; left: -5px; top: 13px; width: 0; height: 0;
  border: 5px solid transparent; border-right-color: #FFFFFF; border-left: none;
}
/* 表情包气泡去掉小尾巴箭头（透明背景不需要） */
.ta-msg .ta-bubble.ta-sticker::after { display: none; }
@media (prefers-color-scheme: dark) {
  .ta-msg.user .ta-bubble { background: #3EB575; color: rgba(0, 0, 0, 0.9); }
  .ta-msg.user .ta-bubble::after { border-left-color: #3EB575; }
  .ta-msg.ta .ta-bubble { background: #2C2C2C; color: rgba(255, 255, 255, 0.8); }
  .ta-msg.ta .ta-bubble::after { border-right-color: #2C2C2C; }
}
/* 新消息到达：整条淡入（微信式），替代逐字流式 */
.ta-msg.arrive { animation: ta-bubble-in .18s ease-out; }
@keyframes ta-bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ta-msg.arrive { animation: none; }
}
/* 对方正在输入：三点跳动（替代静态文字） */
.ta-bubble.ta-typing {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; min-width: 44px; min-height: 20px; padding: 11px 14px;
}
.ta-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #C9C9C9;
  animation: ta-typing-bounce 1.2s ease-in-out infinite;
}
.ta-typing span:nth-child(2) { animation-delay: .15s; }
.ta-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ta-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ta-typing span { animation: none; opacity: .6; }
}
/* 头像：微信 40px 方形 5px 圆角 */
.ta-msg .ta-avatar {
  width: 40px; height: 40px; border-radius: 5px; flex-shrink: 0; margin-top: 0;
  background-size: cover; background-position: center top; background-color: #D9D9D9;
  border: none; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ta-msg .ta-avatar svg { width: 100%; height: 100%; display: block; }
.ta-msg.user .ta-avatar { background-color: #07C160; }
.ta-msg.ta .ta-avatar { background-color: #C9B99A; }
/* 输入区：微信布局——白底圆角输入框 + ＋号 + 内容出现时绿色「发送」 */
/* 待发送图片预览：在 Ta 页内随文档流显示在输入区上方（微信同款位置） */
.ta-wechat > .img-preview { position: static; padding: 6px 12px 0; background: transparent; }
.ta-composer {
  position: relative;
  display: flex; gap: 6px; align-items: flex-end; padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: #F7F7F7; border-top: 1px solid rgba(0, 0, 0, 0.1); flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .ta-composer { background: rgba(35, 35, 35, 0.93); border-color: rgba(255, 255, 255, 0.15); }
}
.ta-composer textarea {
  flex: 1; min-height: 38px; max-height: 110px; padding: 8px 10px;
  border: none; border-radius: 6px; background: #fff;
  font-size: calc(16px * var(--chat-input-scale, 1)); line-height: 1.4; resize: none; outline: none;
  font-family: inherit; color: rgba(0, 0, 0, 0.9);
}
.ta-composer .ta-wx-input-shell {
  flex: 1; min-width: 0; position: relative;
  display: flex; align-items: flex-end;
}
.ta-composer .ta-wx-input-shell textarea {
  width: 100%; padding-right: 38px;
}
.ta-composer textarea::placeholder { color: rgba(0, 0, 0, 0.3); }
@media (prefers-color-scheme: dark) {
  .ta-composer textarea { background: #2C2C2C; color: rgba(255, 255, 255, 0.8); }
  .ta-composer textarea::placeholder { color: rgba(255, 255, 255, 0.3); }
}
.ta-composer .ta-wx-plus {
  width: 38px; height: 38px; border-radius: 6px; background: transparent; border: none; color: #1F2329;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ta-composer .ta-wx-ai {
  position: absolute; right: 4px; bottom: 4px;
  width: 28px; height: 30px; border-radius: 6px; background: transparent; border: none; color: var(--wx-link, #576B95);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; padding: 0; z-index: 1;
}
.ta-composer .ta-wx-ai svg { width: 22px; height: 22px; }
.ta-composer .ta-wx-ai.is-on { background: var(--wx-sep); }
.ta-composer .ta-wx-ai:active { background: var(--wx-sep); }
.ta-composer .ta-wx-plus:active { background: rgba(0,0,0,.06); }
.ta-composer .ta-wx-emoji {
  width: 38px; height: 38px; border-radius: 6px; background: transparent; border: none; color: #1F2329;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 22px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.ta-composer .ta-wx-emoji:active { background: rgba(0,0,0,.06); }
/* 梦信 / Ta 悬浮球里的「按住说话」：贴齐微信式按钮尺寸（聊天页那套是 38px 圆底） */
.ta-composer .voice-btn.ta-wx-voice {
  width: 38px; height: 38px; border-radius: 6px; background: transparent; border: none; color: #1F2329;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 21px; line-height: 1; -webkit-tap-highlight-color: transparent;
}
.ta-composer .voice-btn.ta-wx-voice:active { background: rgba(0,0,0,.06); }
.ta-composer .voice-btn.ta-wx-voice.is-rec {
  background: var(--error); color: #fff; font-size: 13px; font-weight: 600; border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  .ta-composer .ta-wx-plus { color: rgba(255, 255, 255, 0.8); }
  .ta-composer .ta-wx-plus:active { background: rgba(255,255,255,.08); }
  .ta-composer .ta-wx-emoji { color: rgba(255, 255, 255, 0.8); }
  .ta-composer .ta-wx-emoji:active { background: rgba(255,255,255,.08); }
}
/* 绿色「发送」/红色「停止」按钮（微信发送键样式） */
.ta-composer .ta-wx-send {
  height: 34px; padding: 0 7px; border-radius: 5px; background: #07C160; color: #fff;
  border: none; font-size: 12px; font-weight: 500; font-family: inherit;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* 有字时「发送」叠在「＋」的位上（微信同款），**不占布局宽度**。
     工单 4a1afb80（V2506A / 视口 327×390）：以前「＋」和「发送」同时占位，
     输入框从 223px 掉到 161px（-28%），字挤成一条竖线；窄屏上尤其明显。
     宽度按「＋」那一格来（38px），不压到左边的表情键。
     ⚠️ 代价（微信同款）：有字时「＋」被盖住 ⇒ 打字期间开不了相册/红包面板，
        要开先把字删掉；面板右下角自带「发送」，不影响发图。 */
  position: absolute; right: 8px; bottom: calc(7px + env(safe-area-inset-bottom));
  z-index: 2;
}
.ta-composer .ta-wx-send:active { background: #06AD56; }
.ta-composer .ta-wx-send.is-stop { background: #FA5151; }
.ta-composer .ta-wx-send.is-stop:active { background: #E04848; }
/* ＋号面板：微信安卓版底部九宫格（只放真实功能），＋号键弹出 */
.ta-plus-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 29; background: transparent; }
.ta-plus-panel {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 30;
  background: #F7F7F7; border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 280px;
  margin: 0 auto;
  animation: ta-sheet-in .18s ease-out;
}
@keyframes ta-sheet-in {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ta-plus-panel { animation: none; }
}
@media (prefers-color-scheme: dark) {
  .ta-plus-panel { background: #1E1E1E; border-color: rgba(255, 255, 255, 0.1); }
}
.ta-plus-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: none; background: transparent; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.ta-plus-item .ta-plus-ico {
  width: 60px; height: 60px; border-radius: 12px; background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex; align-items: center; justify-content: center; color: #1F2329;
}
@media (prefers-color-scheme: dark) {
  .ta-plus-item .ta-plus-ico { background: #2C2C2C; border-color: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.8); }
}
.ta-plus-item:active .ta-plus-ico { background: #E5E5E5; }
@media (prefers-color-scheme: dark) {
  .ta-plus-item:active .ta-plus-ico { background: #404040; }
}
.ta-plus-item .ta-plus-txt { font-size: 12px; color: rgba(0, 0, 0, 0.55); font-family: inherit; margin-top: 2px; }
@media (prefers-color-scheme: dark) {
  .ta-plus-item .ta-plus-txt { color: rgba(255, 255, 255, 0.5); }
}
/* 表情面板：微信式底部网格，遮罩 + 弹层 */
.ta-sticker-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 29; background: transparent; }
.ta-sticker-panel {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 30;
  background: #F7F7F7; border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px 12px calc(14px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 340px;
  margin: 0 auto;
  /* 贴纸多（100+）：面板限高内部滚动，不再把输入条顶出屏幕 */
  max-height: min(45vh, 320px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: ta-sheet-in .18s ease-out;
}
.ta-sticker-item {
  width: 100%; aspect-ratio: 1; padding: 0; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 8px; -webkit-tap-highlight-color: transparent;
}
.ta-sticker-item:active { background: rgba(0, 0, 0, 0.06); }
.ta-sticker-item img { width: 100%; height: 100%; object-fit: contain; }
@media (prefers-color-scheme: dark) {
  .ta-sticker-panel { background: #1E1E1E; border-color: rgba(255, 255, 255, 0.1); }
  .ta-sticker-item:active { background: rgba(255, 255, 255, 0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .ta-sticker-panel { animation: none; }
}
/* 语音键与按住说话条（安卓微信语法） */
.ta-wx-voice {
  width: 38px; height: 38px; border-radius: 6px; background: transparent; border: none; color: #1F2329;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ta-wx-voice:active { background: rgba(0, 0, 0, 0.06); }
@media (prefers-color-scheme: dark) {
  .ta-wx-voice { color: rgba(255, 255, 255, 0.8); }
  .ta-wx-voice:active { background: rgba(255, 255, 255, 0.08); }
}
.ta-hold-bar {
  flex: 1; min-height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 6px;
  font-size: 16px; font-weight: 500; color: rgba(0, 0, 0, 0.9);
  user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer;
  transition: background .12s ease;
}
.ta-hold-bar.holding { background: #C9C9C9; }
@media (prefers-color-scheme: dark) {
  .ta-hold-bar { background: #2C2C2C; color: rgba(255, 255, 255, 0.8); }
  .ta-hold-bar.holding { background: #404040; }
}
/* 按住说话浮层：中央黑色毛玻璃卡片（松开发送/上滑取消/识别中） */
.ta-hold-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ta-hold-card {
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 14px; padding: 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 210px;
}
.ta-hold-main { color: #fff; font-size: 16px; font-weight: 600; }
.ta-hold-sub { color: rgba(255, 255, 255, 0.6); font-size: 12px; min-height: 14px; }
.ta-hold-txt { color: rgba(255, 255, 255, 0.8); font-size: 13px; }
.ta-hold-card .ta-typing span { background: rgba(255, 255, 255, 0.7); }
.ta-menu {
  position: fixed; z-index: 90;
  display: flex; flex-wrap: wrap; overflow: hidden;
  max-width: calc(100vw - 16px);
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 8px;
}
.ta-menu::after {
  content: ''; position: absolute; left: 50%; margin-left: -6px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
}
.ta-menu.above::after { bottom: -6px; border-top: 6px solid rgba(0, 0, 0, 0.75); }
.ta-menu.below::after { top: -6px; border-bottom: 6px solid rgba(0, 0, 0, 0.75); }
.ta-menu button {
  border: none; background: transparent; cursor: pointer;
  color: #fff; font-size: 14px; font-family: inherit;
  padding: 10px 18px; display: flex; align-items: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.ta-menu button + button { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.ta-menu button { white-space: nowrap; }
.ta-menu button:active { background: rgba(255, 255, 255, 0.1); }
.ta-menu-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 89; background: transparent; }
/* Ta 个人页：微信「个人信息」版式——#EDEDED 底 + 通栏白色分组块 + 行内右对齐值 */
.ta-profile-page {
  position: relative;
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  background: #EDEDED;
}
@media (prefers-color-scheme: dark) {
  .ta-profile-page { background: #111111; }
}
.ta-profile-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: calc(58px + env(safe-area-inset-top)) 0 24px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ta-wx-group { background: #fff; margin-top: 8px; }
@media (prefers-color-scheme: dark) {
  .ta-wx-group { background: #1E1E1E; }
}
.ta-wx-cell {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 8px 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ta-wx-cell + .ta-wx-cell { border-top: 1px solid rgba(0, 0, 0, 0.05); }
@media (prefers-color-scheme: dark) {
  .ta-wx-cell + .ta-wx-cell { border-color: rgba(255, 255, 255, 0.08); }
}
.ta-wx-cell:active { background: rgba(0, 0, 0, 0.04); }
@media (prefers-color-scheme: dark) {
  .ta-wx-cell:active { background: rgba(255, 255, 255, 0.06); }
}
.ta-wx-cell-label { font-size: 17px; color: rgba(0, 0, 0, 0.9); }
@media (prefers-color-scheme: dark) {
  .ta-wx-cell-label { color: rgba(255, 255, 255, 0.8); }
}
.ta-wx-cell-value {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: rgba(0, 0, 0, 0.55);
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .ta-wx-cell-value { color: rgba(255, 255, 255, 0.5); }
}
.ta-wx-chev { color: rgba(0, 0, 0, 0.3); font-size: 16px; }
@media (prefers-color-scheme: dark) {
  .ta-wx-chev { color: rgba(255, 255, 255, 0.3); }
}
.ta-wx-cell.danger { justify-content: center; color: #FA5151; font-size: 17px; }
.ta-wx-avatar-cell {
  width: 56px; height: 56px; border-radius: 5px; flex-shrink: 0;
  background-size: cover; background-position: center; background-color: #D9D9D9;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ta-wx-avatar-cell svg { width: 100%; height: 100%; display: block; }
.ta-wx-thumb {
  width: 44px; height: 30px; border-radius: 4px; flex-shrink: 0;
  background-size: cover; background-position: center; background-color: var(--surface-variant);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 微信模块·皮肤（微信 iOS 版式；颜色全部走 --wx-* 令牌，深色由 data-wx-theme 切换） ---------- */
.ta-wechat.wx-light { background: var(--wx-bg); }
.wx-light .ta-wechat-header { background: var(--wx-bar-alpha); border-bottom-color: var(--wx-sep); }
.wx-light .ta-wechat-header .ta-wx-name { color: var(--wx-text); }
.wx-light .ta-wechat-header .ta-wx-more,
.wx-light .ta-wechat-header .ta-wx-back { color: var(--wx-text); }
.wx-light .ta-wechat-header .ta-wx-more:active,
.wx-light .ta-wechat-header .ta-wx-back:active { background: var(--wx-press); }
/* 同上：只改底色。以前这里写成简写，梦信的聊天背景图被重置成 auto / 左上角 / 平铺，大图只露出左上角一块（2026-10-01 工单「聊天背景总是显示不全」） */
.wx-light .ta-thread { background-color: var(--wx-bg); }
.wx-light .ta-time { color: var(--wx-text3); }
.wx-light .ta-system { color: var(--wx-text3); }
.wx-light .ta-composer { background: var(--wx-bar); border-top-color: var(--wx-sep); }
.wx-light .ta-composer textarea { background: var(--wx-cell); color: var(--wx-text); }
.wx-light .ta-composer textarea::placeholder { color: var(--wx-text3); }
.wx-light .ta-composer .ta-wx-plus,
.wx-light .ta-composer .ta-wx-emoji,
.wx-light .ta-wx-voice { color: var(--wx-text); }
.wx-light .ta-composer .ta-wx-plus:active,
.wx-light .ta-composer .ta-wx-emoji:active,
.wx-light .ta-wx-voice:active { background: var(--wx-sep); }
.wx-light .ta-msg.user .ta-bubble { background: var(--wx-bubble-user); color: var(--wx-bubble-user-text); }
.wx-light .ta-msg.user .ta-bubble::after { border-left-color: var(--wx-bubble-user); }
.wx-light .ta-msg.ta .ta-bubble { background: var(--wx-cell); color: var(--wx-bubble-user-text); }
.wx-light .ta-msg.ta .ta-bubble::after { border-right-color: var(--wx-bubble-ta); }
.wx-light .ta-plus-panel,
.wx-light .ta-sticker-panel { background: var(--wx-bar); border-top-color: var(--wx-sep); }
.wx-light .ta-plus-item .ta-plus-ico { background: var(--wx-cell); border-color: var(--wx-sep); color: var(--wx-text); }
.wx-light .ta-plus-item:active .ta-plus-ico { background: var(--wx-press); }
.wx-light .ta-plus-item .ta-plus-txt { color: var(--wx-text2); }
.wx-light .ta-sticker-item:active { background: var(--wx-sep); }
.wx-light .ta-hold-bar { background: var(--wx-cell); color: var(--wx-bubble-user-text); }
.wx-light .ta-hold-bar.holding { background: var(--wx-text3); }
.wx-light .ta-profile-page { background: var(--wx-bg); }
.wx-light .ta-wx-group { background: var(--wx-cell); }
.wx-light .ta-wx-cell + .ta-wx-cell { border-top-color: var(--wx-sep); }
.wx-light .ta-wx-cell:active { background: var(--wx-press); }
.wx-light .ta-wx-cell-label { color: var(--wx-bubble-user-text); }
.wx-light .ta-wx-cell-value { color: var(--wx-text2); }
.wx-light .ta-wx-chev { color: var(--wx-text3); }

/* ---------- 微信主界面·会话列表（微信 iOS 版式：搜索条 + 白色分组块） ---------- */
.wx-search-bar {
  position: absolute; top: 50px; top: calc(50px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 9;
  padding: 7px 16px; background: var(--wx-bg);
}
.wx-search {
  display: flex; align-items: center; gap: 6px; height: 32px;
  background: var(--wx-cell); border-radius: 8px; padding: 0 10px;
}
.wx-search svg { flex-shrink: 0; color: var(--wx-text3); }
.wx-search input {
  flex: 1; min-width: 0; height: 100%;
  border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--wx-text); font-family: inherit;
}
.wx-search input::placeholder { color: var(--wx-text3); }
.wx-search-results { padding-bottom: 18px; }
.wx-search-section {
  padding: 9px 16px 4px; background: var(--wx-bg);
  color: var(--wx-text2); font-size: 12px;
}
.wx-search-results > .wx-sheet:first-of-type { margin-top: 0; }
.wx-search-function .wx-entry-icon { border-radius: 7px; }
.wx-search-function .wx-entry-icon svg { width: 22px; height: 22px; }
.wx-sheet { background: var(--wx-cell); }
.wx-sheet + .wx-sheet { margin-top: 8px; }
.wx-entry-cell {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; min-height: 56px; background: var(--wx-cell); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-entry-cell.danger { color: #FA5151; font-size: 16px; justify-content: center; }
.wx-entry-cell:active { background: var(--wx-press); }
.wx-entry-icon {
  width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0;
  background: #07C160; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.wx-entry-label { flex: 1; min-width: 0; font-size: 17px; color: var(--wx-text); }
.wx-chat-cell {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; min-height: 64px; background: var(--wx-cell); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease;
  user-select: none; -webkit-user-select: none; /* 左滑拖拽时防止选中文本 */
}
.wx-chat-cell:active { background: var(--wx-press); }
/* 左滑动作层：行底下的置顶/取消置顶按钮 */
.wx-swipe-item { position: relative; background: var(--wx-cell); overflow: hidden; }
.wx-swipe-item + .wx-swipe-item::before {
  content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px;
  background: var(--wx-sep); z-index: 2;
}
.wx-swipe-actions {
  position: absolute; top: 0; right: 0; bottom: 0; width: 152px;
  display: flex; z-index: 0;
}
.wx-swipe-btn {
  position: relative; width: 76px; height: 100%;
  border: none; cursor: pointer; font-family: inherit;
  background: #C8C9CD; color: #FFFFFF; font-size: 13px; line-height: 1.4;
  padding: 0 8px;
  -webkit-tap-highlight-color: transparent;
}
.wx-swipe-btn.wx-swipe-bg { right: 76px; background: #5B84C4; }
.wx-swipe-btn.is-pin { background: #FA9D3B; }
.wx-swipe-btn.is-unread { background: #8E8E93; }
.wx-avatar48 {
  width: 48px; height: 48px; border-radius: 5px; flex-shrink: 0;
  background-size: cover; background-position: center top; background-color: var(--wx-avatar-ph);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative; color: #FFFFFF; font-size: 18px;
}
.wx-avatar48 svg { width: 100%; height: 100%; display: block; }
.wx-chat-main { flex: 1; min-width: 0; }
.wx-chat-name {
  font-size: 17px; color: var(--wx-text); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wx-chat-preview {
  font-size: 14px; color: var(--wx-text2); margin-top: 2px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wx-chat-side {
  flex-shrink: 0; align-self: flex-start; padding-top: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.wx-chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.wx-chat-time { font-size: 12px; color: var(--wx-text3); }
.wx-mute-ico {
  width: 13px; height: 13px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--wx-text3); flex-shrink: 0;
}
.wx-mute-ico svg { width: 13px; height: 13px; display: block; }
.wx-chat-preview.has-draft { color: var(--wx-link); }
.wx-badge {
  position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px;
  box-sizing: border-box; padding: 0 4px;
  background: #FA5151; color: #FFFFFF; font-size: 11px; line-height: 17px;
  border-radius: 9px; text-align: center;
}
.wx-badge.is-dot {
  width: 10px; height: 10px; min-width: 10px; padding: 0;
  top: -2px; right: -3px; border-radius: 50%;
  border: 2px solid var(--wx-cell);
}
/* 头像角标 wrapper：不裁剪（avatar48 overflow:hidden 会裁掉悬出角外的红点） */
.wx-avatar-box { position: relative; flex-shrink: 0; }
.wx-contact-section { margin-top: 8px; }
.wx-contact-section-title {
  padding: 5px 16px; background: var(--wx-bg);
  font-size: 12px; line-height: 1.4; color: var(--wx-text2);
}
.wx-alpha-index {
  position: absolute; z-index: 12; right: 2px; top: calc(68px + env(safe-area-inset-top)); bottom: 76px;
  width: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: var(--wx-link); font-size: 10px; touch-action: none;
}
.wx-alpha-index button {
  width: 20px; min-height: 13px; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; line-height: 1.1; cursor: pointer;
}
.wx-alpha-index button:active { background: var(--wx-press); border-radius: 4px; }
.wx-me-main {
  padding-top: calc(26px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.wx-empty {
  padding: 90px 24px 0; text-align: center;
  font-size: 14px; color: var(--wx-text3); line-height: 1.9; white-space: pre-wrap;
}
.wx-friend-cell {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; min-height: 64px; background: var(--wx-cell);
  -webkit-tap-highlight-color: transparent;
}
.wx-friend-cell + .wx-friend-cell::before {
  content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px;
  background: var(--wx-sep);
}
.wx-friend-name { font-size: 16px; color: var(--wx-text); line-height: 1.3; }
.wx-friend-status { font-size: 12px; color: var(--wx-text2); margin-top: 2px; }
.wx-btn-accept {
  flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
  background: #07C160; color: #FFFFFF; font-size: 13px;
  padding: 6px 14px; border-radius: 4px; -webkit-tap-highlight-color: transparent;
  /* 触达（2026-10-19）：实测 31px。这三个（添加/删除/文字按钮）都排在
     好友申请行尾，行本身有高度，加高不会挤到邻行。 */
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.wx-btn-accept:active { background: #06AD56; }
.wx-btn-accept:disabled { opacity: 0.5; cursor: default; }
.wx-btn-ghost {
  flex-shrink: 0; cursor: pointer; font-family: inherit;
  background: var(--wx-cell); color: var(--wx-link); font-size: 13px;
  padding: 5px 12px; border-radius: 4px; border: 1px solid var(--wx-sep);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.wx-btn-ghost:active { background: var(--wx-sep); }
.wx-btn-text {
  flex-shrink: 0; cursor: pointer; font-family: inherit;
  background: transparent; border: none; color: var(--wx-link); font-size: 13px; padding: 6px 8px;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.wx-btn-text.danger { color: #FA5151; }

/* ---------- 导入聊天记录（蒸馏角色 · 记忆蒸馏舱） ---------- */
.wx-ds-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 16px 36px;
  box-sizing: border-box;
}

/* 顶部头图 / 导言区 */
.wx-ds-hero {
  margin: 12px 0 16px;
  padding: 20px 18px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(7, 193, 96, 0.08) 0%, rgba(87, 107, 149, 0.05) 100%), var(--wx-cell);
  border: 1px solid rgba(7, 193, 96, 0.16);
  position: relative;
  overflow: hidden;
}
.wx-ds-hero-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.wx-ds-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #07C160 0%, #10A37F 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.28);
  flex-shrink: 0;
}
.wx-ds-hero-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--wx-text);
  letter-spacing: -0.2px;
}
.wx-ds-hero-sub {
  font-size: 13px;
  line-height: 1.6;
  color: var(--wx-text2);
}
.wx-ds-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: #07C160;
  background: rgba(7, 193, 96, 0.1);
}

/* 分段切换器 (Tabs) */
.wx-ds-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--wx-sep);
}
.wx-dark .wx-ds-tabs {
  background: rgba(255, 255, 255, 0.05);
}
.wx-ds-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--wx-text2);
  border: none;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wx-ds-tab.active {
  background: var(--wx-cell);
  color: var(--wx-text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 文件上传拖拽区 */
.wx-ds-dropzone {
  border: 1.5px dashed var(--wx-sep);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  background: var(--wx-cell);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.wx-ds-dropzone:hover, .wx-ds-dropzone.dragover {
  border-color: #07C160;
  background: rgba(7, 193, 96, 0.03);
}
.wx-ds-drop-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}
.wx-ds-drop-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wx-text);
  margin-bottom: 4px;
}
.wx-ds-drop-sub {
  font-size: 12px;
  color: var(--wx-text3);
}
.wx-ds-formats {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.wx-ds-format-badge {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--wx-page);
  border: 1px solid var(--wx-sep);
  font-size: 10px;
  color: var(--wx-text2);
  font-family: monospace;
}

/* 已选文件卡片 */
.wx-ds-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.wx-ds-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(7, 193, 96, 0.12);
  color: #07C160;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.wx-ds-file-meta {
  flex: 1;
  min-width: 0;
}
.wx-ds-file-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wx-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-ds-file-details {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--wx-text3);
}
.wx-ds-enc-tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(7, 193, 96, 0.1);
  color: #07C160;
  font-weight: 500;
}
.wx-ds-clear-btn {
  padding: 6px 10px;
  font-size: 12px;
  color: #FA5151;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}
.wx-ds-clear-btn:active {
  background: rgba(250, 81, 81, 0.1);
}

/* 文本粘贴区 */
.wx-ds-text-box {
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s;
}
.wx-ds-text-box:focus-within {
  border-color: #07C160;
}
.wx-ds-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  max-height: 280px;
  border: none;
  background: transparent;
  color: var(--wx-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.wx-ds-textarea::placeholder {
  color: var(--wx-text3);
}
.wx-ds-text-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--wx-sep);
  font-size: 11px;
  color: var(--wx-text3);
}

/* 预检简报卡片 */
.wx-ds-preview {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(7, 193, 96, 0.05);
  border: 1px solid rgba(7, 193, 96, 0.18);
  animation: wxDsFadeIn 0.3s ease;
}
.wx-ds-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #07C160;
}
.wx-ds-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.wx-ds-stat-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--wx-cell);
  border: 1px solid rgba(7, 193, 96, 0.15);
  font-size: 11px;
  color: var(--wx-text);
}
.wx-ds-speaker-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--wx-text2);
}
.wx-ds-speaker-tag {
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  cursor: pointer;
  transition: all 0.15s;
}
.wx-ds-speaker-tag:hover {
  border-color: #07C160;
  color: #07C160;
}
.wx-ds-sample-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--wx-cell);
  font-size: 11px;
  line-height: 1.5;
  color: var(--wx-text2);
  border: 1px dashed var(--wx-sep);
}
.wx-ds-sample-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 表单字段 */
.wx-ds-card {
  background: var(--wx-cell);
  border-radius: 12px;
  border: 1px solid var(--wx-sep);
  padding: 16px;
  margin-top: 14px;
}
.wx-ds-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
  margin-bottom: 6px;
}
.wx-ds-field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--wx-sep);
  background: var(--wx-page);
  color: var(--wx-text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.wx-ds-field-input:focus {
  border-color: #07C160;
}
.wx-ds-field-input::placeholder {
  color: var(--wx-text3);
}

/* 合规声明 */
.wx-ds-consent-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.wx-ds-consent-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #07C160;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.wx-ds-consent-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--wx-text2);
  user-select: none;
}

/* 状态信息与操作按钮 */
.wx-ds-error-bar {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(250, 81, 81, 0.08);
  border: 1px solid rgba(250, 81, 81, 0.2);
  color: #FA5151;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wx-ds-btn-submit {
  width: 100%;
  margin-top: 16px;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  background: #07C160;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.wx-ds-btn-submit:active {
  background: #06AD56;
  transform: scale(0.985);
}
.wx-ds-btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ---------- 导出指引按钮与弹窗 (方案 2) ---------- */
.wx-ds-guide-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #576B95;
  background: rgba(87, 107, 149, 0.08);
  border: 1px solid rgba(87, 107, 149, 0.18);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.wx-ds-guide-trigger:hover {
  background: rgba(87, 107, 149, 0.16);
  color: #3b5078;
}
.wx-dark .wx-ds-guide-trigger {
  color: #7d96c8;
  background: rgba(125, 150, 200, 0.12);
  border-color: rgba(125, 150, 200, 0.2);
}

.wx-eg-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: wxDsFadeIn 0.2s ease;
}
.wx-eg-modal {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--wx-cell);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  border: 1px solid var(--wx-sep);
}
.wx-eg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--wx-sep);
}
.wx-eg-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wx-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wx-eg-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--wx-text3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.wx-eg-close:hover {
  background: var(--wx-page);
  color: var(--wx-text);
}
.wx-eg-tabs {
  display: flex;
  padding: 8px 16px;
  background: var(--wx-page);
  gap: 8px;
  border-bottom: 1px solid var(--wx-sep);
}
.wx-eg-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--wx-text2);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.wx-eg-tab-btn.active {
  background: var(--wx-cell);
  color: #07C160;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.wx-eg-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--wx-text);
}
.wx-eg-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.wx-eg-step-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #07C160;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.wx-eg-step-content {
  flex: 1;
}
.wx-eg-step-title {
  font-weight: 600;
  color: var(--wx-text);
  margin-bottom: 2px;
}
.wx-eg-step-desc {
  font-size: 12px;
  color: var(--wx-text2);
}
.wx-eg-tip-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(7, 193, 96, 0.08);
  border: 1px solid rgba(7, 193, 96, 0.16);
  font-size: 12px;
  color: var(--wx-text2);
  margin-top: 14px;
  line-height: 1.55;
}

/* ---------- 前置 API Key 状态指示条 (方案 3) ---------- */
.wx-ds-key-status {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  transition: all 0.2s ease;
}
.wx-ds-key-status.ready {
  background: rgba(7, 193, 96, 0.08);
  border: 1px solid rgba(7, 193, 96, 0.22);
}
.wx-ds-key-status.warning {
  background: rgba(255, 154, 0, 0.09);
  border: 1px solid rgba(255, 154, 0, 0.28);
}
.wx-ds-key-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.wx-ds-key-title {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-ds-key-status.ready .wx-ds-key-title {
  color: #07C160;
}
.wx-ds-key-status.warning .wx-ds-key-title {
  color: #E68200;
}
.wx-dark .wx-ds-key-status.warning .wx-ds-key-title {
  color: #F89C26;
}
.wx-ds-key-desc {
  color: var(--wx-text2);
  font-size: 11px;
}
.wx-ds-key-action {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.wx-ds-key-status.warning .wx-ds-key-action {
  background: #E68200;
  color: #fff;
}
.wx-ds-key-status.ready .wx-ds-key-action {
  background: rgba(7, 193, 96, 0.15);
  color: #07C160;
}

/* ---------- 角色认领双选器 (方案 4) ---------- */
.wx-ds-role-picker {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
}
.wx-ds-role-header {
  margin-bottom: 12px;
}
.wx-ds-role-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-ds-role-sub {
  font-size: 11px;
  color: var(--wx-text3);
  margin-top: 2px;
}
.wx-ds-role-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .wx-ds-role-cols {
    grid-template-columns: 1fr;
  }
}
.wx-ds-role-col {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--wx-page);
  border: 1px solid var(--wx-sep);
}
.wx-ds-role-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--wx-text);
}
.wx-ds-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.wx-ds-role-pill {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 12px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  color: var(--wx-text2);
  cursor: pointer;
  transition: all 0.15s;
}
.wx-ds-role-pill:hover {
  border-color: #07C160;
  color: #07C160;
}
.wx-ds-role-pill.active {
  background: #07C160;
  color: #FFFFFF;
  border-color: #07C160;
  font-weight: 600;
}

/* ---------- 隐私脱敏与机制 (方案 5) ---------- */
.wx-ds-privacy-section {
  margin-top: 14px;
}
.wx-ds-privacy-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--wx-cell);
  border: 1px solid var(--wx-sep);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.wx-ds-privacy-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #07C160;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.wx-ds-privacy-text {
  flex: 1;
}
.wx-ds-privacy-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wx-text);
}
.wx-ds-privacy-desc {
  font-size: 11px;
  color: var(--wx-text3);
  margin-top: 2px;
  line-height: 1.45;
}
.wx-ds-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(7, 193, 96, 0.1);
  color: #07C160;
  font-weight: 500;
}

/* 蒸馏运行中：仪表盘 Stepper */
.wx-ds-stage-panel {
  background: var(--wx-cell);
  border-radius: 16px;
  border: 1px solid var(--wx-sep);
  padding: 26px 20px;
  margin-top: 14px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
}
.wx-ds-pulse-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wx-ds-pulse-ring {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  border-radius: 50%;
  border: 2px solid #07C160;
  opacity: 0.7;
  animation: wxDsRingPulse 2s infinite ease-out;
}
.wx-ds-pulse-center {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07C160 0%, #10A37F 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.35);
}
.wx-ds-stage-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--wx-text);
  margin-bottom: 6px;
}
.wx-ds-stage-desc {
  font-size: 13px;
  color: var(--wx-text2);
  margin-bottom: 24px;
}
.wx-ds-stepper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  max-width: 380px;
  margin: 0 auto;
}
.wx-ds-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--wx-page);
  border: 1px solid var(--wx-sep);
  transition: all 0.25s ease;
}
.wx-ds-step-item.is-done {
  border-color: rgba(7, 193, 96, 0.3);
  background: rgba(7, 193, 96, 0.05);
}
.wx-ds-step-item.is-current {
  border-color: #07C160;
  background: rgba(7, 193, 96, 0.08);
  box-shadow: 0 2px 10px rgba(7, 193, 96, 0.12);
}
.wx-ds-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--wx-sep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}
.wx-ds-step-item.is-done .wx-ds-step-dot {
  background: #07C160;
}
.wx-ds-step-item.is-current .wx-ds-step-dot {
  background: #07C160;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.25);
  animation: wxDsDotPulse 1.5s infinite;
}
.wx-ds-step-info {
  flex: 1;
}
.wx-ds-step-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text);
}
.wx-ds-step-detail {
  font-size: 11px;
  color: var(--wx-text3);
  margin-top: 2px;
}
.wx-ds-stage-tip {
  margin-top: 20px;
  font-size: 11px;
  color: var(--wx-text3);
}

/* 蒸馏成功结果卡片 */
.wx-ds-result-panel {
  background: var(--wx-cell);
  border-radius: 20px;
  border: 1px solid var(--wx-sep);
  padding: 28px 20px;
  margin-top: 14px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  animation: wxDsFadeIn 0.4s ease;
}
.wx-ds-avatar-halo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10A37F 0%, #07C160 100%);
  color: #FFFFFF;
  font-size: 32px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(7, 193, 96, 0.35);
}
.wx-ds-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #07C160;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--wx-cell);
}
.wx-ds-result-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--wx-text);
  margin-bottom: 6px;
}
.wx-ds-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: #07C160;
  background: rgba(7, 193, 96, 0.1);
  font-weight: 500;
  margin-bottom: 16px;
}
.wx-ds-traits-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
.wx-ds-trait-tag {
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--wx-page);
  border: 1px solid var(--wx-sep);
  font-size: 12px;
  color: var(--wx-text2);
}
.wx-ds-greeting-bubble {
  background: var(--wx-page);
  border: 1px solid var(--wx-sep);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  margin-bottom: 18px;
  position: relative;
}
.wx-ds-greeting-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--wx-text3);
  margin-bottom: 6px;
}
.wx-ds-greeting-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--wx-text);
  white-space: pre-wrap;
}
.wx-ds-mem-stats {
  padding: 10px;
  border-radius: 10px;
  background: rgba(7, 193, 96, 0.05);
  font-size: 12px;
  color: var(--wx-text2);
  margin-bottom: 20px;
}
.wx-ds-status-notice {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(87, 107, 149, 0.08);
  font-size: 12px;
  line-height: 1.5;
  color: var(--wx-text2);
  margin-bottom: 20px;
  text-align: left;
}
.wx-ds-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes wxDsRingPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(1.3); opacity: 0; }
}
@keyframes wxDsDotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes wxDsFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 新手引导（梦信「我」页 · 分页卡片） ---------- */
.wx-guide-card { margin: 16px; border-radius: 12px; overflow: hidden; }
.wx-guide-body { padding: 30px 24px 8px; text-align: center; }
.wx-guide-emoji { font-size: 46px; line-height: 1.15; margin-bottom: 12px; }
.wx-guide-title { font-size: 20px; font-weight: 600; color: var(--wx-text); margin-bottom: 14px; }
.wx-guide-text { font-size: 14px; line-height: 1.9; color: var(--wx-text2); text-align: left; }
.wx-guide-text > div:empty { min-height: 0.9em; }
.wx-guide-link { color: var(--wx-link); cursor: pointer; font-size: 13px; text-align: left; margin-top: 4px; }
.wx-guide-link:active { opacity: .7; }
.wx-guide-dots { display: flex; justify-content: center; gap: 7px; padding: 16px 0 4px; }
.wx-guide-dot {
  width: 7px; height: 7px; border-radius: 4px; background: var(--wx-text3);
  opacity: .45; transition: all .2s ease;
}
.wx-guide-dot.on { opacity: 1; background: #07C160; width: 20px; }
.wx-guide-btns { display: flex; gap: 12px; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); }
.wx-guide-btn {
  flex: 1; padding: 11px 0; border-radius: 8px; font-size: 15px; font-family: inherit;
  cursor: pointer; border: none; -webkit-tap-highlight-color: transparent;
}
.wx-guide-btn.primary { background: #07C160; color: #FFFFFF; }
.wx-guide-btn.primary:active { background: #06AD56; }
.wx-guide-btn.ghost {
  background: var(--wx-cell); color: var(--wx-link); border: 1px solid var(--wx-sep);
}
.wx-guide-btn.ghost:active { background: var(--wx-sep); }
.wx-guide-btn:disabled { opacity: .4; cursor: default; }

/* ---------- 转账页面（极简 · 高端 · 微信原生质感） ---------- */
.wx-transfer { background: #F0F7FF; border: 1px solid rgba(87, 107, 149, 0.18); }
.wx-tr-top { display: flex; align-items: center; gap: 8px; }
.wx-tr-icon { font-size: 22px; }
.wx-tr-note {
  font-size: 14px; color: var(--wx-text); max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wx-tr-sub { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--wx-sep); font-size: 12px; color: var(--wx-text2); }

.wx-tr-page {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 140;
  background: var(--wx-bg);
  display: flex; flex-direction: column;
  color: var(--wx-text);
}
.wx-tr-page .ta-wechat-header {
  background: var(--wx-bar-alpha);
  border-bottom: 1px solid var(--wx-sep);
  color: var(--wx-text);
}
.wx-tr-page .ta-wechat-header .ta-wx-name {
  color: var(--wx-text);
  font-weight: 600;
}
.wx-tr-page .ta-wechat-header .ta-wx-back {
  color: var(--wx-text);
}

/* 桌面网页版（2026-10-10）：转账页不再镜像"假手机壳"（壳已撤掉）——改成贴着
   内容区右边满高显示，别压住左侧导航。仍受三重条件约束：触屏宽屏（iPad）不生效。 */
@media (min-width: 768px) {
  .wx-tr-page { left: var(--side-w); }
}

.wx-tr-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(58px + env(safe-area-inset-top)) 20px 24px;
  overflow-y: auto;
}

/* 顶部收款人信息 */
.wx-tr-recipient {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 22px;
  text-align: center;
}
.wx-tr-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--wx-sep);
  background: var(--wx-avatar-ph);
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.wx-tr-avatar-fallback {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--wx-cell);
  color: var(--wx-text);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wx-sep);
  margin-bottom: 10px;
}
.wx-tr-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--wx-text);
}
.wx-tr-sub-hint {
  font-size: 12px;
  color: var(--wx-text3);
  margin-top: 3px;
}

/* 金额卡片 */
.wx-tr-card {
  width: 100%;
  background: var(--wx-cell);
  border-radius: 16px;
  padding: 20px 20px 16px;
  border: 1px solid var(--wx-sep);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}
.wx-tr-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--wx-text2);
  margin-bottom: 12px;
}
.wx-tr-amount-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.wx-tr-yen {
  font-size: 28px;
  font-weight: 600;
  color: var(--wx-text);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.wx-tr-amount-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 38px;
  font-weight: 700;
  font-family: "JetBrains Mono", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: var(--wx-text);
  background: transparent;
  line-height: 1.1;
}
.wx-tr-amount-input::placeholder {
  color: var(--wx-text3);
}
.wx-tr-divider {
  height: 1px;
  background: var(--wx-sep);
  margin: 16px 0 12px;
}
.wx-tr-note-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--wx-text);
  background: transparent;
  padding: 4px 0;
}
.wx-tr-note-input::placeholder {
  color: var(--wx-text3);
}

/* 卡片下方说明与限额 */
.wx-tr-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
  font-size: 12px;
  color: var(--wx-text3);
}

.wx-tr-err {
  min-height: 20px;
  font-size: 12px;
  color: #FA5151;
  text-align: center;
  margin: 8px 0 4px;
}

/* 按钮 */
.wx-tr-go {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: #07C160;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.25);
  transition: transform 0.15s, opacity 0.15s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wx-tr-go:active {
  transform: scale(0.985);
  filter: brightness(0.95);
}
.wx-tr-go:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- 转账详情页 ---- */
.wx-tr-detail-body {
  padding-top: calc(58px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 24px;
  padding-right: 24px;
}
.wx-tr-detail-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(7, 193, 96, 0.12);
  color: #07C160;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 14px;
}
.wx-tr-detail-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--wx-text);
  margin-bottom: 8px;
}
.wx-tr-detail-amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--wx-text);
  font-family: "JetBrains Mono", -apple-system, sans-serif;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.wx-tr-detail-yen {
  font-size: 26px;
  font-weight: 500;
}
.wx-tr-detail-note {
  font-size: 13px;
  color: var(--wx-text2);
  margin-top: 6px;
  padding: 6px 14px;
  background: var(--wx-cell);
  border-radius: 20px;
  border: 1px solid var(--wx-sep);
}

/* ---------- 梦信私享金库（高端黑金 / 琉璃星穹卡面 & 奢华流水） ---------- */
.wx-wallet-container {
  padding: 0 14px 32px;
}

.wx-wallet-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  border-radius: 18px;
  background:
    radial-gradient(130% 120% at 90% -10%, rgba(212, 175, 55, 0.22) 0%, transparent 60%),
    radial-gradient(90% 90% at 10% 110%, rgba(87, 107, 149, 0.25) 0%, transparent 70%),
    linear-gradient(145deg, #181B24 0%, #1F2430 45%, #13151D 100%);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  margin: 0 0 16px;
  user-select: none;
}
.wx-wallet-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 194, 128, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.wx-wallet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.wx-wallet-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wx-wallet-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.72);
}
.wx-wallet-eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.wx-wallet-eye-btn:hover, .wx-wallet-eye-btn:active {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  transform: scale(0.95);
}

.wx-wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-size: 10px;
  font-weight: 600;
  color: #F3D995;
  letter-spacing: 1px;
}

.wx-wallet-balance-wrap {
  margin: 4px 0 16px;
  min-height: 48px;
  display: flex;
  align-items: baseline;
}
.wx-wallet-cur {
  font-size: 20px;
  font-weight: 400;
  color: #F3D995;
  margin-right: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wx-wallet-balance-int {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  font-family: "JetBrains Mono", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}
.wx-wallet-balance-dec {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  font-family: "JetBrains Mono", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}
.wx-wallet-balance-masked {
  font-size: 30px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-family: -apple-system, sans-serif;
  line-height: 1;
}

.wx-wallet-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wx-wallet-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wx-wallet-cardno {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.45);
  font-family: "JetBrains Mono", monospace;
}
.wx-wallet-closed-badge {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
}

.wx-wallet-daily-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}
.wx-wallet-daily-pill.granted {
  background: rgba(7, 193, 96, 0.14);
  border-color: rgba(7, 193, 96, 0.32);
  color: #57E389;
}
.wx-wallet-daily-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F3D995;
}
.wx-wallet-daily-pill.granted .pill-dot {
  background: #07C160;
  box-shadow: 0 0 6px rgba(7, 193, 96, 0.7);
}

/* 角色小金库板块（视窗与卡片） */
.wx-wallet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 8px;
}
.wx-wallet-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--wx-text2);
  letter-spacing: 0.5px;
}
.wx-wallet-section-subtitle {
  font-size: 11px;
  color: var(--wx-text3);
}

.wx-vault-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.wx-vault-card {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--wx-cell);
  border-radius: 14px;
  border: 1px solid var(--wx-sep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-vault-card:active {
  transform: scale(0.985);
  background: var(--wx-press);
}
.wx-vault-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-right: 12px;
}
.wx-vault-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  background: var(--wx-avatar-ph);
  display: block;
}
.wx-vault-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4A5568, #2D3748);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
}
.wx-vault-info {
  flex: 1;
  min-width: 0;
}
.wx-vault-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-vault-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--wx-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-vault-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(87, 107, 149, 0.1);
  color: var(--wx-link);
  font-weight: 500;
}
.wx-vault-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--wx-text2);
}
.wx-vault-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 10px;
}
.wx-vault-balance {
  font-size: 16px;
  font-weight: 700;
  color: #D48806;
  font-family: "JetBrains Mono", -apple-system, monospace;
}
.wx-vault-action-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(87, 107, 149, 0.08);
  color: var(--wx-link);
  border: 1px solid rgba(87, 107, 149, 0.15);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* 账单流水板块 */
.wx-txns-group {
  background: var(--wx-cell);
  border-radius: 14px;
  border: 1px solid var(--wx-sep);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.wx-txns-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px 8px;
  font-size: 12px;
  color: var(--wx-text2);
  border-bottom: 1px solid var(--wx-sep);
  background: rgba(0, 0, 0, 0.015);
}
.wx-txns-day-stat {
  font-size: 11px;
  color: var(--wx-text3);
}

.wx-txn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--wx-sep);
  transition: background 0.15s;
}
.wx-txn-row:first-of-type {
  border-top: none;
}
.wx-txn-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.wx-txn-icon-wrap.redpacket {
  background: linear-gradient(135deg, #FA5151, #FF7875);
  color: #FFFFFF;
}
.wx-txn-icon-wrap.transfer-in {
  background: rgba(7, 193, 96, 0.12);
  color: #07C160;
}
.wx-txn-icon-wrap.transfer-out {
  background: rgba(87, 107, 149, 0.12);
  color: var(--wx-link);
}
.wx-txn-icon-wrap.daily {
  background: rgba(212, 175, 55, 0.15);
  color: #D48806;
}

.wx-txn-body {
  flex: 1;
  min-width: 0;
}
.wx-txn-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wx-txn-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--wx-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-txn-amount {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--wx-text);
  font-family: "JetBrains Mono", -apple-system, monospace;
}
.wx-txn-amount.in {
  color: #07C160;
}
.wx-txn-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 12px;
  color: var(--wx-text2);
}
.wx-txn-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-txn-time {
  flex-shrink: 0;
  color: var(--wx-text3);
  font-size: 11px;
}

/* 空状态卡片 */
.wx-wallet-empty-card {
  padding: 24px 16px;
  text-align: center;
  background: var(--wx-cell);
  border-radius: 14px;
  border: 1px dashed var(--wx-sep);
  color: var(--wx-text2);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 16px;
}
/* 兼容老 class */
.wx-wallet-balance { display: none; }
.wx-wallet-empty { padding: 20px 16px; font-size: 13px; line-height: 1.7; color: var(--wx-text2); white-space: pre-line; }
.wx-wallet-section { margin: 4px 16px 8px; font-size: 13px; color: var(--wx-text2); }
.wx-wallet-day { padding: 10px 16px 4px; font-size: 12px; color: var(--wx-text2); }
.wx-wallet-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--wx-sep); }
.wx-wallet-row:first-of-type { border-top: none; }
.wx-wallet-row-main { flex: 1; min-width: 0; }
.wx-wallet-row-title { font-size: 15px; color: var(--wx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-wallet-row-sub { margin-top: 2px; font-size: 12px; color: var(--wx-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-wallet-row-amt { flex-shrink: 0; font-size: 16px; font-weight: 600; color: var(--wx-text); }
.wx-wallet-row-amt.in { color: #07C160; }

/* ---------- 快速上手指南（半梦「帮助与关于」· 分页弹层） ---------- */
.guide-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 950;
  background: var(--scene-veil);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.guide-card {
  width: 100%; max-width: 360px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
  padding: 28px 24px 20px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
}
.guide-head { flex: none; text-align: center; }
.guide-eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--primary-text); }
.guide-head-title { margin-top: 4px; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--on-bg); }
.guide-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; text-align: center; padding: 18px 2px 8px; -webkit-overflow-scrolling: touch; }
.guide-emoji { display: flex; align-items: center; justify-content: center; min-height: 42px; font-size: 42px; line-height: 1.2; margin-bottom: 8px; color: var(--primary-text); }
.guide-kicker { margin-bottom: 4px; font-size: 11px; letter-spacing: .06em; color: var(--primary-text); }
.guide-title {
  font-family: var(--font-display); font-weight: 700; font-size: 23px;
  color: var(--on-bg); margin-bottom: 10px; letter-spacing: .02em;
}
.guide-text { font-size: 13.5px; line-height: 1.9; color: var(--on-surface-variant); text-align: left; }
.guide-text > div:empty { min-height: 0.9em; }
.guide-gap { height: 8px; }
.guide-example { margin-top: 8px; padding: 9px 11px; border-left: 2px solid var(--primary); background: var(--surface-variant); border-radius: 0 9px 9px 0; color: var(--on-surface); }
.guide-inline-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; margin-top: 14px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--primary-fill); color: var(--on-primary);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.guide-inline-cta svg { margin-left: 6px; }
.guide-legend { flex: none; margin: 2px 0 0; padding: 9px 10px; border-radius: 10px; background: var(--surface-variant); color: var(--on-surface-variant); font-size: 11.5px; line-height: 1.5; text-align: center; }
.guide-dots { display: flex; justify-content: center; gap: 7px; padding: 16px 0 14px; }
.guide-dot {
  width: 7px; height: 7px; border-radius: 4px; background: var(--on-surface-variant);
  opacity: .35; transition: all .2s ease;
}
.guide-dot.on { opacity: 1; background: var(--primary); width: 20px; }
.guide-btns { display: flex; gap: 12px; }
.guide-skip {
  flex: none; align-self: center; margin-top: 7px; padding: 5px 0;
  border: 0; background: transparent; color: var(--on-surface-variant);
  font: inherit; font-size: 12px; cursor: pointer;
}
.guide-btn {
  flex: 1; padding: 11px 0; border-radius: 10px; font-size: 15px; font-family: inherit;
  cursor: pointer; border: none; -webkit-tap-highlight-color: transparent;
}
.guide-btn.primary { background: var(--primary-fill); color: var(--on-primary); }
.guide-btn.primary:active { transform: scale(.98); }
.guide-btn.ghost {
  background: transparent; color: var(--on-surface); border: 1px solid var(--outline);
}
.guide-btn.ghost:active { background: var(--surface-variant); }
.guide-btn:disabled { opacity: .4; cursor: default; }

/* ---------- 新用户三种玩法：大厅内联卡（公告横幅下方） ---------- */
.play-guide-card {
  margin: 0 0 16px;
  border: 1px solid var(--outline);
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(204, 120, 92, .16), transparent 42%),
    linear-gradient(145deg, var(--surface), var(--bg));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}
.play-guide-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.play-guide-heading { flex: 1; min-width: 0; }
.play-guide-kicker { font-size: 11px; letter-spacing: .08em; color: var(--primary-text); }
.play-guide-title { margin-top: 2px; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--on-bg); }
.play-guide-x {
  flex: none; width: 30px; height: 30px; margin: -4px -4px 0 8px;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--on-surface-variant); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.play-guide-x:active { background: var(--surface-variant); }
.play-guide-list { border-top: 1px solid var(--outline); }
.play-guide-row {
  display: flex; align-items: center; width: 100%; min-height: 52px;
  padding: 8px 0; border: 0; border-bottom: 1px solid var(--outline);
  background: transparent; color: var(--on-bg); font: inherit; text-align: left; cursor: pointer;
}
.play-guide-row:active { background: var(--surface-variant); }
.play-guide-row-icon {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-right: 10px; border-radius: 11px;
  background: var(--surface-variant); color: var(--primary-text);
}
.play-guide-row-main { flex: 1; min-width: 0; }
.play-guide-row-title { display: block; font-size: 14px; font-weight: 700; }
.play-guide-row-sub { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--on-surface-variant); }
.play-guide-chev { flex: none; color: var(--on-surface-variant); }
.play-guide-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--on-surface-variant); font-size: 11.5px; line-height: 1.45; }
.play-guide-foot > span { flex: 1; min-width: 0; }
.play-guide-more {
  flex: none; display: inline-flex; align-items: center; margin-left: 10px; padding: 5px 0 5px 8px;
  border: 0; background: transparent; color: var(--primary-text);
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.play-guide-more svg { margin-left: 3px; }
@media (max-width: 360px) {
  .play-guide-card { padding: 14px; }
  .play-guide-row-sub { white-space: normal; }
  .play-guide-foot { align-items: flex-start; flex-direction: column; }
  .play-guide-more { margin: 5px 0 0; padding-left: 0; }
}

/* ---------- 微信主框架：底部四 Tab ---------- */
.wx-main-scroll { padding-left: 0; padding-right: 0; }
.wx-tabbar {
  flex-shrink: 0; display: flex;
  background: var(--wx-bar);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 4px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.wx-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 4px 0 2px;
  border: none; background: transparent; cursor: pointer;
  color: var(--wx-text2); font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.wx-tab.active { color: #07C160; }
.wx-tab-label { font-size: 10px; line-height: 1.2; }
.wx-entry-hint { flex-shrink: 0; font-size: 13px; color: var(--wx-text3); }
.wx-danger-cell {
  color: #FA5151; font-size: 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-danger-cell:active { background: var(--wx-press); }
.wx-btn-send {
  display: block; width: calc(100% - 32px); margin: 12px 16px 14px;
  padding: 11px 0; border: none; border-radius: 6px; cursor: pointer;
  background: #07C160; color: #FFFFFF; font-size: 16px; font-weight: 500; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.wx-btn-send:active { background: #06AD56; }
.wx-light .switch.on { background: #07C160; }
.wx-light .switch { background: var(--wx-press); }

/* + 菜单：微信式深色圆角弹出层（右上角） */
.wx-plus-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 39; background: transparent; }
.wx-plus-menu {
  position: fixed; z-index: 40; min-width: 148px;
  background: rgba(20, 22, 28, 0.96);
  border-radius: 8px; padding: 4px 0;
  animation: wx-pop-in .15s ease-out;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}
@keyframes wx-pop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .wx-plus-menu { animation: none; } }
.wx-plus-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; cursor: pointer;
  color: #FFFFFF; font-size: 15px; font-family: inherit;
  padding: 11px 18px; -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.wx-plus-item:active { background: rgba(255, 255, 255, 0.08); }

/* 梦信设置页：表单行与分割线 */
.wx-cell-divider { height: 1px; background: var(--wx-sep); margin-left: 16px; }
.wx-field-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 6px 16px;
}
.wx-field-label { flex-shrink: 0; width: 72px; font-size: 15px; color: var(--wx-text); }
.wx-field {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--wx-text); font-family: inherit;
  text-align: right;
}
.wx-field::placeholder { color: var(--wx-avatar-ph); }

/* 梦信底部动作面板（ActionSheet）：微信式弹层，选项带勾选态 */
.wx-as-root { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 130; }
.wx-as-mask { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(0, 0, 0, 0.45); }
.wx-action-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--wx-bar);
  border-radius: 14px 14px 0 0;
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  animation: wx-as-in .2s ease-out;
}
@keyframes wx-as-in {
  from { transform: translateY(40%); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .wx-action-sheet { animation: none; } }
.wx-as-title {
  text-align: center; font-size: 13px; color: var(--wx-text2);
  padding: 10px 16px 8px; line-height: 1.4;
}
.wx-as-options { background: var(--wx-cell); }
.wx-as-item {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%;
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  min-height: 57px; padding: 8px 16px;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.wx-as-item:active { background: var(--wx-press); }
.wx-as-item + .wx-as-item::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--wx-sep);
}
.wx-as-check {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: #07C160;
}
.wx-as-item-main { flex: 1; min-width: 0; }
.wx-as-label { display: block; font-size: 17px; color: var(--wx-text); line-height: 1.4; text-align: center; }
.wx-as-item.active .wx-as-label { color: #07C160; }
.wx-as-sub { display: block; font-size: 12px; color: var(--wx-text2); margin-top: 2px; line-height: 1.4; text-align: center; }
.wx-as-cancel {
  display: block; width: 100%; margin-top: 8px;
  border: none; background: var(--wx-cell); cursor: pointer; font-family: inherit;
  min-height: 52px; font-size: 16px; color: var(--wx-text);
  -webkit-tap-highlight-color: transparent;
}
.wx-as-cancel:active { background: var(--wx-press); }
/* 桌面网页版（2026-10-10）：ActionSheet 不再镜像"假手机壳"（壳已撤掉）。
   它挂在 .wx-as-root 里，桌面块已把 root 的左边收到侧栏右边，面板自然满内容区宽，
   原来那条 390px 居中 + 专用 keyframes 整块删除。 */

/* ---------- 个人信息页：右侧取值（微信式右对齐灰字） ---------- */
.wx-entry-value {
  flex: 1; min-width: 0; text-align: right;
  font-size: 15px; color: var(--wx-text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 梦圈（二期壳：封面头图 + 动态流；发布/点赞/评论三期接） ---------- */
/* 顶栏透明浮在封面头上（默认毛玻璃条在封面场景穿帮），按钮改白色 */
.wx-moments-page { position: relative; background: var(--wx-page); }
.wx-moments-page .ta-wechat-header {
  background: transparent; border-bottom: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.wx-moments-page .ta-wechat-header .ta-wx-back,
.wx-moments-page .ta-wechat-header .ta-wx-more { color: #FFFFFF; }
.wx-moments-page .ta-wechat-header .ta-wx-back:active,
.wx-moments-page .ta-wechat-header .ta-wx-more:active { background: rgba(0, 0, 0, 0.12); }
.wx-moments-cover {
  position: relative; height: 264px;
  background: linear-gradient(165deg, #6E809B 0%, #93A5BC 55%, #BFCBD8 100%);
}
.wx-moments-cover.has-custom { background-size: cover; background-position: center; }
.wx-moments-cover-actions {
  position: absolute; left: 16px; bottom: 14px; z-index: 3;
  display: flex; gap: 8px;
}
.wx-moments-cover-btn {
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.24);
  color: #FFFFFF; font: inherit; font-size: 12px; cursor: pointer;
}
.wx-moments-cover-btn[hidden] { display: none; }
.wx-moments-cover-btn:disabled { opacity: .55; cursor: default; }
.wx-moments-cover-btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
/* 封面右下：我的名字 + 头像（头像压过封面下缘，微信同款） */
.wx-moment-me {
  position: absolute; right: 16px; bottom: -22px; z-index: 2;
  display: flex; align-items: flex-end; gap: 12px;
}
.wx-moment-me-name {
  color: #FFFFFF; font-size: 16px; font-weight: 500;
  margin-bottom: 16px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.wx-moment-me .wx-avatar48 {
  width: 64px; height: 64px; border-radius: 8px;
  border: 2px solid #FFFFFF; box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.wx-moments-feed { background: var(--wx-page); padding-top: 34px; }
.wx-moment-item { display: flex; gap: 10px; padding: 12px 16px 0; }
.wx-moment-item .wx-avatar48 { width: 42px; height: 42px; border-radius: 6px; }
.wx-moment-body {
  flex: 1; min-width: 0;
  border-bottom: 1px solid var(--wx-sep);
  padding-bottom: 12px;
}
.wx-moment-name { color: var(--wx-link); font-weight: 600; font-size: 15px; line-height: 1.35; }
.wx-moment-text {
  font-size: 15px; color: var(--wx-text); line-height: 1.5; margin-top: 2px;
  white-space: pre-wrap; word-break: break-word;
}
.wx-moment-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.wx-moment-imgs img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 4px; display: block; cursor: zoom-in;
}
.wx-moment-time { font-size: 12px; color: var(--wx-text3); margin-top: 8px; }
.wx-moment-hint {
  padding: 80px 24px 0; text-align: center;
  font-size: 14px; color: var(--wx-text3); line-height: 1.9; white-space: pre-wrap;
}

/* ==========================================================================
   图片查看器（应用内全屏看图：单击关闭 / 双击缩放 / 捏合缩放 / 拖拽平移）
   ========================================================================== */
.img-viewer {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 9999;
  background: rgba(8, 10, 14, 0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
  touch-action: none; /* 手势全交 JS，避免浏览器默认滚动/缩放 */
  cursor: zoom-out;
}
.img-viewer.show { opacity: 1; }
/* 2026-11-13 修「部分安卓看图只能看见一小块、放不大」：
   原来写的是 max-width:94vw / max-height:90vh —— 这两个只是上限，**从不放大**，
   所以源图本身小（模型偶尔返回小尺寸、或历史小图）时，用户看到的就是一张原尺寸的小图，
   双指/双击失灵时等于完全看不了。现在改成撑满视口 + object-fit:contain：
   大图按比例缩到装得下，小图按比例放大。
   ⚠️ 放大有上限（2026-11-13 用户定：最多放大 3 倍原图）—— 上限写不进 CSS（CSS 拿不到原图尺寸），
   由 char-visuals.js 的 applyUpscaleCap() 按 naturalWidth/naturalHeight × 3 写成行内 max-*。
   同时去掉 will-change:transform —— 安卓 WebView 上合成层偶发按错误栅格化，
   是「图被缩到一角」的另一条可疑路径，而这里并没有频繁变形的性能需要。 */
.img-viewer-img {
  display: block; width: 100%; height: 100%;
  object-fit: contain; border-radius: 6px;
  transform-origin: 50% 50%;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  -webkit-touch-callout: none; /* 安卓长按别弹系统「保存图片」菜单，手势归我们自己 */
  touch-action: none;
  cursor: zoom-in;
}
/* 加载失败态：不要留一个小破图让人以为「图就是这样」 */
.img-viewer.is-failed .img-viewer-img { opacity: 0; }
.img-viewer-fail {
  display: none; position: relative; z-index: 2;
  flex-direction: column; align-items: center; gap: 8px;
  max-width: 76vw; padding: 20px 22px; text-align: center; color: #fff;
  background: rgba(22, 26, 34, .92); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
}
.img-viewer.is-failed .img-viewer-fail { display: flex; }
.img-viewer-fail strong { font-size: 15px; }
.img-viewer-fail p { margin: 0; font-size: 12.5px; line-height: 1.7; color: rgba(255, 255, 255, .66); }
.img-viewer-retry {
  margin-top: 4px; min-height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .1);
  color: #fff; font: inherit; font-size: 13.5px; cursor: pointer;
}
.img-viewer-retry:active { background: rgba(255, 255, 255, .2); }
/* 保存按钮（2026-10-02，工单 d06dca3：想存下来）。
   放右下角、拇指够得到的位置；半透明玻璃底，压在暗色看图器上不刺眼。 */
.img-viewer-dl {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; background: rgba(20, 24, 32, .68);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font: inherit; font-size: 14px; cursor: pointer;
}
.img-viewer-dl:active { background: rgba(20, 24, 32, .9); }
.img-viewer-dl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 420px) { .img-viewer-dl-t { display: none; } .img-viewer-dl { padding: 0 14px; } }
/* 聊天页立绘横幅：可点开大图 */
.char-banner-img.zoomable { cursor: zoom-in; }
.char-banner-img.zoomable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* 缩略图可点开大图（2026-10-02）：不给角标，用 hover / focus 暗示「这是一张能放大的图」，
   不新增视觉元素——之前挂了个 🔍 角标，每张卡都挂，等于给列表加了一列噪声，
   而且 emoji 放大镜各平台渲染还不一样。 */
.cast-thumb[data-cast-zoom] { cursor: zoom-in; transition: transform .15s ease; }
.cast-thumb[data-cast-zoom]:active { transform: scale(.96); }
.cast-thumb[data-cast-zoom]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) { .cast-thumb[data-cast-zoom]:hover { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .cast-thumb[data-cast-zoom] { transition: none; } }

/* ========== 梦信一期扩展：拍一拍 / 红包 / 引用回复 / 免打扰 / 聊内搜索 ========== */
/* 拍一拍：系统灰字行 + 头像抖动 */
.wx-pat-row {
  text-align: center; font-size: 12.5px; color: var(--wx-text2);
  padding: 3px 16px; user-select: none;
}
.wx-pat-shake { animation: wx-pat-shake .6s ease-in-out; }
/* 梦信「显示 TA 没说出口的部分」开关打开后的旁白条（2026-09-25，方案 A：纯显示层）。
   灰字与拍一拍/撤回同一档（--wx-text2），不写死 rgba、不压 opacity：
   2026-09-23「消息被撤回、而且看不到」事故的根因就是灰字只认系统深色，
   guard:wxcontrast 现在会把 #wx-narr 一起量（四种主题组合）。 */
.wx-narr {
  text-align: center; font-size: calc(12.5px * var(--chat-scale, 1)); line-height: 1.7;
  color: var(--wx-text2); padding: 2px 16px;
}
/* 群聊里旁白挂在发言人自己的消息盒内（.wx-msg-box），居中会读成系统提示 ⇒ 靠左 */
.wx-msg-box .wx-narr { text-align: left; padding: 1px 6px 0 4px; }
@keyframes wx-pat-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px) rotate(-4deg); }
  30% { transform: translateX(5px) rotate(4deg); }
  45% { transform: translateX(-4px) rotate(-3deg); }
  60% { transform: translateX(4px) rotate(3deg); }
  75% { transform: translateX(-2px) rotate(-2deg); }
  90% { transform: translateX(2px) rotate(1deg); }
}
/* 撤回提示：微信同款居中灰字。
   ⚠️ 2026-09-23 修：此前写死 rgba(0,0,0,.34) + 一条只认**系统** prefers-color-scheme 的深色覆盖，
   于是「App 深色 + 系统浅色」下是黑字落在深色底上——实测对比度 **1.11**（等于隐形）。
   用户反馈的「消息被撤回、而且看不到的那种」就是这个：灰字看不见，但那一行仍然占位，
   后面的气泡看着就像"错位"。改用主题变量（--wx-text3 三级文字，随 data-wx-theme 走）。 */
.wx-recall-row {
  text-align: center; font-size: 12.5px; color: var(--wx-text2);
  padding: 3px 16px; user-select: none;
}
.wx-reedit-btn {
  color: var(--wx-text2); margin-left: 6px; cursor: pointer; user-select: none;
  font-weight: 500; text-decoration: none; display: inline-block;
}
.wx-reedit-btn:hover { text-decoration: underline; }
.wx-reedit-btn:active { opacity: .75; }
/* 深色模式：上面已走主题变量，这里不再重复覆盖（重复覆盖会盖掉 data-wx-theme 的口径） */
/* 扮演红包：橙色卡片气泡 */
.ta-bubble.wx-redpacket {
  background: linear-gradient(160deg, #F7D28B 0%, #EFAE5C 100%);
  color: #7A4A12; min-width: 168px; padding: 10px 14px; cursor: pointer;
  border-radius: 8px;
}
.ta-bubble.wx-redpacket:active { filter: brightness(.96); }
.ta-bubble.wx-redpacket .wx-rp-top {
  display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500;
}
.ta-bubble.wx-redpacket .wx-rp-icon { font-size: 22px; line-height: 1; }
.ta-bubble.wx-redpacket .wx-rp-note {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px;
}
.ta-bubble.wx-redpacket .wx-rp-sub {
  margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(122, 74, 18, .25);
  font-size: 11px; opacity: .75;
}
/* 引用块：气泡内左竖线小字 */
.ta-bubble .wx-quote {
  display: block;
  margin: 0 0 4px; padding: 4px 8px; border-left: 2px solid #07C160;
  background: rgba(0, 0, 0, 0.05); border-radius: 4px;
  font-size: calc(12px * var(--chat-scale, 1)); color: rgba(0, 0, 0, 0.45); line-height: 1.5;
  max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ta-bubble .wx-quote .wx-quote-name { color: rgba(0, 0, 0, 0.6); }
/* 引用条：composer 上方待引用提示 */
.wx-quote-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 8px; padding: 6px 10px;
  background: #F2F2F2; border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.wx-quote-bar .wx-quote-hint {
  flex: 1; min-width: 0; font-size: 12.5px; color: rgba(0, 0, 0, 0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wx-quote-bar .wx-quote-close {
  flex-shrink: 0; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.5);
  font-size: 16px; line-height: 1; cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .wx-quote-bar { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }
  .wx-quote-bar .wx-quote-hint { color: rgba(255, 255, 255, 0.45); }
  .wx-quote-bar .wx-quote-close { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }
}
/* 免打扰未读：灰色圆点 */
/* 免打扰未读：实色灰点（半透明叠在头像上会出现两色断层，像裁剪坏了） */
.wx-badge.wx-badge-muted { background: #B2B2B2; min-width: 10px; width: 10px; height: 10px; padding: 0; right: -2px; top: -2px; border: 1.5px solid var(--wx-cell); box-sizing: content-box; }
/* 聊内搜索覆盖层 */
.wx-search-overlay-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 94; background: rgba(0, 0, 0, 0.35); }
.wx-search-overlay {
  position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  top: 8vh; width: min(92vw, 420px); max-height: 76vh;
  background: #F7F7F7; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}
.wx-sr-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08); flex-shrink: 0;
}
.wx-sr-head input {
  flex: 1; min-width: 0; height: 34px; padding: 0 12px;
  border: none; border-radius: 8px; background: #FFFFFF;
  font-size: 14px; outline: none; color: rgba(0, 0, 0, 0.85);
}
.wx-sr-count { flex-shrink: 0; font-size: 12px; color: rgba(0, 0, 0, 0.4); }
.wx-sr-close {
  flex-shrink: 0; border: none; background: transparent; color: #576B95;
  font-size: 14px; cursor: pointer; padding: 4px 2px;
}
.wx-sr-list { overflow-y: auto; flex: 1; padding: 6px 0; }
.wx-sr-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 14px; border: none; background: transparent; text-align: left; cursor: pointer;
}
.wx-sr-item:active { background: rgba(0, 0, 0, 0.05); }
.wx-sr-avatar { width: 36px; height: 36px; flex-shrink: 0; background-size: cover; background-position: center; background-color: #E5E5E5; }
.wx-sr-main { flex: 1; min-width: 0; }
.wx-sr-name { font-size: 13px; color: rgba(0, 0, 0, 0.45); }
.wx-sr-text {
  font-size: 14.5px; color: rgba(0, 0, 0, 0.85); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wx-sr-time { flex-shrink: 0; font-size: 11px; color: rgba(0, 0, 0, 0.35); }
.wx-sr-empty { padding: 36px 0; text-align: center; font-size: 13px; color: rgba(0, 0, 0, 0.35); }
/* 搜索命中高亮 */
.wx-sr-hit .ta-bubble, .wx-sr-hit.ta-bubble { outline: 2px solid #07C160; outline-offset: 1px; border-radius: 6px; }
.wx-sr-hit { border-radius: 8px; }
@media (prefers-color-scheme: dark) {
  .wx-search-overlay { background: #2C2C2C; }
  .wx-sr-head { border-color: rgba(255, 255, 255, 0.1); }
  .wx-sr-head input { background: #3A3A3A; color: rgba(255, 255, 255, 0.85); }
  .wx-sr-count { color: rgba(255, 255, 255, 0.4); }
  .wx-sr-item:active { background: rgba(255, 255, 255, 0.06); }
  .wx-sr-avatar { background-color: #3A3A3A; }
  .wx-sr-name { color: rgba(255, 255, 255, 0.45); }
  .wx-sr-text { color: rgba(255, 255, 255, 0.85); }
  .wx-sr-time { color: rgba(255, 255, 255, 0.35); }
  .wx-sr-empty { color: rgba(255, 255, 255, 0.35); }
  .wx-badge.wx-badge-muted { background: #5C5C5C; }
}

/* ========== 红包封面页（东方美学 · 鎏金朱砂奢华全屏） ========== */
.wx-rp-page {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 140;
  background:
    radial-gradient(120% 85% at 50% -8%, rgba(255, 185, 120, 0.28) 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 115%, rgba(26, 4, 3, 0.65) 0%, transparent 70%),
    linear-gradient(172deg, #A8241D 0%, #8A1A14 45%, #64110C 100%);
  display: flex; flex-direction: column;
  color: #FFFFFF;
}
.wx-rp-page .ta-wechat-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}
.wx-rp-page .ta-wechat-header .ta-wx-name {
  color: #FFFFFF;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.wx-rp-page .ta-wechat-header .ta-wx-back {
  color: #FFFFFF;
}

/* 桌面网页版（2026-10-10）：红包封面页不再镜像"假手机壳"（壳已撤掉）——贴着
   内容区右边满高显示，别压住左侧导航。仍受三重条件约束：触屏宽屏（iPad）不生效。 */
@media (min-width: 768px) {
  .wx-rp-page { left: var(--side-w); }
}

.wx-rp-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: calc(58px + env(safe-area-inset-top)) 18px 24px;
  overflow-y: auto;
}

/* 顶部伴侣专属礼遇封章 */
.wx-rp-recipient-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 6px 0 18px;
  text-align: center;
}
.wx-rp-avatar-halo {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #FFF0CC 0%, #F4CE75 45%, #D49326 100%);
  box-shadow: 0 10px 24px rgba(24, 3, 2, 0.38), 0 0 16px rgba(244, 206, 117, 0.3);
  margin-bottom: 10px;
}
.wx-rp-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.wx-rp-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #5C1D17, #360E0A);
  color: #FFF0CC;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wx-rp-recipient-title {
  font-size: 16px;
  font-weight: 500;
  color: #FFF6E5;
  letter-spacing: 0.5px;
}
.wx-rp-recipient-name {
  font-weight: 700;
  color: #FFE199;
}
.wx-rp-recipient-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(255, 230, 205, 0.68);
  letter-spacing: 1px;
}

/* 暖玉白柔光卡片 */
.wx-rp-input-card {
  width: 100%;
  background: rgba(255, 253, 248, 0.95);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 12px 30px rgba(25, 3, 2, 0.22);
  border: 1px solid rgba(255, 235, 215, 0.6);
  margin-bottom: 12px;
}
.wx-rp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wx-rp-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #4A3324;
}
.wx-rp-balance-hint {
  font-size: 11.5px;
  color: #9C7E6A;
  font-family: "JetBrains Mono", -apple-system, sans-serif;
}

.wx-rp-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid rgba(74, 51, 36, 0.1);
  padding-bottom: 8px;
}
.wx-rp-yen {
  font-size: 28px;
  font-weight: 700;
  color: #B5741E;
}
.wx-rp-amount-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 32px;
  font-weight: 700;
  font-family: "JetBrains Mono", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  color: #2F1B10;
  background: transparent;
}
.wx-rp-amount-input::placeholder {
  color: #D6C5B5;
}

/* 快捷选额胶囊 */
.wx-rp-presets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.wx-rp-preset-chip {
  flex: 1;
  min-width: 58px;
  padding: 5px 6px;
  border-radius: 12px;
  border: 1px solid rgba(181, 116, 30, 0.22);
  background: rgba(181, 116, 30, 0.06);
  color: #8A5313;
  font-size: 12px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.wx-rp-preset-chip:active {
  background: #B5741E;
  color: #FFFFFF;
  transform: scale(0.96);
}

/* 祝福语卡片 */
.wx-rp-note-card {
  padding: 14px 18px 12px;
}
.wx-rp-note-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: #352115;
  background: transparent;
  padding: 2px 0 8px;
  border-bottom: 1px solid rgba(74, 51, 36, 0.08);
}
.wx-rp-note-input::placeholder {
  color: #BBA999;
}
.wx-rp-note-presets {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.wx-rp-note-chip {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.03);
  color: #6C5544;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.wx-rp-note-chip:active {
  background: rgba(0, 0, 0, 0.08);
  color: #2F1B10;
}

.wx-rp-err {
  min-height: 20px;
  font-size: 12px;
  color: #FFD4D0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin: 2px 4px 6px;
  align-self: stretch;
  text-align: center;
}

/* 鎏金封签大按钮 */
.wx-rp-go {
  width: 100%;
  margin-top: 6px;
  border: none;
  cursor: pointer;
  min-height: 50px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #FFE49E 0%, #FFB535 50%, #EE8000 100%);
  color: #582A00;
  box-shadow: 0 10px 26px rgba(180, 50, 10, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: transform 0.15s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wx-rp-go:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}
.wx-rp-go:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.wx-rp-tip {
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(255, 230, 205, 0.72);
  letter-spacing: 0.5px;
  text-align: center;
}
/* ---- 拆红包详情页 ---- */
.wx-rp-detail-back { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 8px; z-index: 2; background: rgba(0, 0, 0, 0.14); border-radius: 8px; padding: 6px 10px 6px 6px; border: none; }
.wx-rp-detail-body {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0 30px 8vh;
}
/* 红包封：正红卡纸 + 上盖 + 金色「開」印 */
.wx-rp-cover {
  position: relative; width: 262px; height: 360px; border-radius: 16px;
  background: linear-gradient(168deg, #E8432A 0%, #CE3413 60%, #B92A10 100%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), inset 0 0 0 2px rgba(255, 214, 140, 0.4);
  perspective: 900px; transition: transform .5s ease, opacity .45s .35s;
}
/* 翻开后红包封缩小上移让位给金额 */
.wx-rp-page.is-open .wx-rp-cover { transform: translateY(-70px) scale(.72); }
.wx-rp-cover-circle {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%);
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #FFF3D6 0%, #F6CF7A 42%, #D9982E 76%, #B87C1E 100%);
  box-shadow: inset 0 0 0 3px rgba(126, 66, 0, 0.32), inset 0 0 0 4px rgba(255, 228, 168, 0.45), 0 4px 14px rgba(0, 0, 0, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 600; color: #8A4B00; font-family: var(--font-display);
}
.wx-rp-cover-note {
  position: absolute; left: 0; right: 0; top: 60%;
  text-align: center; font-size: 17px; color: #FFE9C4;
  padding: 0 24px; line-height: 1.5; transition: opacity .3s;
}
.wx-rp-page.is-open .wx-rp-cover .wx-rp-cover-note { opacity: 0; }
.wx-rp-reveal .wx-rp-reveal-note { position: static; color: #FFFFFF; opacity: 1; }
.wx-rp-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(180deg, #F04E30 0%, #D63317 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 16px 16px 0 0;
  transform-origin: top center;
  transition: transform .55s cubic-bezier(.6, .05, .3, 1), opacity .45s .1s;
  box-shadow: inset 0 -3px 0 rgba(255, 214, 140, 0.35);
  z-index: 2; border: none; padding: 0; cursor: pointer;
}
.wx-rp-open-btn {
  position: absolute; left: 50%; bottom: -40px; transform: translateX(-50%);
  width: 88px; height: 88px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 36% 28%, #FFF3D6 0%, #F6CF7A 42%, #D9982E 76%, #B87C1E 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 0 0 3px rgba(126, 66, 0, 0.35);
  font-size: 36px; font-weight: 600; color: #8A4B00; font-family: var(--font-display);
  -webkit-tap-highlight-color: transparent; z-index: 3;
  animation: wx-rp-pulse 1.6s ease-in-out infinite;
}
.wx-rp-open-btn:active { filter: brightness(.94); }
@keyframes wx-rp-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}
/* 翻盖动画 + 揭晓金额 */
.wx-rp-page.is-open .wx-rp-flap { transform: rotateX(-168deg); opacity: 0; pointer-events: none; }
.wx-rp-page.is-open .wx-rp-open-btn { opacity: 0; pointer-events: none; transition: opacity .3s; }
.wx-rp-reveal {
  position: absolute; left: 0; right: 0; bottom: 6vh;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; opacity: 0; transform: translateY(36px);
  transition: opacity .45s .32s, transform .5s .32s; pointer-events: none;
}
.wx-rp-page.is-open .wx-rp-reveal { opacity: 1; transform: none; }
.wx-rp-detail-who { font-size: 15px; color: rgba(255, 255, 255, 0.88); margin-bottom: 12px; letter-spacing: .5px; }
.wx-rp-detail-amount {
  font-size: 48px; font-weight: 700; color: #FFE3B8; line-height: 1.1;
  display: flex; align-items: baseline; gap: 5px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.wx-rp-detail-cur { font-size: 22px; font-weight: 600; }

/* ========== 梦圈发布页 + 动态互动区（点赞/评论） ========== */
/* ⛔ 底色必须用 --wx-page，不许写死 #FFFFFF：梦信有独立主题（data-wx-theme=dark 或系统深色），
   那种情况下 --wx-text 是近白的 rgba(255,255,255,.92)，写死白底就是**白底白字**。
   2026-09-22 用户报「梦圈打字看不到文字」——实测梦信深色时 .wx-mc-text
   文字 rgb(255,255,255) / 背景 rgb(255,255,255)，对比度 1.00；
   而占位符用 --wx-text3（深色下 #6E6E6E 中灰）在白底上看得见，
   所以现象正是「占位符看得见、自己打的字看不见」。防线见 scripts/guard-wx-contrast.mjs：
   量的是「文字色 vs 往上第一个不透明背景色」的对比度，四种主题组合都要过。 */
.wx-mc-page { background: var(--wx-page); }
.wx-mc-page .ta-thread { background: var(--wx-page); }
.wx-mc-body { padding: calc(58px + env(safe-area-inset-top)) 16px 14px; }
.wx-mc-text {
  width: 100%; min-height: 120px; border: none; outline: none; resize: none;
  font-size: 17px; line-height: 1.55; font-family: inherit; color: var(--wx-text);
  background: transparent;
}
.wx-mc-text::placeholder { color: var(--wx-text3); }
.wx-mc-err { min-height: 18px; font-size: 12px; color: #FA5151; margin: 6px 0; }
.wx-mc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.wx-mc-cell {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  background: var(--wx-press); border: none; padding: 0; cursor: pointer;
}
.wx-mc-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wx-mc-add {
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--wx-text2); font-weight: 200; background: var(--wx-bar);
}
.wx-mc-add:active { background: var(--wx-press); }
.wx-mc-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.55);
  color: #FFFFFF; font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}
.wx-mc-submit {
  border: none; background: #07C160; color: #FFFFFF; font-size: 14px; font-weight: 500;
  font-family: inherit; padding: 6px 16px; border-radius: 5px; cursor: pointer;
  margin-right: 44px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.wx-mc-submit:disabled { background: #A8E6BE; }
/* 动态互动区：微信式灰底圆角块 */
.wx-moment-social {
  margin-top: 8px; background: rgba(0, 0, 0, 0.045); border-radius: 4px;
  padding: 6px 10px; font-size: 13.5px; line-height: 1.6;
}
.wx-social-likes { color: var(--wx-text); }
.wx-social-heart { color: #576B95; font-size: 12px; margin-right: 6px; }
.wx-social-comma { color: var(--wx-text3); margin-right: 2px; }
.wx-social-name { color: #576B95; font-weight: 500; }
.wx-social-comment { color: var(--wx-text); }
.wx-social-comment.is-replyable { cursor: pointer; }
.wx-social-comment.is-replyable:active { opacity: .72; }
.wx-social-comment.is-replyable:focus-visible { outline: 2px solid #576B95; outline-offset: 2px; border-radius: 4px; }
.wx-social-comment .wx-social-name { margin-right: 2px; }
.wx-social-comment + .wx-social-comment { border-top: 1px solid rgba(0, 0, 0, 0.05); margin-top: 4px; padding-top: 4px; }
@media (prefers-color-scheme: dark) {
  .wx-moment-social { background: rgba(255, 255, 255, 0.06); }
  .wx-social-comment + .wx-social-comment { border-color: rgba(255, 255, 255, 0.06); }
}

/* ========== 梦圈三期：互动面板 / 详情页 / 互动消息 ========== */
.wx-moment-item { cursor: pointer; }
.wx-entry-badge { position: static; flex-shrink: 0; min-width: 16px; width: 16px; height: 16px; padding: 0; font-size: 10px; line-height: 16px; text-align: center; }
.wx-notifs-badge { position: static; flex-shrink: 0; margin-left: auto; }
.wx-moments-notifs-bar {
  display: flex; align-items: center; gap: 6px;
  margin: 10px 16px 0; padding: 11px 14px; border-radius: 8px;
  background: var(--wx-cell); font-size: 15px; color: var(--wx-text); cursor: pointer;
}
/* 时间线：透明顶栏浮在封面上，封面必须顶到页面顶部（覆盖 ta-thread 的顶部预留） */
.wx-moments-page .ta-thread { padding-top: 0; }
.wx-moment-detail-page,
.wx-moment-notifs-page { background: var(--wx-page); }
.wx-moment-detail-scroll {
  padding: calc(58px + env(safe-area-inset-top)) 16px 20px;
  background: var(--wx-page);
}
.wx-moment-detail-head { display: flex; align-items: center; gap: 10px; }
.wx-moment-detail-head .wx-avatar48 { width: 42px; height: 42px; border-radius: 6px; }
.wx-moment-detail-meta { display: flex; flex-direction: column; gap: 2px; }
.wx-moment-detail-text { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--wx-text); white-space: pre-wrap; }
.wx-moment-detail-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; }
.wx-moment-detail-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: pointer; }
.wx-moment-detail-scroll .wx-moment-social { margin-top: 12px; max-width: 100%; }
.wx-detail-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--wx-cell); border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.wx-detail-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: none; border-radius: 18px; background: var(--wx-bg); font-size: 15px;
  color: var(--wx-text); outline: none; font-family: inherit;
}
.wx-detail-send { border: none; background: none; color: #4D9AF0; font-size: 15px; padding: 6px 4px; cursor: pointer; }
.wx-detail-send:disabled { color: #B2B2B2; }
.wx-detail-like { border: none; background: none; font-size: 24px; line-height: 1; color: #7F7F7F; padding: 0 6px; cursor: pointer; }
.wx-detail-like.liked { color: #07C160; }
.wx-notifs-list { padding: 8px 0; }
.wx-notif-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--wx-cell); cursor: pointer; }
.wx-notif-item:active { background: var(--wx-press); }
.wx-notif-avatar {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: #4D9AF0; color: #FFFFFF; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.wx-notif-body { flex: 1; min-width: 0; }
.wx-notif-text { font-size: 14px; color: var(--wx-text); line-height: 1.45; }
.wx-notif-actor { color: #576B95; font-weight: 600; }
.wx-notif-time { margin-top: 2px; font-size: 12px; color: var(--wx-text3); }
.wx-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #FA5151; flex-shrink: 0; margin-left: auto; }
@media (prefers-color-scheme: dark) {
  .wx-moment-detail-scroll .wx-moment-social { background: rgba(255, 255, 255, 0.06); }
}

/* ========== 梦圈四期：微信式气泡菜单 + 就地评论 + 右下角两点图标 ========== */
.wx-moment-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.wx-moment-meta .wx-moment-time { margin-top: 0; }
.wx-moment-dots {
  display: flex; align-items: center; gap: 3px;
  padding: 8px 2px 6px 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-moment-dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--wx-text3);
}
/* 顶栏两点（右上角消息入口）：点击区加大，圆点稍大，跟随透明顶栏的白色按钮 */
.wx-header-dots { padding: 10px 12px; }
.wx-header-dots span { width: 5px; height: 5px; }
.wx-moments-page .wx-header-dots span { background: #FFFFFF; opacity: 0.95; }
.wx-moment-me-link { cursor: pointer; }
/* 个人梦圈：封面略深色渐变做区分，标题白字浮在封面上 */
.wx-moments-cover.me-cover {
  background: linear-gradient(165deg, #4A5A78 0%, #6E8098 55%, #A7B4C4 100%);
}
.wx-moments-page .ta-wechat-header .ta-wx-name { color: #FFFFFF; }
.wx-moment-menu {
  position: fixed; z-index: 120;
  display: flex; gap: 2px;
  background: var(--wx-cell);
  border-radius: 8px; padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.wx-moment-menu::before {
  content: ''; position: absolute; top: -6px; left: 50%; margin-left: -6px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 6px solid var(--wx-cell);
}
.wx-moment-menu.up::before {
  top: auto; bottom: -6px;
  border-bottom: none; border-top: 6px solid var(--wx-cell);
}
.wx-mm-item {
  background: none; border: none; padding: 9px 16px;
  font-size: 14.5px; color: var(--wx-text); cursor: pointer;
  border-radius: 6px; font-family: inherit;
}
.wx-mm-item:active { background: var(--wx-press); }
.wx-moment-comment-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.wx-mic-input {
  flex: 1; min-width: 0; height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.14); border-radius: 17px;
  padding: 0 14px; font-size: 14px; outline: none;
  background: var(--wx-page); color: var(--wx-text); font-family: inherit;
}
.wx-mic-send {
  border: none; background: none; color: #4D9AF0;
  font-size: 14px; padding: 6px 2px; cursor: pointer; font-family: inherit;
}
.wx-mic-send:disabled { color: #B2B2B2; }

/* ---------- 抖音群悬浮球（全局左上、可拖动，44px 比梦信球小一号） ---------- */
.promo-fab {
  position: fixed;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #1a1a1a 0%, #000 60%, #161616 100%);
  border: 1.5px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
  cursor: grab; user-select: none; touch-action: none;
  z-index: 45;
  transition: box-shadow .18s ease, transform .12s ease;
  padding: 0;
}
.promo-fab:active { cursor: grabbing; }
.promo-fab.dragging { transition: none; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.promo-fab .promo-note svg { width: 22px; height: 22px; display: block; }
.promo-fab .promo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fe2c55; position: absolute; top: 5px; right: 6px;
  box-shadow: 0 0 8px rgba(254,44,85,.9); border: 1.5px solid #fff;
}
.phone .promo-fab { position: absolute; }
.promo-card {
  position: fixed;
  width: 260px; max-width: calc(100vw - 32px);
  background: var(--surface); color: inherit;
  border: 1px solid var(--outline); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  padding: 14px 14px 12px; z-index: 60;
}
.phone .promo-card { position: absolute; }
.promo-card[hidden] { display: none; }
.promo-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.promo-hook { font-size: 13px; line-height: 1.5; opacity: .92; margin-bottom: 4px; }
.promo-hook.sub { opacity: .7; font-size: 12px; margin-bottom: 10px; }
.promo-copy {
  width: 100%; border: none; border-radius: 10px; padding: 10px 0;
  background: var(--primary-fill); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.promo-copy:active { transform: scale(.98); }
.promo-hint { font-size: 11px; opacity: .6; text-align: center; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .promo-fab { transition: none; } }

/* ==========================================================================
   梦信群聊（modules/group.js）
   单聊的样式全在 app.css 的 .ta-wechat/.ta-msg/.ta-bubble 系列里，群聊直接复用；
   这里只补群聊**独有**的东西：群头像拼图、发言人名字、@ chip、建群选择器、群记忆面板。
   为什么不开新文件：index.html 只引 app.css（messages 那份是未发版的），
   新开一份 css 不引进来等于没写。
   ========================================================================== */

/* ---------- 会话列表：群头像 2×2 拼图 ---------- */
.wx-group-avatar {
  width: 48px; height: 48px; border-radius: 8px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 1px; background: var(--wx-line, #e5e5e5); flex: 0 0 auto;
}
.wx-group-avatar.is-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.wx-group-avatar-cell {
  background-size: cover; background-position: center; background-color: var(--wx-avatar-bg, #ddd);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; overflow: hidden;
}
.wx-group-avatar-cell.is-empty { background-color: var(--wx-avatar-bg, #e8e8e8); }
.wx-group-avatar-cell.is-more { background-color: #9aa0a6; font-weight: 600; }
.wx-group-avatar.is-grid-3 .wx-group-avatar-cell { font-size: 7px; }
/* 列表分组小标题（群 / 单聊之间） */
.wx-list-section {
  font-size: 12px; color: var(--wx-text3, #9a9a9a);
  padding: 10px 16px 4px; background: transparent;
}

/* ---------- 群聊页顶栏：名字 + 成员一行 ---------- */
.wx-group-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.wx-group-title .ta-wx-name { max-width: 100%; }

/* ---------- 群聊消息：发言人名字 + 头像占位 ---------- */
/* 外层盒子做三件事：名字在上气泡在下的纵向排列、宽度受行宽约束、不被 flex 压缩挤没。
   为什么必须显式给 min-width:0 —— .ta-msg .ta-bubble 上写着 max-width:68%，
   百分比是**相对这个盒子**解析的。盒子若也是收缩宽度，68% 会相对一个很小的基准算，
   气泡被压窄成窄条。所以这里把盒子的宽度基准钉在"行宽减去头像"，气泡的 68% 才有意义。
   同时盒子自身要收缩到内容宽（align-items 决定），否则气泡会被撑满、头像与文字之间空一大段。 */
.wx-msg-box {
  display: flex; flex-direction: column; align-items: flex-start;
  flex: 0 1 auto; min-width: 0; max-width: calc(100% - 48px);
}
.wx-msg-name { font-size: 11px; color: var(--wx-text3, #9a9a9a); margin: 0 0 2px 2px; }
.ta-msg.user .wx-msg-box { align-items: flex-end; }
/* 连发合并时补一个等宽空位，保持气泡左边缘对齐 */
.ta-avatar-spacer { visibility: hidden; }
.ta-avatar-fallback, .wx-avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; background: #b9b2ad;
}

/* ---------- 输入区：@ chip ---------- */
.wx-input-wrap { flex: 0 0 auto; background: var(--wx-bg, #f7f7f7); border-top: 1px solid var(--wx-line, #e5e5e5); }
.wx-mention-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.wx-mention-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(7,193,96,.12); color: #07c160;
  border-radius: 12px; padding: 2px 8px; font-size: 13px;
}
.wx-mention-x {
  border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0 0 0 2px;
}
.wx-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
/* ⛔ 白底输入框必须自带主题文字色，不能用 color: inherit：
   半梦主题（data-theme=dark）与梦信主题互相独立，App 深色时 inherit 会拿到近白的正文色，
   叠在写死的白底上就是白底白字（2026-09-22 实测对比度 1.15，同样是"打字看不见"）。 */
.wx-input {
  flex: 1; min-height: 36px; max-height: 120px; resize: none;
  border: 1px solid var(--wx-line, #e5e5e5); border-radius: 6px;
  padding: 8px 10px; font-size: calc(15px * var(--chat-input-scale, 1)); font-family: inherit; line-height: 1.4;
  background: var(--wx-cell); color: var(--wx-text);
}
.wx-input:focus { outline: none; border-color: rgba(7,193,96,.6); }
/* @ 选人入口：长按头像只能 @ 到已经说过话的人（头像才在屏幕上），
   而"点名让沉默的人开口"恰恰最需要 @——所以输入区必须有一个不依赖历史的入口。 */
.wx-at-btn {
  flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--wx-line, #e5e5e5);
  border-radius: 6px; background: #fff; color: #07c160;
  font-size: 18px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.wx-at-btn:active { background: var(--wx-press); }
.wx-at-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(0,0,0,.35); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.wx-at-sheet {
  width: 100%; max-width: 540px; background: var(--wx-cell); color: var(--wx-text);
  border-radius: 12px 12px 0 0;
  padding-bottom: env(safe-area-inset-bottom); max-height: 70vh; overflow-y: auto;
}
.wx-at-title { font-size: 13px; color: var(--wx-text3, #9a9a9a); padding: 14px 16px 6px; }
.wx-at-cancel {
  display: block; width: 100%; height: 48px; border: 0; border-top: 1px solid var(--wx-sep, #f2f2f2);
  background: transparent; font-size: 15px; font-family: inherit; cursor: pointer; color: inherit;
}
.wx-send {
  flex: 0 0 auto; height: 36px; padding: 0 16px; border: 0; border-radius: 6px;
  background: #07c160; color: #fff; font-size: 15px; font-family: inherit; cursor: pointer;
}
.wx-send:disabled { background: #c8c9cc; cursor: default; }

/* ---------- 建群页 ---------- */
.wx-pick-count { font-size: 13px; color: var(--wx-text3, #9a9a9a); }
.wx-pick-cell { position: relative; }
.wx-pick-cell.picked { background: rgba(7,193,96,.06); }
.wx-pick-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--wx-line, #ddd);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; flex: 0 0 auto;
}
.wx-pick-cell.picked .wx-pick-check { background: #07c160; border-color: #07c160; }
.wx-pick-footer {
  flex: 0 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--wx-line, #e5e5e5); background: var(--wx-bg, #f7f7f7);
}
.wx-pick-ok {
  width: 100%; height: 44px; border: 0; border-radius: 6px;
  background: #07c160; color: #fff; font-size: 16px; font-family: inherit; cursor: pointer;
}
.wx-pick-ok:disabled { background: #c8c9cc; cursor: default; }

/* ---------- 群设置 / 群记忆 ---------- */
.wx-entry-value { flex: 1; text-align: right; color: var(--wx-text3, #9a9a9a); font-size: 15px; }
.wx-entry-cell.wx-danger .wx-entry-label { color: #fa5151; }
/* 三选一分段控件（群接话频率 / 梦圈发帖·评论频率；wx-seg.js） */
.wx-seg-row { padding: 12px 16px 14px; background: var(--wx-cell, #fff); }
.wx-seg-title { font-size: 16px; color: var(--wx-text, #111); }
.wx-seg { display: flex; margin-top: 10px; padding: 3px; border-radius: 8px; background: var(--wx-bg, #f2f2f2); }
.wx-seg-btn {
  flex: 1 1 0; min-width: 0; height: 34px; border: 0; border-radius: 6px; margin-left: 3px;
  background: transparent; color: var(--wx-text2, #555); font-size: 14px; font-family: inherit; cursor: pointer;
}
.wx-seg-btn:first-child { margin-left: 0; }
.wx-seg-btn.on { background: #fff; color: #07a35a; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.wx-seg-btn.locked { color: var(--wx-text3, #9a9a9a); }
.wx-seg-tag { margin-left: 3px; padding: 0 4px; border-radius: 6px; background: #fff1d1; color: #a8650c; font-size: 10px; font-weight: 400; vertical-align: 1px; }
.wx-seg-hint { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--wx-text3, #9a9a9a); }
.wx-group-section { font-size: 12px; color: var(--wx-text3, #9a9a9a); padding: 10px 16px 6px; }
.wx-member-remove {
  flex: none;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(250, 81, 81, .45);
  border-radius: 999px;
  background: transparent;
  color: #d9363e;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.wx-member-remove:active { background: rgba(250, 81, 81, .08); }
.wx-member-remove:disabled { opacity: .35; cursor: default; }
.wx-entry-cell.is-disabled { opacity: .55; cursor: default; }
.wx-mem-scroll { padding-bottom: 32px; }
.wx-mem-intro {
  font-size: 13px; line-height: 1.6; color: var(--wx-text3, #8a8a8a);
  padding: 14px 16px 6px;
}
/* ⛔ 同 .wx-input：白卡要自带主题文字色，否则 App 深色时卡内文字继承到近白色 = 白底白字 */
.wx-mem-card {
  background: var(--wx-cell); color: var(--wx-text);
  margin: 10px 12px; border-radius: 10px; padding: 12px 14px;
}
.wx-mem-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wx-mem-title { font-size: 14px; font-weight: 600; }
.wx-mem-edit {
  border: 1px solid rgba(7,193,96,.5); background: transparent; color: #07c160;
  border-radius: 12px; padding: 2px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.wx-mem-text { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.wx-mem-empty { font-size: 13px; color: var(--wx-text3, #9a9a9a); padding: 4px 0; }
.wx-mem-atom { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid #f2f2f2; }
.wx-mem-atom:first-of-type { border-top: 0; }
.wx-mem-cat {
  flex: 0 0 auto; font-size: 11px; color: #07c160; background: rgba(7,193,96,.1);
  border-radius: 8px; padding: 1px 6px; margin-top: 2px;
}
.wx-mem-atom-text { flex: 1; font-size: 14px; line-height: 1.55; word-break: break-word; }
.wx-mem-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.wx-mem-op {
  border: 1px solid var(--wx-line, #ddd); background: transparent; color: inherit;
  border-radius: 10px; padding: 1px 8px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.wx-mem-op-danger { color: #fa5151; border-color: rgba(250,81,81,.4); }
.wx-mem-weave {
  display: block; width: calc(100% - 24px); margin: 16px 12px 0; height: 44px;
  border: 0; border-radius: 10px; background: var(--primary, #6b5b8e); color: #fff;
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.wx-mem-weave:disabled { opacity: .6; cursor: default; }

/* ==========================================================================
   卷宗对话 · 2026-09-28 改版（chat.js openThread：流式 = 小说排版，沉浸 = 全屏舞台）
   只动外观；消息 DOM（.msg-group / .scene-block / .msg-bubble）与流式增量渲染器一概未改。
   ========================================================================== */
/* 满屏：聊天时收起「半梦」页眉与底部标签（chat.js markThreadShell / main.js refreshBody 摘除） */
.app-shell.thread-mode .app-header,
.app-shell.thread-mode .app-nav { display: none; }
.app-body.body-thread .thread-wrap { padding: 0; gap: 0; }
/* 入梦对话页开「沉浸」时（应用设置 → 显示细节 → 入梦对话页沉浸，2026-11-14 工单 2bc363ea）：
   markThreadShell() 顺手给 #app-body 挂了 .body-thread（内边距归零），卷宗那边有 .thread-wrap
   接住这层内边距，入梦页没有 ⇒ 旁白与输入框会贴到屏幕边（比开沉浸前两边各少 20px）。
   这里给舞台补回 14px（与 .thread-wrap 同值），左右留白与开沉浸前基本一致。 */
.app-shell.thread-mode .app-body .dream-stage {
  padding-left: 14px; padding-right: 14px;
  /* 底部同理：默认态由 .app-body 的 20px 兜着，沉浸态归零后输入区会贴到屏幕下沿
     （iPhone 上是小黑条那条安全区）——这里补回来，有安全区就跟着安全区走。 */
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
}

/* 顶栏：← 头像 名字/在哪 ⋯ */
.th-top {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top)) 6px 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--outline);
  position: relative; z-index: 3;
}
.th-top-btn {
  width: 42px; height: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: transparent; color: var(--on-bg);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.th-top-btn:active { background: var(--surface-variant); }
.th-top-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.cavatar.th-top-av { width: 34px; height: 34px; font-size: 14px; }
.th-top-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.th-top-name { flex-direction: row; align-items: baseline; gap: 6px; line-height: 1.25; }
.th-top-name .ui-name-main { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--on-bg); flex-shrink: 0; max-width: 100%; }
.th-top-name .ui-name-role { font-size: 12px; margin: 0; color: var(--on-surface-variant); opacity: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-top-sub { font-size: 11.5px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-top-sub:empty { display: none; }

/* ⋯ 弹层 */
.th-sheet { gap: 18px; }
.th-sheet .th-world-chips { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
.th-sheet .th-world-chips .chip { padding: 7px 14px; font-size: 13px; }

/* ---------- 流式：小说排版 ---------- */
.th-stream .thread-scroll { padding: 0 18px; scrollbar-width: none; }
.th-stream .thread-scroll::-webkit-scrollbar { display: none; }
.th-stream .thread { gap: 26px; padding-top: 16px; }
.th-stream .char-banner { height: 168px; border-radius: 18px; }
.th-stream .char-banner-info strong { font-size: 22px; }
/* 角色一侧整栏排：旁白是正文，台词是带引线的对白——不再是「灰色小字 + 聊天气泡」 */
.th-stream .msg-group.assistant { max-width: 100%; align-self: stretch; gap: 10px; }
.th-stream .msg-group.assistant .msg-live { gap: 10px; align-items: stretch; }
.th-stream .msg-group.assistant .scene-block { padding: 0; text-align: left; }
.th-stream .msg-group.assistant .scene-text {
  font-size: calc(15px * var(--chat-scale, 1)); line-height: 1.95; letter-spacing: .02em;
  /* 正文色降一档而不是 --on-surface-variant：深色主题下后者只剩约 3:1，旁白是正文、不能读着费劲 */
  color: var(--on-bg); opacity: .74;
}
.th-stream .msg-group.assistant .scene-text::before { content: none; }
.th-stream .msg-group.assistant .msg-bubble {
  background: none; border: none; border-radius: 0; box-shadow: none;
  padding: 1px 0 1px 14px;
  border-left: 2px solid var(--primary-text);
  font-size: calc(16px * var(--chat-scale, 1)); line-height: 1.85; color: var(--on-bg);
}
.th-stream .msg-group.assistant .msg-head { margin-bottom: 0; }
.th-stream .msg-head .cavatar { width: 26px; height: 26px; font-size: 12px; }
.th-stream .msg-role { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--on-bg); opacity: 1; }
.th-stream .msg-role.user { color: var(--primary-text); }
/* 你这一侧保持紧凑的右侧气泡：一眼分清「我写的」与「故事本身」。
   圆角必须走 --bub-* 令牌：流式是默认皮肤，用户侧气泡是唯一还在的「气泡」，
   写死 18px 的话气泡样式预设在默认皮肤下完全看不见（2026-10-09 守卫抓到的漏接）。 */
.th-stream .msg-group.user { max-width: 82%; }
.th-stream .msg-group.user .msg-head { display: none; }
.th-stream .msg-group.user .msg-bubble {
  border-radius: var(--bub-r) var(--bub-r) var(--bub-tail) var(--bub-r);
  padding: 10px 15px;
}
.th-stream .msg-actions { margin-top: 0; padding: 0; }
.th-stream .msg-group.assistant .msg-actions { margin-left: 10px; }

/* 输入区：更紧的间距；图片按钮用线性图标 */
.th-stream .composer, .vn-wrap .composer { gap: 6px; padding-left: 10px; padding-right: 10px; }
.composer .attach-btn { display: inline-flex; align-items: center; justify-content: center; }
.send-btn.is-advance { font-family: var(--font-display); font-size: 16px; font-weight: 600; }

/* ---------- 沉浸：全屏舞台 ---------- */
.vn-wrap { position: relative; background: #0d0f14; }
.vn-wrap .vn-stage {
  border: none; border-radius: 0;
  background: linear-gradient(180deg, #23252d 0%, #0d0f14 100%);
  cursor: pointer;
}
/* 手机竖屏：立绘铺满（旧版 contain 两侧是大片暗边）；宽屏仍 contain，免得脸被裁掉 */
.vn-wrap .vn-figure { background-size: cover; background-position: center 12%; }
@media (min-aspect-ratio: 4/5) {
  .vn-wrap .vn-figure { background-size: contain; background-position: center bottom; }
}
/* 上下两道暗角：顶栏与对话框压在画面上也看得清 */
.vn-wrap .vn-stage::before,
.vn-wrap .vn-stage::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.vn-wrap .vn-stage::before { top: 0; height: 140px; background: linear-gradient(rgba(8, 9, 12, .7), rgba(8, 9, 12, 0)); }
.vn-wrap .vn-stage::after { bottom: 0; height: 58%; background: linear-gradient(rgba(8, 9, 12, 0), rgba(8, 9, 12, .88)); }
.vn-wrap .th-top {
  position: absolute; top: 0; left: 0; right: 0;
  background: none; border-bottom: none; color: #f3efe8;
}
.vn-wrap .th-top-btn { color: #f3efe8; }
.vn-wrap .th-top-btn:active { background: rgba(255, 255, 255, .12); }
.vn-wrap .th-top-name .ui-name-main { color: #f3efe8; }
.vn-wrap .th-top-name .ui-name-role, .vn-wrap .th-top-sub { color: rgba(243, 239, 232, .7); }
.vn-wrap .cavatar.th-top-av { border-color: rgba(255, 255, 255, .25); }
/* 对话框：深色半透明压在舞台下方（不用 backdrop-filter：大面积模糊层在安卓 WebView 上易漏绘） */
.vn-wrap .vn-box {
  z-index: 2; margin: 0 12px 14px; padding: 14px 16px 10px;
  border-radius: 16px;
  background: rgba(16, 17, 22, .78);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  color: #f3efe8;
  max-height: min(46%, 380px);
}
.vn-wrap .vn-nameplate { color: #f0a88c; font-size: 16px; }
.vn-wrap .vn-nameplate.user { color: #a9c7b4; }
.vn-wrap .vn-counter { color: rgba(243, 239, 232, .5); }
.vn-wrap .vn-content { font-size: calc(16px * var(--chat-scale, 1)); line-height: 1.85; }
.vn-wrap .vn-line { color: #f3efe8; }
.vn-wrap .vn-narr { font-size: calc(14px * var(--chat-scale, 1)); line-height: 1.85; color: rgba(243, 239, 232, .66); }
.vn-wrap .vn-line.error { color: #ffb4a0; }
.vn-wrap .vn-steppers .chip {
  min-height: 32px; padding: 5px 12px; font-size: 12px;
  background: rgba(255, 255, 255, .08); color: rgba(243, 239, 232, .85);
  border-color: rgba(255, 255, 255, .14);
}
.vn-wrap .vn-name-row .cavatar { border-color: rgba(255, 255, 255, .25); }
/* 水位环 24px、按钮 46px，都贴底对齐时环会比同行低半截：垫到与单行输入框同一条中线（多行时仍贴底） */
.th-stream .composer .ctx-ring, .vn-wrap .composer .ctx-ring { margin: 0 2px 11px 4px; }
.th-stream .composer .attach-btn, .vn-wrap .composer .attach-btn { align-self: flex-end; margin-bottom: 4px; }
/* 没立绘的角色：舞台中央一枚大号首字（有立绘 / 世界场景图时藏掉） */
.vn-initial { display: none; }
.vn-wrap .vn-stage:not(.has-art) .vn-initial {
  display: flex; align-items: center; justify-content: center;
  position: absolute; left: 0; right: 0; top: 0; bottom: 34%;
  font-family: var(--font-display); font-size: 148px; line-height: 1;
  color: rgba(240, 168, 140, .16); pointer-events: none; user-select: none;
}

/* ---------- 卷宗对话 · 细节二轮（2026-09-28） ---------- */
/* 消息头 / 沉浸名牌只显示名字：身份已经在顶栏写了，每条都重复一遍是噪音（uiName 保留完整 textContent） */
.msg-role .ui-name, .vn-nameplate .ui-name { display: inline; }
.th-stream .msg-role .ui-name-role, .vn-nameplate .ui-name-role { display: none; }
/* 旧消息的操作栏：以前只是 opacity:0，位置还占着 ⇒ 每条消息底下一块空白。
   触屏上（没有悬停）直接不占位——长按菜单里同样有这些操作；桌面端保留悬停显现 */
@media (hover: none) {
  .th-stream .msg-group:not(.is-latest) .msg-actions { display: none; }
}
/* 你写的动作（括号 / 星号）：与 TA 那侧同一套正文排版，只是靠右——不再是灰色小字 + ✦ */
.th-stream .msg-group.user .scene-block { padding: 0 2px; }
.th-stream .msg-group.user .scene-text {
  font-size: calc(14px * var(--chat-scale, 1)); line-height: 1.8; letter-spacing: .02em;
  color: var(--on-bg); opacity: .62;
}
.th-stream .msg-group.user .scene-text::before { content: none; }
/* 「续」是空输入时最常看到的键：别淡到看不出能点 */
.th-stream .send-btn.is-advance, .vn-wrap .send-btn.is-advance { opacity: 1; border-color: var(--primary); }

/* 沉浸：输入栏跟舞台连成一片（以前是一条浅色横在深色画面底下）。只改颜色，不动尺寸与层 */
.vn-wrap .composer { background: #0d0f14; border-top-color: rgba(255, 255, 255, .08); }
.vn-wrap .composer textarea {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #f3efe8;
}
.vn-wrap .composer textarea::placeholder { color: rgba(243, 239, 232, .5); opacity: 1; }
.vn-wrap .composer textarea:focus { border-color: #f0a88c; box-shadow: none; }
.vn-wrap .composer .attach-btn { color: rgba(243, 239, 232, .75); }
.vn-wrap .composer .attach-btn:hover { background: rgba(255, 255, 255, .08); }
.vn-wrap .ctx-ring::after { background: #0d0f14; }
.vn-wrap .ctx-ring { --outline: rgba(255, 255, 255, .18); }
.vn-wrap .ctx-ring-txt { color: rgba(243, 239, 232, .6); }
.vn-wrap .send-btn.is-advance { background: rgba(255, 255, 255, .06); color: #f0a88c; border-color: rgba(240, 168, 140, .6); }
.vn-wrap .send-btn.is-disabled { background: rgba(255, 255, 255, .1); color: rgba(243, 239, 232, .6); }

/* ==========================================================================
   梦信 · 输入区对齐微信（2026-09-28）：面板嵌在输入栏下方、表情内嵌进文字
   wechat.js openWechatChat：.wx-panel-box 跟在 .ta-composer 后面、随文档流撑开，
   .ta-wechat 是 flex 列、.ta-thread flex:1 ⇒ 面板打开时聊天区自动上移，不遮挡、无遮罩。
   ========================================================================== */
.ta-composer .ta-wx-emoji svg, .ta-composer .ta-wx-plus svg { width: 27px; height: 27px; display: block; }
.ta-composer .ta-wx-emoji { font-size: 0; }
/* 面板打开时安全区交给面板：输入栏不再垫底部安全区 */
.ta-wechat.wx-panel-open .ta-composer { padding-bottom: 7px; }
.wx-panel-box {
  flex-shrink: 0; position: relative;
  height: calc(258px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--wx-bar, #F7F7F7); border-top: 1px solid var(--wx-sep, rgba(0, 0, 0, 0.06));
  overflow: hidden;
}
/* 表情面板：8 列网格可滚动；右下角「⌫ / 发送」浮在网格上（微信同款） */
.wx-emoji-panel { position: relative; height: 100%; }
.wx-emoji-grid {
  height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(8, 1fr); align-content: start;
  gap: 6px 2px; padding: 14px 10px 64px;
}
.wx-emoji-item {
  aspect-ratio: 1; border: none; background: transparent; padding: 0; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-emoji-item img { width: 30px; height: 30px; object-fit: contain; pointer-events: none; }
.wx-emoji-item:active { background: var(--wx-press, #E5E5E5); }
.wx-emoji-actions {
  position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px;
  padding: 8px 0 0 16px;
  background: linear-gradient(to right, transparent, var(--wx-bar, #F7F7F7) 16px);
}
.wx-emoji-del, .wx-emoji-send {
  height: 38px; border: none; border-radius: 6px; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.wx-emoji-del { width: 52px; background: var(--wx-cell, #fff); color: var(--wx-text, #191919); }
.wx-emoji-del svg { width: 24px; height: 24px; }
.wx-emoji-del:active { background: var(--wx-press, #E5E5E5); }
.wx-emoji-send { min-width: 62px; padding: 0 14px; background: #07C160; color: #fff; font-size: 15px; font-weight: 500; }
.wx-emoji-send:active { background: #06AD56; }
/* ＋ 面板：4 列图标网格（微信安卓 / iOS 同款的白色圆角方块 + 灰字） */
.wx-plus-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 8px;
  padding: 22px 18px; align-content: start;
}
.wx-plus-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: none; background: transparent; padding: 0; cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.wx-plus-ico {
  width: 60px; height: 60px; border-radius: 14px;
  background: var(--wx-cell, #fff); color: var(--wx-text, #191919);
  display: flex; align-items: center; justify-content: center;
}
.wx-plus-ico svg { width: 30px; height: 30px; }
.wx-plus-item:active .wx-plus-ico { background: var(--wx-press, #E5E5E5); }
.wx-plus-txt { font-size: 12px; color: var(--wx-text2, #999); }
.wx-ai-panel { height: 100%; display: flex; flex-direction: column; }
.wx-ai-head {
  padding: 10px 18px 0; font-size: 12px; line-height: 1.4;
  color: var(--wx-text2, #999);
}
.wx-ai-grid {
  flex: 1; grid-template-columns: repeat(4, 1fr);
  padding-top: 14px; align-content: start;
}
/* 气泡里的内嵌小黄脸：跟字号走、与文字基线对齐；整条只有一个表情时稍放大（微信单发一个小黄脸也这样） */
.ta-bubble .wx-emoji { width: 1.3em; height: 1.3em; vertical-align: -0.28em; margin: 0 1px; object-fit: contain; }
.ta-bubble.wx-emoji-only .wx-emoji { width: 30px; height: 30px; vertical-align: middle; margin: 0; }
/* 聊天顶栏状态：以前没有样式，继承了名字的 17px 粗体（「● 正醒着」比名字还抢眼）。
   现在是微信副标题那一档：11px 常规灰字 + 一个小色点（醒着绿、在梦里浅灰、在别处空心） */
.ta-wechat-header .ta-wx-name .ta-wx-state {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 1px; font-size: 11px; font-weight: 400; line-height: 1.2;
  color: var(--wx-text2, #999);
}
.ta-wechat-header .ta-wx-name .ta-wx-state::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--wx-text3, #B2B2B2);
}
.ta-wechat-header .ta-wx-name .ta-wx-state.on::before { background: #07C160; }
.ta-wechat-header .ta-wx-name .ta-wx-state.away::before { background: transparent; box-shadow: inset 0 0 0 1px var(--wx-text3, #B2B2B2); }
.ta-wechat-header .ta-wx-name .ta-wx-state.writing::before { display: none; }
.ta-wechat-header .ta-wx-name .ta-wx-title-text { display: block; }
.ta-wechat-header .ta-wx-name .ta-wx-typing {
  display: none; margin-top: 1px;
  font-size: 11px; font-weight: 400; line-height: 1.2;
  color: var(--wx-text2, #999); white-space: nowrap;
}
.ta-wechat-header .ta-wx-name.is-typing .ta-wx-typing { display: block; }
.ta-wechat-header .ta-wx-name.is-typing .ta-wx-title-text {
  font-size: 16px; line-height: 1.1;
}
/* 「我」页入口图标（微信同款：每个入口左侧一枚着色图标） */
.wx-me-ico { width: 24px; height: 24px; margin-right: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.wx-me-ico svg { width: 24px; height: 24px; }
.wx-me-ico.tone-green { color: #07C160; }
.wx-me-ico.tone-blue { color: #3E8EEF; }
.wx-me-ico.tone-orange { color: #F2A33A; }
.wx-me-ico.tone-gray { color: var(--wx-text2, #999); }
/* 设置页分组小标题（微信设置页分组上方的灰字） */
.wx-sec-title { padding: 14px 16px 6px; font-size: 13px; color: var(--wx-text2, #999); }
/* 列表行：左侧标题永不折行、右侧灰字提示放不下就省略（微信设置页同款）。
   以前反过来——标题可缩可折、提示不缩，于是「显示没说出口的部分」被右侧长提示挤成两行（「分」单独一行） */
.wx-entry-cell .wx-entry-label { flex: 1 0 auto; white-space: nowrap; }
.wx-entry-cell .wx-entry-hint { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ⛔ 群聊气泡被提前折行（2026-09-28 体检发现，上面那段注释想修但没修住）：
   .wx-msg-box 是收缩宽度（flex: 0 1 auto），气泡的 max-width:68% 是相对这个**已经按内容收缩过的盒子**算的
   ⇒ 盒子先按内容定宽、气泡再缩到它的 68% ⇒ 每条消息都在自然宽度的三分之二处被强行折行
   （实测「今天雨好大😭」5 个字折成两行、「来书店躲雨吧，我给你 / 们留了热茶」右边空着一大块）。
   改为：68% 上限挂在盒子上（相对行宽，行宽是确定的），气泡在盒子里占满 100% ⇒ 与单聊同一个折行宽度。 */
.ta-msg .wx-msg-box { max-width: 68%; }
.ta-msg .wx-msg-box .ta-bubble { max-width: 100%; }
/* 群聊输入栏与单聊对齐（2026-09-28）：@ 与表情都是无框图标键，发送键有字才出现（group.js syncSend） */
.wx-input-row { gap: 6px; align-items: flex-end; }
.wx-at-btn {
  width: 38px; height: 38px; border: none; background: transparent; color: var(--wx-text, #191919);
  font-size: 22px; font-weight: 400; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wx-emoji-btn {
  flex: 0 0 auto; width: 38px; height: 38px; border: none; background: transparent; padding: 0;
  color: var(--wx-text, #191919); display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wx-emoji-btn svg { width: 27px; height: 27px; }
.wx-at-btn:active, .wx-emoji-btn:active { background: var(--wx-press); border-radius: 6px; }
.wx-input-wrap.wx-panel-open .wx-input-row { padding-bottom: 8px; }
/* 内嵌小黄脸通用尺寸（梦圈正文 / 评论等非气泡处；气泡里另有同名规则） */
img.wx-emoji { width: 1.3em; height: 1.3em; vertical-align: -0.28em; margin: 0 1px; object-fit: contain; }
/* 深色模式下自己的绿气泡用黑字（2026-09-28 体检：白字压 #3EB575 对比度只有 2.49）。
   真微信深色模式也是绿底黑字（约 8:1）。--wx-bubble-user-text 同时管着 TA 气泡的字色，不能改令牌，
   所以只对自己的气泡单独覆盖；浅色主题本来就是这个值，行为不变。 */
.wx-light .ta-msg.user .ta-bubble { color: rgba(0, 0, 0, 0.9); }
/* 左滑出来的「取消置顶」：白字压 #C8C9CD 只有 1.65，换 iOS 系统灰（约 3.3:1） */
.wx-swipe-btn:not(.is-pin):not(.is-del) { background: #8E8E93; }
.wx-swipe-btn.wx-swipe-bg.wx-swipe-bg { background: #5B84C4; }

/* ===== 入梦 · 重新生成这一幕（2026-09-29） ===== */
/* 2026-10-19 建议 661c3b64：这一行可能有第二个按钮「换回上一版」，两个之间留 8px */
.dream-regen { display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin: -2px 0 4px; }
.dream-regen-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--outline); border-radius: 999px; background: transparent;
  color: var(--on-surface-variant); font-size: 12px; cursor: pointer;
}
.dream-regen-btn:hover { color: var(--on-surface); background: var(--surface-variant); }
/* 「换回上一版」比「重新生成」轻一档：它是个后悔药，不该跟主操作抢注意力 */
.dream-undo-btn { border-style: dashed; }
.dream-undo-btn:hover { color: var(--primary-text); border-color: var(--primary); }
.dream-line.regen-old { opacity: .35; transition: opacity .2s; }

/* ===== 入梦 · 点按改行动（2026-10-04 工单） =====
   只有最新一次行动可改（后面至多跟一条没被接话的旁白）：细虚线描一圈 + 指针，
   克制地示意「可以点」，不抢戏；点旧行由 JS toast 提示。 */
.dream-line.player.editable { cursor: pointer; }
.dream-line.player.editable .dream-line-body {
  outline: 1px dashed var(--outline);
  outline-offset: 3px;
}
@media (hover: hover) {
  .dream-line.player.editable:hover .dream-line-body { filter: brightness(1.12); }
}

/* 入梦：玩家自己的括号 / 星号动作（2026-09-29）——在主色气泡里独占一行、斜体退一档，与台词分开 */
.dream-line.player .dream-act { display: block; color: inherit; opacity: .8; font-style: italic; }
.dream-line.player .dream-act + .dream-act { margin-top: 2px; }

/* 用户自己发的（动作）灰字条：靠右，挨着他自己的气泡（头像 40 + 边距），与 TA 的居中旁白区分（2026-09-29） */
.wx-narr.wx-narr-user { text-align: right; padding: 2px 62px 0 16px; }

/* 聊天详情里开关下面的一行说明（2026-09-29 同步现实时间） */
.wx-entry-note { padding: 0 16px 12px; font-size: 12px; line-height: 1.6; color: var(--wx-text3); }

/* 搜索聊天记录（msg-search.js）：普通对话用应用主题色；命中词高亮；定位后的高亮圈 */
.wx-search-overlay.ms-app { background: var(--bg); color: var(--on-bg); border: 1px solid var(--outline); }
.ms-app .wx-sr-head { border-color: var(--outline); }
.ms-app .wx-sr-head input { background: var(--surface-variant); color: var(--on-bg); border: 1px solid var(--outline); }
.ms-app .wx-sr-count, .ms-app .wx-sr-time, .ms-app .wx-sr-name, .ms-app .wx-sr-empty { color: var(--on-surface-variant); }
.ms-app .wx-sr-text { color: var(--on-bg); }
.ms-app .wx-sr-close { color: var(--primary-text); }
.ms-app .wx-sr-item:active { background: var(--surface-variant); }
.ms-app .wx-sr-avatar { display: none; }
.wx-sr-text .ms-mark { background: rgba(7, 193, 96, 0.25); color: inherit; border-radius: 3px; padding: 0 1px; }
.ms-app .wx-sr-text .ms-mark { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.ms-hit { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 12px; transition: outline-color 0.4s; }

/* ===== 创作者社区（modules/community.js；广场页第二分段） ===== */
.plaza-official[hidden], .plaza-community[hidden] { display: none !important; }
.plaza-seg { display: flex; gap: 6px; padding: 4px; margin: 4px 0 14px; background: var(--surface-variant); border-radius: 999px; }
.plaza-seg-btn { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--on-surface-variant); font-size: 14px; cursor: pointer; }
.plaza-seg-btn.active { background: var(--bg); color: var(--on-bg); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.cm-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
/* hidden 属性必须能压过 display:flex（2026-10-15：真空白态收起工具栏时发现的） */
.cm-toolbar[hidden] { display: none !important; }
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 排序下拉（自绘，不用原生 <select>：选项列表是系统画的，CSS 管不到）
   触发器跟 chip 同高同圆角，看起来还是工具条的一部分，但省掉一整行。 */
.cm-sortsel {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border: 1px solid var(--outline);
  border-radius: 999px; background: var(--surface); color: var(--on-bg);
  font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.cm-sortsel-caret { font-size: 10px; opacity: .55; }
.cm-sortlist { display: flex; flex-direction: column; }
.cm-sortitem {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--outline);
  background: none; color: var(--on-bg); font: inherit; font-size: 15px;
  text-align: left; cursor: pointer;
}
.cm-sortitem:last-child { border-bottom: 0; }
.cm-sortitem.active { color: var(--primary-deep, var(--primary)); font-weight: 600; }
.cm-sortitem-ok { font-size: 15px; }
.cm-ico { font-size: 15px; line-height: 1; }
/* 工具按钮（通知 / 我的作品）：图标为主，但点击区不能小于 40px */
.cm-bell, .cm-mine { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; position: relative; }
.cm-divider { width: 1px; height: 18px; background: var(--outline); flex-shrink: 0; margin: 0 2px; }
/* ---- 2026-10-15 社区整改新增 ---- */
/* 加载骨架（列表 / 详情）：与皮肤同色系的呼吸块，不再是一行「加载中…」 */
@keyframes cmSkelPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.cm-skel-card { border: 1px solid var(--outline); border-radius: 14px; overflow: hidden; background: var(--surface-variant); }
.cm-skel-card .cm-skel-cover { aspect-ratio: 3 / 4; }
.cm-skel-cover { background: var(--surface); }
.cm-skel-line { height: 12px; margin: 10px 10px 0; border-radius: 6px; background: var(--surface); }
.cm-skel-line.wide { height: 16px; }
.cm-skel-line.short { width: 55%; margin-bottom: 12px; }
.cm-skel-cover, .cm-skel-line { animation: cmSkelPulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cm-skel-cover, .cm-skel-line { animation: none; }
}
/* 空态 / 错误态的出口按钮 */
.plaza-empty-cta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.plaza-empty-cta .chip { min-height: 40px; padding: 0 16px; }
/* 零值卡显示「新」时的置灰（数字回来后 patchCardStats 会摘掉 is-new） */
.cm-stat .cm-st-ad.is-new { color: var(--on-surface-variant); font-weight: 500; }
/* 发布页：底栏「还需：…」提示与简介兜底说明 */
.cm-foot-hint { font-size: 12px; color: var(--on-surface-variant); }
.cm-tagline-note { margin-top: -2px; }
/* 筛选抽屉顶部的术语一次性解释 */
.cm-cat-help { margin-bottom: 2px; }
/* 工具行里的 chips 允许收缩（行内滚动），别把通知 / 作品挤出去 */
.cm-row--split > .chips { min-width: 0; }
.cm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .cm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* 2026-10-15：桌面 4 列太挤，改 3 列 */
.cm-card { border: 1px solid var(--outline); border-radius: 14px; overflow: hidden; background: var(--surface-variant); cursor: pointer; display: flex; flex-direction: column; }
.cm-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cm-cover { position: relative; aspect-ratio: 3 / 4; background-size: cover; background-position: center top; background-color: var(--surface); }
.cm-cover-empty { display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--on-surface-variant); }
.cm-kind { position: absolute; top: 8px; left: 8px; padding: 2px 8px; font-size: 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.cm-detail-meta .cm-kind { position: static; }
.cm-kind-worldbook { background: rgba(60, 90, 160, 0.75); }
.cm-card-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cm-card-title { font-size: 14px; font-weight: 600; color: var(--on-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-card-tag { font-size: 12px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 16px; }
.cm-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--on-surface-variant); }
.cm-author { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-detail { gap: 12px; }
.cm-detail-cover { width: 100%; aspect-ratio: 16 / 10; background-size: cover; background-position: center top; border-radius: 12px; background-color: var(--surface); }
.cm-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--on-surface-variant); }
.cm-detail-tagline { font-size: 14px; color: var(--on-bg); }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface-variant); color: var(--on-surface-variant); border: 1px solid var(--outline); }
.cm-credit { font-size: 12px; color: var(--on-surface-variant); }
.cm-warn { color: #c0392b; }
.cm-payload { display: flex; flex-direction: column; gap: 10px; max-height: 38vh; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 12px; }
.cm-sec-label { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 2px; }
.cm-sec-text { font-size: 13px; color: var(--on-bg); white-space: pre-wrap; word-break: break-word; }
.cm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-actions .btn { flex: 1; min-width: 96px; }
.cm-like.active { color: #d6455d; }
.cm-what { font-size: 12px; line-height: 1.6; color: var(--on-surface-variant); padding: 8px 10px; border-radius: 10px; background: var(--surface-variant); }
.cm-rules summary { cursor: pointer; font-size: 13px; color: var(--primary-text); }
.cm-rules ol { margin: 8px 0 0 18px; padding: 0; font-size: 12px; color: var(--on-surface-variant); line-height: 1.7; }
.cm-agree { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--on-bg); }
/* 保密世界书的分项展示（发布页 / 编辑页）：每项一行，提示文字换到下一行缩进 */
.cm-world-show { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.03); }
.cm-world-show > .conn-hint { margin: 0; }
.cm-world-show-item { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; color: var(--on-bg); }
.cm-world-show-item .conn-hint { flex-basis: 100%; margin: 0; padding-left: 24px; font-size: 12px; line-height: 1.5; }
.cm-prevbox summary { cursor: pointer; font-size: 13px; color: var(--primary-text); }
.cm-prevbox[open] summary { margin-bottom: 8px; }
.cm-foot { position: sticky; bottom: -4px; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 8px; background: var(--bg); border-top: 1px solid var(--outline); }
.modal-actions-stick { position: sticky; bottom: -20px; z-index: 2; margin: 12px -20px -20px; padding: 12px 20px 20px; background: var(--bg); border-top: 1px solid var(--outline); border-radius: 0 0 16px 16px; }
.cm-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.cm-mine-row.is-removed { opacity: 0.55; }
.cm-mine-main { min-width: 0; flex: 1; }

/* ===== 社区页视觉整理（2026-09-29）：渐变海报封面 / 卡片层次 / 详情底部固定操作栏 / 发布预览 ===== */
.cm-cover-poster { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.92); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.cm-cover-poster .cm-poster-text { font-family: var(--font-display); font-size: 40px; letter-spacing: 2px; font-weight: 700; }
.cm-detail-cover.cm-cover-poster .cm-poster-text { font-size: 54px; }
.cm-hot { position: absolute; top: 8px; right: 8px; padding: 2px 8px; font-size: 11px; border-radius: 999px; background: var(--primary-fill); color: #fff; }
.cm-card { transition: transform 0.15s ease, border-color 0.15s ease; }
.cm-card:active { transform: scale(0.985); }
.cm-card-title { font-size: 15px; font-weight: 700; }
.cm-card-tagline { font-size: 12px; color: var(--on-surface-variant); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.cm-card-tags { display: flex; gap: 6px; overflow: hidden; }
.cm-card-tags span { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-text); white-space: nowrap; }
.cm-card-foot { margin-top: 2px; }
.cm-stat b { color: var(--primary-text); font-weight: 700; font-size: 12px; }
.cm-detail-cover { aspect-ratio: 16 / 9; margin: 0 -2px; }
.cm-teaser { font-size: 13px; line-height: 1.6; color: var(--on-surface-variant); }
.cm-fold { border: 1px solid var(--outline); border-radius: 12px; padding: 0 12px; }
.cm-fold > summary { cursor: pointer; padding: 10px 0; font-size: 13px; color: var(--primary-text); list-style: none; }
.cm-fold > summary::-webkit-details-marker { display: none; }
.cm-fold[open] > summary { border-bottom: 1px solid var(--outline); margin-bottom: 8px; }
.cm-fold .cm-payload { border: 0; padding: 0 0 10px; max-height: none; }
.cm-detail .cm-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -2px; padding: 10px 2px 4px; background: linear-gradient(to top, var(--bg) 78%, transparent); }
.cm-preview { display: flex; justify-content: center; padding: 4px 0 2px; }
.cm-preview .cm-card { width: 168px; pointer-events: none; }

/* ===== 社区作者名片 / 作者主页（2026-09-29） ===== */
.cm-av { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--outline) center / cover no-repeat; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; color: var(--on-bg); }
.cm-av-lg { width: 44px; height: 44px; font-size: 18px; }
.cm-av-xl { width: 72px; height: 72px; font-size: 30px; }
.cm-authorcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-variant); cursor: pointer; }
.cm-authorcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cm-authorcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-authorcard-name { font-size: 15px; font-weight: 700; color: var(--on-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-authorcard-sig { font-size: 12px; color: var(--on-surface-variant); line-height: 1.5; word-break: break-word; }
.cm-authorcard-sig.is-empty { opacity: 0.6; }
.cm-authorcard-stat { font-size: 11px; color: var(--on-surface-variant); }
.cm-authorcard-go { color: var(--on-surface-variant); font-size: 22px; }
/* 角色页「来源卡」（2026-10-25 工单 1720ff33）：从社区收下的角色，把广场里那张作者名片
   原样搬过来，下面补一行「原标题 + 标签」。只放门面，不含任何设定。 */
.cm-src { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.cm-src-card { cursor: default; }
.cm-src-card:focus-visible { outline: none; }
.cm-src-work { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--on-surface-variant); }
.cm-src-title { color: var(--on-bg); font-weight: 600; }
.cm-src-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-variant); color: var(--on-surface-variant); }
.cm-src-note { font-size: 11.5px; color: var(--on-surface-variant); }
.cm-src-tagline { font-size: 12.5px; line-height: 1.5; color: var(--on-surface-variant); padding-left: 2px; }
.cm-authorhead { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 8px 4px; text-align: center; }
.cm-authorhead-stats { display: flex; gap: 18px; margin-top: 6px; font-size: 12px; color: var(--on-surface-variant); }
.cm-authorhead-stats b { color: var(--on-bg); font-size: 16px; }
.cm-grid-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===== 社区关注 / 粉丝 / 拉黑（2026-09-29） ===== */
.cm-follow-btn { min-height: 36px; padding: 6px 14px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.cm-follow-btn.is-on { background: transparent; color: var(--on-surface-variant); border: 1px solid var(--outline); }
.cm-follow-sm { min-height: 32px; padding: 4px 12px; font-size: 12px; }
.cm-follow-lg { min-width: 120px; }
.cm-authorhead-stats { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
.cm-authorhead-num.is-link { cursor: pointer; }
.cm-authorhead-num.is-link:hover { color: var(--primary-text); }
.cm-authorhead-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cm-hide-lists { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; }
.cm-ul-list { display: flex; flex-direction: column; }
.cm-ul-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--outline); cursor: pointer; }
.cm-ul-item:first-child { border-top: 0; }

/* ===== 社区通知 / 评论点赞（2026-09-29） ===== */
.cm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0483e; margin-left: 6px; vertical-align: middle; flex-shrink: 0; }
.plaza-seg-btn { position: relative; }
.cm-row-r { display: flex; gap: 8px; }
.cm-cm-like.active { color: #d6455d; }
.cm-nt-list { display: flex; flex-direction: column; }
.cm-nt-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 6px; border-top: 1px solid var(--outline); cursor: pointer; border-radius: 10px; }
.cm-nt-item:first-child { border-top: 0; }
.cm-nt-item.is-unread { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.cm-nt-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.cm-nt-line { font-size: 14px; line-height: 1.5; color: var(--on-bg); }
.cm-nt-line b { font-weight: 700; }
.cm-nt-snip { font-size: 12px; color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 社区评论区（2026-09-29） ===== */
.cm-av-md { width: 32px; height: 32px; font-size: 13px; }
.cm-cm { display: flex; flex-direction: column; gap: 10px; }
.cm-cm-head { font-size: 14px; font-weight: 700; color: var(--on-bg); }
.cm-cm-count { color: var(--on-surface-variant); font-weight: 400; }
.cm-cm-composer { display: flex; flex-direction: column; gap: 6px; }
.cm-cm-row { display: flex; gap: 8px; }
.cm-cm-input { flex: 1; min-width: 0; }
.cm-cm-send { min-width: 64px; }
.cm-cm-replying { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--primary-text); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); }
.cm-cm-replying[hidden] { display: none; }
.cm-cm-x { border: 0; background: none; color: var(--on-surface-variant); cursor: pointer; padding: 2px 4px; }
.cm-cm-list { display: flex; flex-direction: column; }
.cm-cm-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--outline); }
.cm-cm-item:first-child { border-top: 0; }
.cm-cm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cm-cm-name { font-size: 13px; font-weight: 600; color: var(--on-bg); display: flex; align-items: center; gap: 6px; }
.cm-cm-owner { font-style: normal; font-size: 10px; padding: 0 6px; border-radius: 999px; background: var(--primary-fill); color: #fff; font-weight: 400; }
.cm-cm-text { font-size: 14px; line-height: 1.55; color: var(--on-bg); white-space: pre-wrap; word-break: break-word; }
.cm-cm-at { color: var(--on-surface-variant); }
.cm-cm-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--on-surface-variant); }
.cm-cm-act { border: 0; background: none; padding: 2px 0; font: inherit; color: var(--on-surface-variant); cursor: pointer; }
.cm-cm-act:hover { color: var(--primary-text); }
.cm-cm-empty { text-align: center; color: var(--on-surface-variant); font-size: 13px; padding: 14px 0; }
.cm-cm-more { display: flex; justify-content: center; }

/* ===== 个人资料页：三块分组 + 名片预览（2026-09-29） ===== */
.acc-vis-title { display: inline-flex; align-items: center; gap: 8px; }
.acc-vis { font-style: normal; font-size: 11px; font-weight: 400; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--outline); color: var(--on-surface-variant); }
.acc-vis-public { color: var(--primary-text); border-color: color-mix(in srgb, var(--primary) 45%, var(--outline)); }
.acc-card-wrap { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 0; }
/* 只读预览 vs 可编辑输入，一眼分得开：
   预览块给一枚「预览」角标 + 一圈虚线外框（outline 不占布局，不动卡片本身的社区样式）。 */
.acc-card-kicker { display: flex; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--on-surface-variant); padding: 0 4px; }
.acc-card-kicker::after {
  content: '预览';
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--on-surface-variant);
  border: 1px solid var(--outline); border-radius: 999px; padding: 1px 7px;
}
.acc-cardprev { cursor: default; outline: 1px dashed var(--outline); outline-offset: 4px; border-radius: var(--r-ctl); }
.acc-home { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-variant); color: var(--on-bg); font: inherit; cursor: pointer; text-align: left; }
.acc-home[hidden] { display: none; }
.acc-home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-home-title { font-weight: 600; font-size: 14px; }
.acc-home-sub { font-size: 12px; line-height: 1.45; color: var(--on-surface-variant); }
.acc-home-stat { flex: 1; text-align: right; font-size: 12px; color: var(--on-surface-variant); }
.acc-home-go { color: var(--on-surface-variant); font-size: 20px; }
.acc-home--decor { border-color: color-mix(in srgb, var(--primary) 42%, var(--outline)); }
.acc-home--decor .acc-home-title { color: var(--primary-text); }

/* 梦晶页（modules/economy.js，2026-09-30） */
.eco { display: block; padding-bottom: 8px; }
.eco > * + * { margin-top: 14px; }
.eco-reason { padding: 10px 12px; border-radius: var(--r-ctl); background: rgba(204, 120, 92, 0.12); color: var(--on-bg); font-size: 13px; }
.eco-card { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface-variant); }
.eco-cell { padding: 16px 8px; text-align: center; }
.eco-cell + .eco-cell { border-left: 1px solid var(--outline); }
.eco-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--primary-text); line-height: 1.1; }
.eco-label { margin-top: 4px; font-size: 12px; color: var(--on-surface-variant); }
.eco-detail { margin-top: -4px; line-height: 1.5; }
.eco-btn { min-height: 44px; }
.eco-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.eco-btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.eco-ex { display: block; padding: 12px; border: 1px solid var(--outline); border-radius: var(--r-card); }
.eco-ex > * + * { margin-top: 8px; }
.eco-ex-title { font-size: 13px; font-weight: 600; }
.eco-ex-btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* ---- 充值（买梦晶）区块：档位卡片 + 自选胶囊 + 主按钮；充值记录带状态标签 ---- */
.eco-buy { display: block; padding: 16px; border: 1px solid var(--outline); border-radius: var(--r-card);
  background: linear-gradient(180deg, rgba(204, 120, 92, 0.12), rgba(204, 120, 92, 0)) var(--surface-variant); }
.eco-buy > * + * { margin-top: 12px; }
.eco-buy-head { margin-top: 0; }
.eco-buy-eyebrow { font-size: 11px; letter-spacing: 0.12em; color: var(--primary-text); font-weight: 600; }
.eco-buy-title { margin-top: 2px; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--on-bg); line-height: 1.2; }
.eco-buy-sub { margin-top: 4px; font-size: 12px; color: var(--on-surface-variant); }
.eco-tiles { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; }
.eco-tiles > * + * { margin-top: 0; }
.eco-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 84px; margin: 0; padding: 12px 14px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--bg); color: var(--on-surface);
  text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
.eco-tile:active { transform: scale(0.97); }
.eco-tile-amt { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--on-bg); line-height: 1.1; }
.eco-tile-coin { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--on-surface); }
.eco-tile-sub { margin-top: 2px; font-size: 11px; color: var(--on-surface-variant); }
.eco-tile-tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-fill); color: var(--on-primary); font-size: 12px; line-height: 20px; text-align: center;
  opacity: 0; transform: scale(0.6); transition: opacity .15s, transform .15s; }
.eco-tile.is-on { border-color: var(--primary); background: rgba(204, 120, 92, 0.10); box-shadow: inset 0 0 0 1px var(--primary); }
.eco-tile.is-on .eco-tile-amt { color: var(--primary-text); }
.eco-tile.is-on .eco-tile-tick { opacity: 1; transform: scale(1); }
.eco-custom { display: flex; align-items: center; margin-top: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--outline); border-radius: 999px; background: var(--bg); cursor: text; }
.eco-custom.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.eco-custom-lead { flex: none; font-size: 13px; color: var(--on-surface-variant); margin-right: 8px; }
.eco-custom-in { flex: 1 1 0; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--font-sans); font-size: 16px; color: var(--on-bg); }
.eco-custom-in::placeholder { color: var(--on-surface-variant); opacity: 0.7; }
.eco-custom-suffix { flex: none; margin-left: 6px; font-size: 13px; color: var(--on-surface-variant); }
.eco-custom-count { flex: none; margin-left: 10px; font-size: 12px; color: var(--primary-text); font-weight: 600; }
.eco-cta { display: block; width: 100%; min-height: 50px; margin-top: 0; border-radius: var(--r-card); font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.eco-buy-hint { margin-top: -4px; min-height: 16px; font-size: 12px; color: var(--on-surface-variant); text-align: center; }
.eco-buy-foot { font-size: 12px; line-height: 1.7; color: var(--on-surface-variant); text-align: center; }
.eco-buy-foot a { color: var(--primary-text); margin-left: 6px; }
/* ---- 支付方式与自定义金额（2026-11-15 接 ITXT 双通道）：只吃设计令牌，浅色/深色主题自动跟随 ---- */
/* 确认面板：标题 → 商品与时长 → 实付金额（大字）→ 明细 → 方式卡片 → 提示 → 主按钮 */
.pay-panel { display: block; padding: 8px 16px 16px; }
.pay-panel > * + * { margin-top: 16px; }
.pay-product-main { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.pay-amount-wrap { display: block; }
.pay-amount { font-family: var(--font-display); font-size: var(--fs-page); font-weight: 600;
  line-height: 1.15; color: var(--on-bg); font-variant-numeric: tabular-nums; }
.pay-amount-note { margin-top: 8px; font-size: var(--fs-meta); line-height: 1.5; color: var(--on-surface-variant); }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-method-card { box-sizing: border-box; display: block; min-height: var(--tap); margin: 0; padding: 11px 13px;
  border: 1px solid var(--outline); border-radius: var(--r-card); background: transparent;
  color: var(--on-surface); text-align: left; font: inherit; cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease; }
.pay-method-card:active { transform: scale(.985); }
.pay-method-card.is-on { padding: 10px 12px; border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pay-method-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pay-method-name { display: block; font-size: var(--fs-body); }
/* 通道稳定性小标（2026-11-15）：支付宝「稳定支付」/ 微信「不稳定支付」。
   只用既有令牌（主题自动跟随），窄屏放不下就整体换行，不截字、不缩字。 */
.pay-method-tag { flex: none; padding: 2px 6px; border: 1px solid var(--outline); border-radius: 999px;
  font-size: var(--fs-meta); line-height: 1.4; white-space: nowrap; }
.pay-method-tag.is-ok { border-color: var(--primary-text); color: var(--primary-text); }
.pay-method-tag.is-warn { border-color: var(--error); color: var(--error); }
.pay-method-amount { display: block; margin-top: 8px; font-size: var(--fs-meta);
  color: var(--on-surface-variant); font-variant-numeric: tabular-nums; }
.pay-method-card.is-on .pay-method-amount { color: var(--primary-text); }
.pay-method-extra { display: block; margin-top: 8px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.pay-notice { font-size: var(--fs-meta); line-height: 1.5; color: var(--on-surface-variant); }
/* 有通道被标「不稳定」时补的一句替代方案，跟卡片紧一点（.pay-panel > * + * 默认 16px） */
.pay-channel-note { margin-top: 8px; font-size: var(--fs-meta); line-height: 1.5; color: var(--on-surface-variant); }
.pay-error { font-size: var(--fs-meta); line-height: 1.5; color: var(--error); }
.pay-submit { display: block; width: 100%; min-height: var(--tap); margin: 0; padding: 12px 16px; border: 0;
  border-radius: var(--r-ctl); background: var(--primary-fill); color: var(--on-primary);
  font: inherit; font-size: var(--fs-body); font-weight: 600; cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease; }
.pay-submit:active:not(:disabled) { transform: scale(.985); }
.pay-submit:disabled { opacity: .6; cursor: default; }
.pay-cancel { display: block; width: 100%; min-height: var(--tap); margin: 0; padding: 8px 12px; border: 0;
  background: transparent; color: var(--on-surface-variant); font: inherit; font-size: var(--fs-meta);
  text-decoration: underline; cursor: pointer; }
/* 梦晶「自定义金额」：1..maxPerOrder 元，非法输入转 --error */
.coin-custom { display: block; padding: 16px; border: 1px solid var(--outline); border-radius: var(--r-card);
  background: var(--surface); }
.coin-custom > * + * { margin-top: 8px; }
.coin-custom-title { font-size: var(--fs-body); font-weight: 600; color: var(--on-surface); }
.coin-custom-row { box-sizing: border-box; display: flex; align-items: center; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--outline); border-radius: var(--r-ctl); background: transparent; cursor: text; }
.coin-custom-row:focus-within { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 1px; }
.coin-custom-row.is-bad { border-color: var(--error); }
.coin-custom-in { flex: 1 1 0; min-width: 0; min-height: var(--tap); border: 0; background: transparent; outline: none;
  font-family: var(--font-sans); font-size: var(--fs-body); color: var(--on-bg); font-variant-numeric: tabular-nums; }
.coin-custom-in::placeholder { color: var(--on-surface-variant); opacity: .7; }
.coin-custom-unit { flex: none; margin-left: 8px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.coin-custom-hint { min-height: 16px; font-size: var(--fs-meta); line-height: 1.5; color: var(--on-surface-variant); }
.coin-custom-hint.is-bad { color: var(--error); }
/* 从通道回来后的「到账可能延迟」提示条：正文整行可点，右边 ✕ 收起 */
.pay-return-banner { display: flex; align-items: center; margin: 0 0 16px; padding: 8px 12px;
  border: 1px solid var(--primary); border-radius: var(--r-card);
  background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pay-return-refresh { flex: 1 1 auto; min-width: 0; min-height: var(--tap); border: 0; background: transparent;
  color: var(--primary-text); font: inherit; font-size: var(--fs-meta); line-height: 1.5; text-align: left;
  text-decoration: underline; cursor: pointer; }
.pay-return-close { flex: none; width: var(--tap); height: var(--tap); border: 0; background: transparent;
  color: var(--on-surface-variant); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .pay-method-card, .pay-submit, .pay-return-refresh { transition: none; }
  .pay-method-card:active, .pay-submit:active:not(:disabled) { transform: none; }
}
.eco-orders { display: block; }
.eco-order { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--outline); }
.eco-order:last-child { border-bottom: 0; }
.eco-order-main { min-width: 0; flex: 1 1 auto; }
.eco-order-title { font-size: 15px; font-weight: 600; color: var(--on-bg); }
.eco-order-sub { margin-top: 2px; font-size: 12px; color: var(--on-surface-variant); }
.eco-order-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; margin-left: 10px; }
.eco-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.eco-chip.is-ok { background: rgba(204, 120, 92, 0.14); color: var(--primary-text); }
.eco-chip.is-wait { background: rgba(93, 184, 166, 0.18); color: var(--on-surface); }
.eco-chip.is-off { background: var(--surface-variant); color: var(--on-surface-variant); }
.eco-chip.is-bad { background: rgba(179, 86, 62, 0.12); color: var(--error); }
.eco-go-pay { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--primary-text); text-decoration: none; }
.eco-sec { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ---- 使用时长广告遮罩（非会员每用满 20 分钟，看完才能继续；没有关闭按钮）---- */
.ag-gate { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 990; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; background: rgba(20, 20, 19, 0.6); }
/* ⚠️ 这条是看广告卡片（usage-ad-gate.js 的 .ag-card）自己的底色/边框。2026-10-19 会员福利卡批量改名时被误改成 .mg-card，
   线上卡片没了底色、文字直接压在页面上；10-20 改回。别再把它当成别人的类改名。 */
.ag-card { width: 100%; max-width: 340px; padding: 26px 22px 22px; border: 1px solid var(--outline); border-radius: var(--r-card);
  background: var(--bg); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.ag-eyebrow { font-size: 11px; letter-spacing: 0.12em; color: var(--primary-text); font-weight: 600; }
.ag-title { margin-top: 6px; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--on-bg); }
.ag-body { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--on-surface-variant); text-wrap: balance; }
.ag-btn { display: block; width: 100%; min-height: 48px; margin-top: 20px; border-radius: var(--r-card); font-size: 16px; font-weight: 600; }
.ag-skip { display: block; width: 100%; min-height: 44px; margin-top: 6px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--on-surface-variant); cursor: pointer; }
.ag-msg { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--error); }
/* 「广告暂时没来」这类不是报错，别用报错的红色（2026-11-14：红字看着像坏了） */
.ag-msg[data-kind='info'] { color: var(--on-surface-variant); }

/* ---- 「我的」页会员卡（2026-10-23 改：深色石板 → 纸面「会员笺」）----
   旧版是一块始终深色的石板：radial-gradient 赤陶光晕 + 0 12px 30px 重投影 + 全硬编码色，
   连暗色模式都不跟随令牌。它同时是全页视觉最重的块 —— 而用户来「我的」页不是来续费的。
   那三条正好撞在设计契约上（❌ 光晕/发光、纸感优先不用重投影、一个屏幕至多一个装饰手势）。
   现在：和其它卡一样是纸面（--surface + --outline），只在顶上留一条 2px 赤陶细边当作
   「这是会员」的强调（不是茧丝竖线 —— 那个手势留给引语）；颜色全走令牌 ⇒ 暗色自动跟随。
   class 名一律不动：guard-membership-app / guard-pay-fallback / guard-pay-paused 都点着 .mc-card .mc-cta。 */
.mc-wrap { display: block; }
.mc-wrap > * + * { margin-top: 12px; }
.mc-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--outline);
  color: var(--on-surface);
}
/* 会员身份的唯一强调：顶上 2px 赤陶细边 */
.mc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--primary);
}
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--on-surface-variant); }
.mc-tag { font-size: 11px; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--surface-variant); color: var(--on-surface-variant); }
.mc-title { margin-top: 12px; font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.15; color: var(--on-bg); }
.mc-sub { margin-top: 5px; font-size: var(--fs-meta); color: var(--on-surface-variant); line-height: 1.5; }
/* 权益：从三块深色格改成一行三项（细竖线分隔）—— 不再是页面里的第二个重音 */
.mc-hero { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.mc-hero-cell { padding: 2px 6px; text-align: center; }
.mc-hero-cell + .mc-hero-cell { border-left: 1px solid var(--outline); }
.mc-hero-cell b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.2; color: var(--on-bg); }
.mc-hero-cell span { display: block; margin-top: 3px; font-size: 11px; color: var(--on-surface-variant); }
.mc-perks { list-style: none; margin: 16px 0 0; padding: 0; font-size: var(--fs-body); color: var(--on-surface); }
.mc-perks li { position: relative; padding: 6px 0 6px 16px; line-height: 1.4; }
.mc-perks li::before { content: ''; position: absolute; left: 1px; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.mc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--outline); }
.mc-price { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--on-bg); }
.mc-price small { font-family: var(--font-sans); font-size: var(--fs-meta); color: var(--on-surface-variant); }
.mc-first { margin-top: 5px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.mc-note { font-size: var(--fs-meta); color: var(--on-surface-variant); text-align: right; }
/* 免费版：实心主色（这是转化按钮）；会员中：描边次级（管理会员不是本页的主操作） */
.mc-cta {
  display: block; width: 100%; min-height: 44px; margin-top: 14px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: var(--primary-fill); color: var(--on-primary);
  font-size: var(--fs-body); font-weight: 500; letter-spacing: 0.04em; cursor: pointer;
  transition: filter .12s ease, background-color .15s ease;
}
.mc-cta:active { filter: brightness(.92); }
.mc-cta.ghost {
  width: auto; min-width: 140px; min-height: 40px; padding: 0 20px;
  background: var(--bg); border-color: var(--outline); color: var(--on-surface);
}
/* 会员中：续期提示与「管理会员」并排一行。
   提示在这一行里退成纯文字（不再是个框），并禁止折行 —— 原来「续期 ¥32.9/月 · 不自动续费」
   会被拦腰断成「…· 不 / 自动续费」。 */
.mc-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.mc-actions .mc-more {
  margin-top: 0; flex: 1; min-width: 0;
  padding: 0; border: 0; background: none;
  font-size: var(--fs-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-actions .mc-cta { margin-top: 0; flex: none; }
/* 2026-10-12 信息分流：权益清单收进弹层，卡上只留一行入口（免费版）/ 静态续期提示（会员中） */
.mc-more { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--bg); color: var(--primary-text); font-family: inherit; font-size: var(--fs-body); text-align: left; cursor: pointer; }
.mc-more::after { content: '▸'; color: var(--on-surface-variant); }
.mc-more.static { cursor: default; color: var(--on-surface-variant); background: var(--surface-variant); }
.mc-more.static::after { content: ''; }
/* 会员中的 tag：品牌色一档，和免费版的灰 pill 一眼分开（旧 WebView 不认 color-mix ⇒ 先实底） */
.mc-tag.on { background: var(--surface-variant); color: var(--primary-text); }
@supports (background: color-mix(in srgb, var(--primary) 16%, transparent)) {
  .mc-tag.on { background: color-mix(in srgb, var(--primary) 16%, transparent); }
}
.eco-ways { display: block; }
.eco-ways > * + * { margin-top: 8px; }
.eco-way { display: block; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-ctl); }
.eco-way > * + * { margin-top: 4px; }
.eco-way-main { font-size: 14px; font-weight: 600; }
.eco-log { display: block; }
.eco-log-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.eco-log-row.is-new .eco-log-note::after { content: '新'; margin-left: 6px; padding: 0 5px; border-radius: 8px; background: var(--primary-fill); color: var(--on-primary); font-size: 10px; }
.eco-log-main { min-width: 0; flex: 1; }
.eco-log-note { font-size: 13px; overflow-wrap: anywhere; }
.eco-log-amt { flex: none; font-size: 13px; font-weight: 600; color: var(--primary-text); text-align: right; }
.eco-log-amt.neg { color: var(--on-surface-variant); }
.eco-foot { text-align: center; }
.eco-row-tail { display: inline-flex; align-items: center; gap: 6px; }
.eco-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.eco-dot[hidden] { display: none; }
.eco-progress { font-size: 12px; color: var(--primary-text); }
.eco-proj { padding: 12px; border: 1px dashed var(--primary); border-radius: var(--r-card); background: rgba(204, 120, 92, 0.08); display: block; }
.eco-proj > * + * { margin-top: 4px; }
.eco-proj-main { font-size: 15px; font-weight: 700; color: var(--primary-text); }
/* ---- 梦晶页重排（2026-10-25）：余额卡底部的拆分、「免费领次数」任务行、怎么赚合成一张卡、记录折叠 ----
   间距一律用 margin（不用 flex gap：用户里还有 Chrome 81/83 内核的 WebView） */
.eco-card-foot { grid-column: 1 / -1; padding: 9px 12px; border-top: 1px solid var(--outline); font-size: 12px; line-height: 1.5; color: var(--on-surface-variant); text-align: center; }
.eco-shared-hint { margin-top: 4px; }
.eco-source-breakdown { width: 100%; border-collapse: collapse; font-size: 12px; color: var(--on-surface); }
.eco-source-breakdown caption { padding: 4px 0 8px; text-align: left; font-weight: 600; }
.eco-source-breakdown th, .eco-source-breakdown td { padding: 8px 4px; border-bottom: 1px solid var(--outline); }
.eco-source-breakdown th { text-align: left; font-weight: 500; }
.eco-source-breakdown th small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--on-surface-variant); }
.eco-source-breakdown td { width: 85px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eco-free { border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.eco-free-row { display: flex; align-items: center; min-height: 64px; padding: 12px 14px; }
.eco-free-row + .eco-free-row { border-top: 1px solid var(--outline); }
.eco-free-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 12px;
  border-radius: 10px; background: rgba(204, 120, 92, 0.12); color: var(--primary-text); }
.eco-free-main { flex: 1 1 auto; min-width: 0; }
.eco-free-title { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--on-bg); }
.eco-free-sub { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--on-surface-variant); }
.eco-free-sub.is-warn { color: var(--primary-text); }
.eco-pill { flex: none; min-width: 76px; min-height: 36px; margin-left: 12px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.eco-pill.is-ghost { background: transparent; color: var(--primary-text); box-shadow: inset 0 0 0 1px var(--primary-text); }
.eco-pill[disabled] { background: var(--surface-variant); color: var(--on-surface-variant); box-shadow: none; cursor: not-allowed; }
.eco-pill:not([disabled]):active { transform: scale(0.96); }
@media (max-width: 360px) { .eco-free-row { padding: 12px; } .eco-free-icon { margin-right: 10px; } .eco-pill { min-width: 64px; margin-left: 8px; padding: 0 12px; } }
.eco-ways > * + * { margin-top: 0; }
.eco-way { padding: 12px 14px; border-top-width: 0; border-radius: 0; background: var(--surface); }
.eco-sec + .eco-way { border-top-width: 1px; border-radius: var(--r-card) var(--r-card) 0 0; }
.eco-way:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
.eco-sec + .eco-way:last-child { border-radius: var(--r-card); }
.eco-log-more { display: block; width: 100%; min-height: 40px; margin-top: 4px; border: 0; background: transparent;
  color: var(--primary-text); font-size: 13px; cursor: pointer; }

/* 社区：分类 / 分级（2026-09-30） */
.cm-classify { display: flex; flex-direction: column; gap: 8px; }
.cm-cats, .cm-rates { flex-wrap: wrap; }
.cm-rate-hint { line-height: 1.5; }
.cm-rate { padding: 1px 6px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.cm-rate-adult { background: #8f2f3c; color: #fff; }
.cm-cover .cm-rate { position: absolute; top: 8px; right: 8px; }
.cm-card-cat { color: var(--primary-text); }
.cm-cat-link { cursor: pointer; }
.cm-catbtn.active { background: var(--primary-fill); color: var(--on-primary); }
.cm-catpage { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.cm-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cm-cat-tile { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-height: 56px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--surface-variant); color: var(--on-bg); font: inherit; text-align: left; cursor: pointer; }
.cm-cat-tile b { font-size: 14px; }
.cm-cat-tile span { font-size: 12px; color: var(--on-surface-variant); }
.cm-cat-tile.active { border-color: var(--primary); background: rgba(204, 120, 92, 0.12); }
.cm-hottags .chips { flex-wrap: wrap; }
.cm-adult-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-ctl); font-size: 14px; }
.cm-adult-toggle small { display: block; margin-top: 2px; font-size: 12px; color: var(--on-surface-variant); }
.cm-adult-note { line-height: 1.5; }

/* ---------- 标签建议（2026-10-02）----------
   分类只管题材，人设 / 关系 / 风格全靠标签，所以发布页得让作者点得到这些词，而不是自己从零手填。
   分组用 details 折叠：默认只看到 5 个组名，展开一组才铺开这个词。 */
.cm-tagsuggest { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 2px; }
.cm-taggroup { border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--surface-variant); }
.cm-taggroup summary { padding: 8px 12px; font-size: 13px; color: var(--on-surface-variant); cursor: pointer; list-style: none; user-select: none; }
.cm-taggroup summary::-webkit-details-marker { display: none; }
.cm-taggroup summary::before { content: '＋ '; font-size: 12px; }
.cm-taggroup[open] summary::before { content: '－ '; }
.cm-taggroup .chips { flex-wrap: wrap; padding: 0 10px 10px; }
.cm-taggroup .chip { font-size: 13px; padding: 5px 10px; }
.cm-tag-hint { margin: 6px 0 -2px; font-size: 12px; line-height: 1.5; }

/* ---------- 配对关系（2026-10-02，第二维：谁跟谁在一起）----------   跟题材分类是两条独立的轴。分类页里收在「更多筛选」里默认折叠——
   它和分类平级，但不该抢分类的首屏位置，所以折叠、不默认展开。 */
.cm-morefilter { border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--surface-variant); }
.cm-morefilter > summary { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 14px; cursor: pointer; list-style: none; user-select: none; }
.cm-morefilter > summary::-webkit-details-marker { display: none; }
.cm-morefilter > summary::before { content: '＋ '; font-size: 12px; }
.cm-morefilter[open] > summary::before { content: '－ '; }
.cm-morefilter .cm-sec-label { padding: 0 12px; }
.cm-morefilter .chips { flex-wrap: wrap; padding: 0 12px 12px; }
.cm-mf-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary-fill); color: var(--on-primary); font-size: 11px; line-height: 18px; text-align: center; }
.cm-morefilter .chip { display: inline-flex; align-items: center; gap: 4px; }
.cm-morefilter .chip small { color: var(--on-surface-variant); font-size: 11px; }
.cm-pairing-wrap .chips { flex-wrap: wrap; }
.cm-pairing-hint { margin: 6px 0 -2px; font-size: 12px; line-height: 1.5; }
.cm-pairing-tag { border-style: dashed; }

/* ---------- 图片加载兜底（2026-10-02 审计，utils.js h() / paintBg 挂的类）----------
   .img-broken：<img> 加载失败后被 h() 换成占位。关键是要**保留盒子尺寸**——
   否则元素塌陷，同屏里加载成功的图还在，看起来就是「部分重叠」（工单 fb2447e2）。
   .bg-broken：背景图失败。背景本来就只是装饰，页面必须照常可用，不额外显示什么。 */
.img-broken {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  font-family: var(--font-display);
  object-fit: contain;
}
.bg-broken { background-repeat: no-repeat !important; }

/* ---------- 灵感回复（2026-10-01）：输入框上方的三条可选下一句 ---------- */
.insp-btn.on { color: var(--primary-text); background: var(--surface); }
.insp-panel, .qc-panel {
  flex-shrink: 0; margin: 0 12px 8px; padding: 10px 12px 8px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 16px;
  box-shadow: 0 -4px 18px rgba(0,0,0,.06);
}
/* 灵感面板不许把输入框顶出屏（2026-10-24 工单 0067c525「灵感会带字，字数太多的话，后面它都不显示」）：
   面板在 flex 列里是 flex-shrink:0，高度只由三条文案决定（每条 80 字 ≈ 5 行 ⇒ 整面板 ~407px）。
   矮屏（工单设备 360×438）上「面板 + 输入框」≈ 480px > 屏高，父容器 #app-body 是 overflow:hidden
   ⇒ 面板下沿（换一批 / 还剩几次）和**整个输入框**被裁掉，屏幕上根本看不到。
   修法与快捷指令面板同一套：面板封顶 + 选项区自己滚；再让面板可收缩（flex-shrink:1 + min-height:0）
   兜底更矮的屏 —— 输入框必须永远留在屏内。 */
.insp-panel {
  max-height: 70vh;
  max-height: min(70vh, 70dvh, 460px);
  display: flex; flex-direction: column;
  flex-shrink: 1; min-height: 0;
}
/* 入梦页（worlds.js）单独收紧：那里的舞台只有屏幕的六成（页眉 55 + 顶栏 44 + 底部导航 ~60），
   通用封顶（52vh）会让输入行滑到导航栏底下 —— 卷宗/梦信够用，入梦不够。 */
.dream-input .insp-panel {
  max-height: calc(100vh - 284px);
  max-height: min(calc(100vh - 284px), calc(100dvh - 284px), 420px);
}
.insp-body {
  overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.insp-body::-webkit-scrollbar { width: 4px; }
.insp-body::-webkit-scrollbar-thumb { background: var(--outline); border-radius: 999px; }
.insp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.insp-title { font-weight: 600; font-size: 14px; color: var(--on-bg); }
.insp-sub { flex: 1; min-width: 0; font-size: 12px; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-x { background: none; border: 0; color: var(--on-surface-variant); padding: 2px; line-height: 0; align-self: center; }
.insp-body { display: flex; flex-direction: column; gap: 6px; }
.insp-opt {
  text-align: left; width: 100%; font-size: 14px; line-height: 1.5; color: var(--on-bg);
  background: var(--bg); border: 1px solid var(--outline); border-radius: 12px; padding: 9px 12px;
  overflow-wrap: anywhere;
}
button.insp-opt:active { background: var(--surface-variant); border-color: var(--primary); }
/* 灵感卡片（2026-10-24 用户定的「卡片封行 + 展开」）：
   卡片外观搬到 .insp-item（快捷指令面板还在拿 .insp-opt 当卡片用，别动它那一份）。
   卡片里的文字默认封 3 行，超了才出现「展开」；点卡片 = 把**全文**填进输入框。 */
.insp-panel .insp-item {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg); border: 1px solid var(--outline); border-radius: 12px; padding: 9px 12px;
}
.insp-panel .insp-item > .insp-opt {
  background: none; border: 0; border-radius: 0; padding: 0; overflow-wrap: anywhere;
  font-size: 14px; line-height: 1.5; color: var(--on-bg); text-align: left; width: 100%;
}
.insp-panel .insp-item > .insp-opt:active { background: none; border-color: transparent; }
.insp-panel .insp-item:active { border-color: var(--primary); }
.insp-opt-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  overflow: hidden; overflow-wrap: anywhere;
}
/* 矮屏（可视高 ≤560，多是小窗/分屏用户）封 2 行：三条的头才都能看见，
   全文在「展开」里、点卡片也会全文进输入框。 */
@media (max-height: 560px) {
  .insp-opt-text { -webkit-line-clamp: 2; line-clamp: 2; }
}
.insp-item.is-open .insp-opt-text { -webkit-line-clamp: unset; line-clamp: unset; display: block; }
.insp-opt-more {
  align-self: flex-end; background: none; border: 0; padding: 0; margin-top: 1px;
  font-size: 12px; line-height: 1.4; color: var(--primary-text); opacity: .85;
}
.insp-opt-more:active { opacity: .6; }
.insp-skel { min-height: 40px; pointer-events: none; background: linear-gradient(90deg, var(--surface-variant), var(--bg), var(--surface-variant)); background-size: 200% 100%; animation: insp-shimmer 1.2s linear infinite; }
@keyframes insp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .insp-skel { animation: none; } }
.insp-err { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--on-surface-variant); padding: 8px 2px; }
.insp-retry, .insp-more {
  background: none; border: 1px solid var(--outline); border-radius: 999px; font-size: 12px; padding: 4px 12px; color: var(--primary-text); white-space: nowrap;
}
.insp-more:disabled { opacity: .5; }
.insp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; min-height: 26px; }
.insp-quota { font-size: 12px; color: var(--on-surface-variant); }

/* ---------- 输入栏「＋」托盘（2026-10-01）：图片 / 语音 / 灵感收进一个入口 ---------- */
.tray-btn.on { color: var(--primary-text); background: var(--surface); }
.tray-btn svg { transition: transform .15s; }
.tray-btn.on svg { transform: rotate(45deg); }
.cmp-tray {
  flex-shrink: 0; display: flex; gap: 6px; margin: 0 12px 8px; padding: 10px 12px 8px;
  background: var(--surface); border: 1px solid var(--outline); border-radius: 16px;
}
.cmp-item { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; }
.cmp-ico, .cmp-item .voice-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--outline);
  background: var(--bg); color: var(--on-surface-variant);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; padding: 0; cursor: pointer;
}
.cmp-ico:active { background: var(--surface-variant); border-color: var(--primary); }
.cmp-item .voice-btn { align-self: auto; }
.cmp-item .voice-btn.is-rec { border-color: var(--error); }
.cmp-txt { font-size: 12px; color: var(--on-surface-variant); }
@media (prefers-reduced-motion: reduce) { .tray-btn svg { transition: none; } }

/* ---------- 入梦 · 世界记忆面板 / 书卡「记忆」入口（2026-10-01） ---------- */
.wd-book-mem { margin-left: auto; margin-right: 8px; }
.dream-top-mem {
  flex-shrink: 0; align-self: center; margin-left: auto; background: none;
  border: 1px solid var(--outline); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--primary-text);
  /* 触达（2026-10-19）：实测 27px 高。它孤悬在顶部右侧，补到 44px 不挤邻座。 */
  min-height: 44px;
  display: inline-flex; align-items: center;
}
.dream-top-more {
  flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--outline); background: var(--surface);
  color: var(--on-bg); font-size: 21px; line-height: 1; cursor: pointer;
}
.dream-top-more:active { background: var(--surface-variant); }
.dmem { gap: 14px; }
/* 「这一幕还没整理成记忆」提示（2026-11-12）：只在会扣永久次数时出现。
   不用 gap（旧 WebView Chrome<84 整体忽略），块级 + 兄弟 margin-top。 */
.dmem-pending {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
}
.dmem-pending > * + * { margin-top: 6px; }
.dmem-pending-text { font-size: 14px; color: var(--on-surface); }
.dmem-pending-sub { font-size: 12px; color: var(--on-surface-variant); }
.dmem-pending-btn { display: inline-block; }
.dmem-tabs {
  display: flex;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.dmem-tabs::-webkit-scrollbar { display: none; }
.dmem-tabs > * { flex: 0 0 auto; }
.dmem-tabs > * + * { margin-left: 8px; }
.dmem-tab {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.dmem-tab.on {
  background: var(--primary-fill);
  border-color: var(--primary-fill);
  color: var(--on-primary);
}
.dmem-tab-n {
  display: inline-block;
  min-width: 17px;
  margin-left: 5px;
  font-size: 11px;
  opacity: .8;
  font-variant-numeric: tabular-nums;
}
.dmem-search-wrap { display: block; }
.dmem-search { width: 100%; min-height: 40px; }
.dmem-load-more { display: block; margin: 8px auto 0; }
/* ⚠️ 旧 WebView 兼容（Chrome < 84，工单机 PBBT00 / Android 9 / Chrome 70 / 半梦壳 1.4.4）：
   flex 的 `gap` 在 Chrome 84 才落地，之前是被**整体忽略**的——靠 gap 撑间距的纵向堆叠
   在那个版本上会完全失去间距，块与块贴在一起/互相压住（用户原话「有一些字跑到上面去了」，
   2026-10-10 工单：世界记忆面板、梦晶页、角色卡详情三处同病）。
   所以这几处**不用 gap**，改回最老的写法：块级布局 + 兄弟选择器 margin-top。
   现代引擎上两种写法渲染一致（间距就是 margin-top 那一个值），不存在叠加。 */
.dmem-sec { display: block; }
.dmem-sec > * + * { margin-top: 8px; }
.dmem-list { display: block; }
.dmem-list > * + * { margin-top: 8px; }
.dmem-edit { display: block; }
.dmem-edit > * + * { margin-top: 8px; }
.dmem-sec-head { display: flex; align-items: center; gap: 8px; }
.dmem-sec-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--on-bg); flex: 1; }
.dmem-sec-help { margin: 0; font-size: 12px; line-height: 1.6; color: var(--on-surface-variant); }
.dmem-item { background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; padding: 10px 12px; }
.dmem-item.mine { border-color: var(--primary); }
.dmem-item.is-pinned { background: var(--surface-variant); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.dmem-item-head { display: flex; align-items: center; gap: 8px; }
.dmem-item-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.dmem-item-text { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--on-bg); overflow-wrap: anywhere; white-space: pre-wrap; }
.lore-toolbar { display: block; margin-top: 10px; }
.lore-toolbar .lore-search { width: 100%; }
.lore-filter-chips { margin-top: 8px; }
.lore-filter-chips .chip { flex: none; padding: 7px 12px; font-size: 12px; }
.lore-group-tag {
  flex: none;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-variant);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-variant));
  color: var(--primary-text);
  font-size: 10px;
}
.lore-group-tag.is-empty { background: var(--surface-variant); color: var(--on-surface-variant); }
.lore-item-head { flex-wrap: wrap; row-gap: 4px; }
.lore-item-ops { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.lore-item-ops .wd-mem-op {
  width: auto;
  min-width: 34px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
}
.lore-item-ops .wd-mem-op.is-on { color: var(--primary); font-weight: 600; }
.lore-pin-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.lore-pin-choice input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.lore-pin-choice-main { display: block; min-width: 0; }
.lore-pin-choice-main strong { display: block; font-size: 13px; color: var(--on-bg); }
.lore-pin-choice-main small { display: block; margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--on-surface-variant); }
.lore-budget-hint { margin: 0; line-height: 1.6; font-size: 11px; }
.dmem-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-variant); color: var(--on-surface-variant); }
.dmem-tag.mine { background: var(--primary-fill); color: var(--on-primary); }
.dmem-edit-ops { display: flex; justify-content: flex-end; gap: 8px; }
/* 「他们记得你」按角色分组（2026-10-24 工单 3bdcd0cf：一个角色多条印象） */
.dmem-npc-group { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.dmem-npc-name { font-weight: 600; font-size: 14px; color: var(--primary); }
.dmem-legacy-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--outline);
}
.dmem-legacy-head .dmem-sec-title { font-size: 13px; }
.dmem-add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dream-lore-row .dream-lore-const { flex-shrink: 0; }

/* 记忆原文回溯（梦茧章节 / 入梦世界记忆共用） */
.mem-src { display: block; }
.mem-src > * + * { margin-top: 10px; }
.mem-src-note, .mem-src-status { margin: 0; line-height: 1.7; }
.mem-src-status.error { color: var(--error); }
.mem-src-more { display: block; margin: 0 auto; }
.mem-src-more[hidden] { display: none; }
.mem-src-list { display: block; }
.mem-src-list > * + * { margin-top: 10px; }
.mem-src-item {
  padding: 11px 12px;
  border: 1px solid var(--outline);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  background: var(--surface);
}
.mem-src-head { display: flex; align-items: baseline; justify-content: space-between; }
.mem-src-speaker {
  min-width: 0;
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.mem-src-speaker.is-self { color: var(--on-bg); }
.mem-src-speaker.is-world { color: var(--on-surface-variant); }
.mem-src-time { flex: none; margin-left: 12px; color: var(--on-surface-variant); font-size: 11px; }
.mem-src-text {
  margin: 6px 0 0;
  color: var(--on-bg);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
/* ---------- 入梦 · 本场模型（2026-11-12 工单「世界书里能不能直接换模型」）----------
   入口在「＋」托盘里（不占顶栏：320px 顶栏已经有 ← / 书名+幕数 / 记忆 / ⋯ 四件，
   再加一个按钮就会把书名挤到折行）。选中后那一格的文字变成「模型 · <组名>」。
   ⚠️ 这里**不许用省略号**：第一版给了 72px + text-overflow: ellipsis，
   实测被截成「模型 · Mi…」—— 这一格的唯一意义就是让人一眼看出换成了哪个，
   截掉等于没说。改成允许折两行（只在「 · 」和组名之间断，中文不从中间劈开），
   托盘高一点点，可读性换回来。 */
.dream-input .cmp-item[data-tray='model'] .cmp-txt {
  max-width: 100%;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}
/* 5 格在 390px 上正好卡在换行边界（实测：容器 338 − 左右内边距 24 = 内容 314，
   而 5 × 58 + 4 × 6 = 314，亚像素一抖就换行，第 5 格孤零零落单）。
   收紧到 5px 腾出 4px；万一还换行（320px 上必然），居中让两行看起来是有意的。 */
.dream-input .cmp-tray {
  gap: 5px;
  justify-content: center;
}
/* 已经为本场单独换过通道：与「备注 · 已设置」同一套状态语言（换个小圆点，不换图标） */
.dream-input .cmp-item[data-tray='model'][data-pick-ready='1'] .cmp-ico {
  border-color: var(--primary);
  color: var(--primary-text);
}

/* ---------- 编辑 AI 回复（2026-10-01） ---------- */
.msg-edited { margin-left: 8px; font-size: 11px; color: var(--on-surface-variant); opacity: .75; }
.medit { gap: 10px; }
.medit-text { min-height: 40vh; min-height: min(40vh, max(120px, calc(var(--vvh, 100vh) - 270px))); max-height: max(120px, calc(var(--vvh, 100vh) - 270px)); line-height: 1.7; resize: vertical; }
.medit-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.medit-count { font-size: 12px; color: var(--on-surface-variant); }
.medit-count.full { color: var(--error); }
.medit-ops { display: flex; gap: 8px; }

/* ---------- 快捷指令 / 本场备注（2026-10-01） ---------- */
.cmp-tray { flex-wrap: wrap; }
.cmp-item { min-width: 58px; }
.qc-panel .qc-body { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow-y: auto; }
.qc-empty { margin: 4px 0; font-size: 13px; line-height: 1.7; color: var(--on-surface-variant); }
.qc-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--outline); border-radius: 12px; padding: 8px 10px; }
.qc-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.qc-foot { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.qc-add { display: flex; gap: 8px; }
.qc-input { flex: 1; min-width: 0; }
.qc-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
/* ---------- 收藏夹（2026-10-23，建议「希望增加聊天内容收藏功能」）---------- */
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border: 1px solid var(--outline); border-radius: 14px; background: var(--bg);
}
.fav-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fav-who { font-weight: 600; font-size: 13px; color: var(--primary); }
.fav-where { font-size: 12px; color: var(--on-surface-variant); }
.fav-when { font-size: 11px; color: var(--on-surface-variant); margin-left: auto; }
.fav-text-btn {
  display: block; width: 100%; margin: 0; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.fav-text-btn:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px;
}
.fav-text {
  display: block; margin: 0; font-size: 14px; line-height: 1.7; color: var(--on-bg);
  max-height: 7.2em; overflow: hidden; overflow-wrap: anywhere;
}
.fav-text.is-empty { color: var(--on-surface-variant); font-style: italic; }
.fav-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.fav-detail { display: flex; flex-direction: column; gap: 14px; }
.fav-detail-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.fav-detail-who { font-weight: 600; font-size: 14px; color: var(--primary); }
.fav-detail-where, .fav-detail-when {
  font-size: 12px; color: var(--on-surface-variant);
}
.fav-detail-when { margin-left: auto; }
.fav-detail-text {
  margin: 0; font-size: 15px; line-height: 1.9; color: var(--on-bg);
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: text;
}
.fav-detail-text.is-empty { color: var(--on-surface-variant); font-style: italic; }
.fav-detail-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.cnote-text { min-height: 18vh; line-height: 1.7; resize: vertical; }
/* ---------- 世界书「补细节」（2026-10-01） ---------- */
.wdb-expand { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; padding: 12px; background: var(--surface); border: 1px solid var(--outline); border-radius: 14px; }
.dream-expand-row { display: flex; gap: 8px; align-items: center; }
.dream-expand-hint { flex: 1; min-width: 0; }
.dream-lore-row.is-new { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.dream-expand-chips { flex-wrap: wrap; overflow: visible; }

/* ---------- 「让 TA 回复」行（2026-10-01：发完退出 / 被中止后，最后一条是自己的话、对面没回） ---------- */
.resume-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 12px 14px; padding: 8px 12px; background: var(--surface); border: 1px dashed var(--outline); border-radius: 12px; }
.resume-text { font-size: 13px; color: var(--on-surface-variant); }
/* 被官方审核锁死的会话（2026-10-21 工单 1218b1d9）：这一行常驻，直到他开新对话或发成功。
   与「让 TA 回复」区分开：虚线→实线 + 主色边，一眼能看出这不是暂时状态而是需要他动手的出口。
   窄屏会折行（说明偏长），所以 align-items 用 stretch、按钮不缩，文字段让它自然换行。 */
.resume-row.blocked-row {
  align-items: center; border-style: solid; border-color: var(--primary);
  background: var(--primary-container, var(--surface)); gap: 10px;
}
.blocked-row .resume-text { flex: 1; min-width: 0; line-height: 1.5; }
.blocked-row .btn { flex: none; white-space: nowrap; }

/* ---------- 聊天背景调节弹层（2026-10-01） ---------- */
.cbg { align-items: center; gap: 12px; }
.cbg-preview { position: relative; flex-shrink: 0; border: 1px solid var(--outline); border-radius: 16px; overflow: hidden; background-color: #EDEDED; touch-action: none; cursor: grab; }
.cbg-preview:active { cursor: grabbing; }
.cbg-bubble { position: absolute; max-width: 70%; padding: 5px 9px; font-size: 11px; line-height: 1.4; border-radius: 6px; pointer-events: none; }
.cbg-bubble.l { left: 8px; top: 16%; background: #fff; color: #111; }
.cbg-bubble.r { right: 8px; top: 30%; background: #95ec69; color: #111; }
.cbg-empty { padding: 28px 8px; font-size: 14px; color: var(--on-surface-variant); }
.cbg-controls { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.cbg-range { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cbg-range input[type=range] { flex: 1; min-width: 0; }
.cbg-lab { width: 34px; flex-shrink: 0; color: var(--on-surface-variant); }
.cbg-val { width: 44px; text-align: right; flex-shrink: 0; color: var(--on-bg); font-variant-numeric: tabular-nums; }
.cbg-row { display: flex; gap: 8px; }

/* 旧 WebView（Chrome < 88，如 vivo Y52s 的 Chrome 83）不认 aspect-ratio：社区封面会塌成 0 高。给固定高度兜底。
   inset 简写（Chrome < 87 不认）已在每处旁边补了 top/right/bottom/left 长写，见 guard-legacy-webview。 */
@supports not (aspect-ratio: 1 / 1) {
  .cm-cover { height: 190px; }
  .cm-detail-cover { height: 210px; }
  /* 立绘上传框（角色编辑弹窗）：3:4。宽度是外层给定的，用 padding-top 百分比（按外层宽度算）撑出高度；
     绝对定位的「+ 立绘」文字是相对它自己定位的，不受影响 */
  .art-preview { height: 0; padding: 133.333% 0 0; }
  /* 梦圈发动态的九宫格缩略图：正方形。里面的图改成绝对定位铺满，不再依赖百分比高度 */
  .wx-mc-cell { height: 0; padding: 100% 0 0; }
  .wx-mc-cell img { position: absolute; top: 0; left: 0; }
}

/* 旧 WebView（Chrome < 84）不认 flexbox gap：由 modules/compat-flex-gap.js 检测后给 <html> 加 .no-fgap，
   给实际是 flex 的容器打 data-fg（r 横排 / c 竖排 / w 换行），给它的子元素打 data-fgm + --fg-mx / --fg-my，
   这里用 margin 补出同样的间距。变量写在子元素自己身上（不能靠继承：子元素本身也是容器时会被自己的变量盖掉）。
   data-fgk = 子元素自己带主轴 margin（如 margin-left:auto），不覆盖。新浏览器没有 .no-fgap，这些规则完全不生效。 */
html.no-fgap [data-fgm="r"] { margin-left: var(--fg-mx, 0px) !important; }
html.no-fgap [data-fgm="c"] { margin-top: var(--fg-my, 0px) !important; }
html.no-fgap [data-fgm="rr"] { margin-right: var(--fg-mx, 0px) !important; }
html.no-fgap [data-fgm="cr"] { margin-bottom: var(--fg-my, 0px) !important; }
html.no-fgap [data-fgm="w"] { margin-right: var(--fg-mx, 0px) !important; margin-bottom: var(--fg-my, 0px) !important; }
html.no-fgap [data-fge="r"] { margin-right: var(--fg-ex, 0px) !important; }
html.no-fgap [data-fge="c"] { margin-bottom: var(--fg-ex, 0px) !important; }
html.no-fgap [data-fge="rr"] { margin-left: var(--fg-ex, 0px) !important; }
html.no-fgap [data-fge="cr"] { margin-top: var(--fg-ex, 0px) !important; }
html.no-fgap [data-fg="w"] { margin-right: calc(var(--fg-cmr, 0px) - var(--fg-c, 0px)) !important; margin-bottom: calc(var(--fg-cmb, 0px) - var(--fg-r, 0px)) !important; }
/* 换行容器本身又是别的容器的子元素时，右 / 下 margin 要把两边的值合起来（后写的规则会把前一条整个盖掉） */
html.no-fgap [data-fg="w"][data-fgm="w"] { margin-right: calc(var(--fg-mx, 0px) + var(--fg-cmr, 0px) - var(--fg-c, 0px)) !important; margin-bottom: calc(var(--fg-my, 0px) + var(--fg-cmb, 0px) - var(--fg-r, 0px)) !important; }
html.no-fgap [data-fg="w"][data-fge="r"] { margin-right: calc(var(--fg-ex, 0px) + var(--fg-cmr, 0px) - var(--fg-c, 0px)) !important; }
html.no-fgap [data-fg="w"][data-fge="c"] { margin-bottom: calc(var(--fg-ex, 0px) + var(--fg-cmb, 0px) - var(--fg-r, 0px)) !important; }
html.no-fgap [data-fg="w"][data-fgm="rr"] { margin-right: calc(var(--fg-mx, 0px) + var(--fg-cmr, 0px) - var(--fg-c, 0px)) !important; }
html.no-fgap [data-fg="w"][data-fgm="cr"] { margin-bottom: calc(var(--fg-my, 0px) + var(--fg-cmb, 0px) - var(--fg-r, 0px)) !important; }
/* !important：不少子元素的 margin 是 JS 里写的内联样式（如 style="margin-left:2px"），普通规则压不住；补的值已经把它自己的 margin 加进去了 */

/* 角色页排序条 + 行尾小字（工单「角色置顶 + 排序」）：排序条复用 .chips / .chip，这里只补间距与行尾说明 */
.cast-sort { margin: 0 0 10px; gap: 6px; overflow-x: auto; }
.cast-sort .chip { padding: 6px 9px; flex-shrink: 0; } /* 5 个排序方式在 360 宽的手机上也要一行放得下 */
.cast-meta { margin-left: auto; flex-shrink: 0; font-size: 11px; line-height: 1.4; color: var(--on-surface-variant); white-space: nowrap; }
.cast-meta[hidden], .cast-pin[hidden] { display: none; }

/* 角色页 · 草稿（2026-10-09）：虚线小标表示"还没写完"；草稿区与成品区之间多留一口气 */
.cast-draft-tag { border: 1px dashed var(--outline); background: transparent; }
.cast-draft-sec { margin-top: 4px; }
.cast-draft-sec .cast-sub { margin: 0 0 10px; }

/* 梦信 · 一键退出（长按返回键弹出的小面板，2026-10-04） */
.wx-qe-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.4); display: flex; align-items: flex-end; justify-content: center; }
.wx-qe-panel { width: 100%; max-width: 480px; background: #EDEDED; border-radius: 12px 12px 0 0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.wx-qe-btn { display: block; width: 100%; padding: 15px 16px; border: none; border-bottom: 1px solid rgba(0, 0, 0, 0.08); background: #fff; color: #191919; font-size: 17px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wx-qe-btn:active { background: #e6e6e6; }
.wx-qe-btn.cancel { margin-top: 8px; border-bottom: none; color: #666; }
@media (prefers-color-scheme: dark) {
  .wx-qe-panel { background: #111; }
  .wx-qe-btn { background: #2c2c2c; color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.08); }
  .wx-qe-btn:active { background: #3a3a3a; }
  .wx-qe-btn.cancel { color: rgba(255, 255, 255, 0.55); }
}

/* ===== 公告栏（2026-10-05）：横幅 / 详情 / 列表 / 弹窗，四个级别共用一套颜色变量 =====
   写法兼容 Chrome 70：不用 inset / gap / color-mix / aspect-ratio。 */
:root {
  --nt-urgent: #B3563E; --nt-urgent-bg: rgba(179, 86, 62, 0.10); --nt-urgent-bd: rgba(179, 86, 62, 0.32);
  --nt-warn: #9A6408; --nt-warn-bg: rgba(210, 150, 30, 0.13); --nt-warn-bd: rgba(190, 130, 20, 0.34);
  --nt-info: #6E6B65; --nt-info-bg: rgba(110, 107, 101, 0.09); --nt-info-bd: rgba(110, 107, 101, 0.24);
  --nt-news: #2C8774; --nt-news-bg: rgba(93, 184, 166, 0.15); --nt-news-bd: rgba(60, 160, 140, 0.34);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="huiming"]):not([data-theme="sakura"]) {
    --nt-urgent: #E08772; --nt-urgent-bg: rgba(224, 135, 114, 0.14); --nt-urgent-bd: rgba(224, 135, 114, 0.38);
    --nt-warn: #E0A84C; --nt-warn-bg: rgba(224, 168, 76, 0.14); --nt-warn-bd: rgba(224, 168, 76, 0.36);
    --nt-info: #A5A8B0; --nt-info-bg: rgba(255, 255, 255, 0.06); --nt-info-bd: rgba(255, 255, 255, 0.14);
    --nt-news: #5DB8A6; --nt-news-bg: rgba(93, 184, 166, 0.16); --nt-news-bd: rgba(93, 184, 166, 0.36);
  }
}
:root[data-theme="dark"] {
  --nt-urgent: #E08772; --nt-urgent-bg: rgba(224, 135, 114, 0.14); --nt-urgent-bd: rgba(224, 135, 114, 0.38);
  --nt-warn: #E0A84C; --nt-warn-bg: rgba(224, 168, 76, 0.14); --nt-warn-bd: rgba(224, 168, 76, 0.36);
  --nt-info: #A5A8B0; --nt-info-bg: rgba(255, 255, 255, 0.06); --nt-info-bd: rgba(255, 255, 255, 0.14);
  --nt-news: #5DB8A6; --nt-news-bg: rgba(93, 184, 166, 0.16); --nt-news-bd: rgba(93, 184, 166, 0.36);
}
.nt-chip { display: inline-block; flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; }
.nt-urgent { color: var(--nt-urgent); background: var(--nt-urgent-bg); }
.nt-warn { color: var(--nt-warn); background: var(--nt-warn-bg); }
.nt-info { color: var(--nt-info); background: var(--nt-info-bg); }
.nt-news { color: var(--nt-news); background: var(--nt-news-bg); }
.nt-banner { display: flex; align-items: stretch; margin: 0 0 12px; border-radius: var(--r-card); border: 1px solid var(--outline); border-left-width: 3px; overflow: hidden; }
.nt-b-urgent { background: var(--nt-urgent-bg); border-color: var(--nt-urgent-bd); border-left-color: var(--nt-urgent); }
.nt-b-warn { background: var(--nt-warn-bg); border-color: var(--nt-warn-bd); border-left-color: var(--nt-warn); }
.nt-b-info { background: var(--nt-info-bg); border-color: var(--nt-info-bd); border-left-color: var(--nt-info); }
.nt-b-news { background: var(--nt-news-bg); border-color: var(--nt-news-bd); border-left-color: var(--nt-news); }
.nt-main { flex: 1; min-width: 0; display: block; text-align: left; padding: 10px 6px 10px 12px; background: none; border: none; color: var(--on-bg); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nt-row1 { display: flex; align-items: center; min-width: 0; }
.nt-row1 .nt-chip { margin-right: 8px; }
.nt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-title); font-weight: 600; }
.nt-all {
  flex: none; align-self: center; max-width: 76px; min-height: var(--tap);
  padding: 2px 6px; border: none; background: none; border-radius: 8px;
  color: var(--primary-text); font: inherit; font-size: var(--fs-meta); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nt-all:active { background: rgba(0, 0, 0, 0.05); }
.nt-snip { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.nt-x { flex: none; width: var(--tap); min-height: var(--tap); background: none; border: none; color: var(--on-surface-variant); font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nt-x:active, .nt-main:active { background: rgba(0, 0, 0, 0.05); }
.nt-meta { display: flex; align-items: center; flex-wrap: wrap; margin: 2px 0 12px; }
.nt-meta .nt-chip { margin-right: 8px; }
.nt-meta-t, .nt-pop-win { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.nt-ended { margin-left: 8px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.nt-body { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-body); line-height: 1.8; color: var(--on-surface); }
.nt-link { width: 100%; margin-top: 16px; }
.nt-list { display: flex; flex-direction: column; }
.nt-sec { margin: 12px 2px 4px; font-size: var(--fs-meta); color: var(--on-surface-variant); letter-spacing: .06em; }
.nt-sec:first-child { margin-top: 2px; }
.nt-row { display: flex; align-items: center; width: 100%; padding: 12px 2px; text-align: left; background: none; border: none; border-bottom: 1px solid var(--outline); color: var(--on-bg); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nt-row .nt-chip { margin-right: 10px; }
.nt-row.is-ended { opacity: .62; }
.nt-row-main { flex: 1; min-width: 0; display: block; }
.nt-row-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); font-weight: 600; }
.nt-row-title-unread { display: flex; align-items: center; min-width: 0; }
.nt-row-title-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-row-dot { flex: none; }
.nt-row-sub { display: block; margin-top: 2px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.nt-row-snip { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.nt-empty { padding: 28px 8px; text-align: center; font-size: var(--fs-body); color: var(--on-surface-variant); }
.nt-pop { text-align: left; }
.nt-pop-head { margin-bottom: 8px; }
.nt-pop .nt-body { margin-bottom: 4px; }
.nt-pop-win { margin: 8px 0 2px; }
.nt-p-urgent { border-top: 3px solid var(--nt-urgent); }
.nt-p-warn { border-top: 3px solid var(--nt-warn); }
.nt-p-news { border-top: 3px solid var(--nt-news); }
/* 我的反馈（2026-10-06）：详情里的分段标题 / 开发者批阅块 / 进度时间线；列表复用 .nt-row */
.mf-sec { margin: 16px 0 6px; font-size: var(--fs-meta); color: var(--on-surface-variant); letter-spacing: .06em; }
.mf-sec:first-of-type { margin-top: 4px; }
.mf-reply { padding: 10px 12px; border-left: 3px solid var(--primary); border-radius: 0 var(--r-card) var(--r-card) 0; background: var(--surface-variant); }
.mf-reply-by { margin-top: 6px; text-align: right; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.mf-none { padding: 4px 2px; font-size: var(--fs-body); color: var(--on-surface-variant); }
.mf-tl { display: flex; align-items: baseline; padding: 3px 2px; font-size: var(--fs-body); color: var(--on-surface); }
.mf-tl-t { flex: none; margin-right: 10px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.mf-follow-item { padding: 3px 2px; }
.mf-follow-item .mf-tl { padding: 0; }
.mf-follow-item .fs-row { margin-top: 4px; }
/* 反馈截图（2026-10-06）：表单里的选择器 / 缩略图 / 详情里的只读缩略图 */
.fs-box { margin: 2px 0; }
.fs-bar { display: flex; align-items: center; }
.fs-row { display: flex; flex-wrap: wrap; margin: 6px -4px 0; }
.fs-th { position: relative; margin: 4px; }
.fs-img { display: block; width: 72px; height: 72px; object-fit: cover; margin: 4px; border-radius: 10px; border: 1px solid var(--outline); background: var(--surface-variant); cursor: zoom-in; }
.fs-th .fs-img { margin: 0; cursor: default; }
.fs-th-state {
  position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 999px;
  background: var(--primary-fill); color: var(--on-primary); font-size: 10px; line-height: 1.4;
  pointer-events: none;
}
.fs-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; line-height: 20px; text-align: center; border-radius: 50%; border: 1px solid var(--outline); background: var(--surface); color: var(--on-surface); font-size: 14px; cursor: pointer; }
.fs-status { min-height: 17px; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--on-surface-variant); }
.fs-status[data-state="ready"], .fs-status[data-state="ok"] { color: var(--primary-text); }
.fs-status[data-state="error"] { color: var(--error); }
.fs-note { margin-top: 6px; font-size: 11px; line-height: 1.6; }
.mf-follow .mf-sec { margin-top: 16px; }
.mf-pre { white-space: pre-line; word-break: break-word; }
.mf-ta { display: block; width: 100%; box-sizing: border-box; margin-top: 2px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); color: var(--on-surface); font: inherit; font-size: var(--fs-body); line-height: 1.6; resize: vertical; }
/* 注销账号（设置里）：说明文字 / 删除清单 / 红字警示 / 拒绝提示 / 主按钮 */
.ad-p { margin: 10px 0 4px; font-size: var(--fs-body); line-height: 1.7; color: var(--on-surface); }
.ad-state { font-size: var(--fs-title); font-weight: 600; color: var(--nt-warn); }
.ad-list { margin: 6px 0 4px 20px; padding: 0; font-size: var(--fs-body); line-height: 1.8; color: var(--on-surface); }
.ad-warn { margin: 10px 0 4px; padding: 8px 12px; border-left: 3px solid var(--nt-urgent); border-radius: 0 var(--r-card) var(--r-card) 0; background: var(--nt-urgent-bg); font-size: var(--fs-body); line-height: 1.7; color: var(--nt-urgent); }
.ad-rejected { margin-bottom: 8px; padding: 8px 12px; border-radius: var(--r-card); background: var(--nt-warn-bg); font-size: var(--fs-body); line-height: 1.7; color: var(--nt-warn); }
.ad-input { margin-top: 12px; }
.ad-btn, .ad-danger { width: 100%; margin-top: 14px; }
.ad-danger { color: #fff; background: var(--nt-urgent); border-color: var(--nt-urgent); }
.ad-danger:disabled { opacity: .5; }
.mf-ta:focus { outline: none; border-color: var(--primary); }
.mf-send { width: 100%; margin-top: 10px; }
.nt-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--nt-urgent); vertical-align: middle; }
.nt-count { display: inline-block; min-width: 16px; height: 16px; padding: 0 5px; margin-left: 6px; border-radius: 8px; box-sizing: border-box; background: var(--nt-urgent); color: #fff; font-size: 10px; line-height: 16px; text-align: center; vertical-align: middle; }

/* ===== 会员反馈（2026-10-11）：会员卡同款的深色卡片（复用 mc-card 系列）+ 时限进度 + 四步进度条 =====
   兼容 Chrome 70：不用 gap / inset / color-mix，间距用 margin。 */
.mf-hero { margin: 0 0 14px; }
/* 会员反馈弹层里的这张卡：卡面已经纸面化了，这里用次级面跟弹层拉开一层层次 */
.mf-hero { background: var(--surface-variant); }
.mf-hero .mc-title { font-size: 24px; }
.mf-hero-sm { padding: 18px 18px 16px; }
.mf-hero-sm .mc-title { font-size: 22px; }
.mf-hero .mc-hero { margin-top: 14px; }
.mf-hero .mc-hero-cell b { font-size: 22px; }
.mf-badge { display: inline-block; flex: none; margin-left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; line-height: 1.2; color: #fff; background: linear-gradient(135deg, #d98a72, #a85a40); vertical-align: middle; }
.mf-row-member { position: relative; padding-left: 12px; }
.mf-row-member::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, #d98a72, #a85a40); }
.mf-prog { display: block; height: 4px; margin-top: 7px; border-radius: 2px; background: var(--outline); overflow: hidden; }
.mf-prog > i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #d98a72, #cc785c); }
.mf-prog.warn > i { background: var(--nt-warn); }
.mf-prog.over > i { background: var(--nt-urgent); }
.mf-due { display: block; margin-top: 5px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.mf-due.over { color: var(--nt-urgent); font-weight: 600; }
.mf-steps { display: flex; align-items: flex-start; margin: 16px 2px 2px; padding: 0; list-style: none; }
.mf-step { position: relative; flex: 1; text-align: center; font-size: 12px; color: rgba(167, 161, 152, 0.9); }
.mf-step i { position: relative; z-index: 1; display: block; width: 12px; height: 12px; margin: 0 auto 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.mf-step:not(:last-child)::after { content: ''; position: absolute; top: 5px; left: 50%; width: 100%; height: 2px; background: rgba(255, 255, 255, 0.14); }
.mf-step.done i { background: #d98a72; }
.mf-step.done:not(:last-child)::after { background: #d98a72; }
.mf-step.done { color: #e6e1d8; }
.mf-step.cur { color: #f2efe9; font-weight: 600; }
.mf-step.cur i { box-shadow: 0 0 0 4px rgba(217, 138, 114, 0.28); }
.mf-reply-m { border-left-color: #cc785c; background: rgba(204, 120, 92, 0.08); }
.mf-av { display: inline-block; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; line-height: 26px; text-align: center; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #d98a72, #a85a40); vertical-align: middle; }
.mf-reply-m .mf-av { float: left; margin: 0 10px 4px 0; }
.mf-ok { text-align: center; padding: 8px 0 4px; }
.mf-ok-ico { display: inline-block; width: 56px; height: 56px; line-height: 56px; border-radius: 50%; font-size: 26px; color: #fff; background: linear-gradient(135deg, #d98a72, #a85a40); box-shadow: 0 10px 24px rgba(204, 120, 92, 0.32); }
.mf-ok-title { margin-top: 14px; font-family: var(--font-display); font-size: 22px; color: var(--on-surface); }
.mf-ok-note { margin-top: 6px; font-size: var(--fs-meta); color: var(--primary-text); letter-spacing: 0.04em; }
.mf-ok-due { margin-top: 8px; font-size: var(--fs-body); line-height: 1.7; color: var(--on-surface-variant); }
.mf-ok-actions { margin-top: 18px; }
.mf-slot:empty { display: none; }

/* ===== 创作者主页整页（2026-10-05，creator.js）：封面带 + 头像 / 称号 / 简介 + 数字 + 代表作 + 作品区 =====
   主滚动区 .app-body 自带 20px 内边距：封面带用负外边距铺满。写法兼容 Chrome 70（不用 inset / flex gap / aspect-ratio）。 */
.cr-page { padding-bottom: 80px; }
.cr-hero { position: relative; margin: -20px -20px 0; height: 168px; overflow: hidden; }
.cr-hero-flat { height: 64px; }
.cr-cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--surface-variant); }
.cr-cover-img { position: absolute; top: -20px; right: -20px; bottom: -20px; left: -20px; background-size: cover; background-position: center top; -webkit-filter: blur(14px) saturate(1.1); filter: blur(14px) saturate(1.1); }
.cr-cover-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.05) 45%, var(--bg) 100%); }
.cr-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.cr-ic { width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.32); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.cr-ic:active { background: rgba(0, 0, 0, 0.5); }
.cr-head { position: relative; margin-top: -44px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cr-av-wrap { padding: 4px; border-radius: 50%; background: var(--bg); }
.cr-av.cm-av-xl { width: 88px; height: 88px; font-size: 36px; }
.cr-name { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cr-name-t { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--on-bg); margin: 0 8px 0 0; word-break: break-all; }
.cr-level { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.cr-level-new { color: var(--on-surface-variant); background: var(--surface-variant); }
.cr-level-active { color: var(--nt-news); background: var(--nt-news-bg); }
.cr-level-star { color: var(--nt-warn); background: var(--nt-warn-bg); }
.cr-sig { margin-top: 6px; font-size: var(--fs-body); color: var(--on-surface); max-width: 520px; word-break: break-word; }
.cr-sig.is-empty { color: var(--on-surface-variant); font-style: italic; }
.cr-bio { margin-top: 10px; max-width: 520px; font-size: var(--fs-body); line-height: 1.75; color: var(--on-surface-variant); white-space: pre-wrap; word-break: break-word; text-align: left; }
.cr-bio.is-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cr-bio-toggle { margin-top: 2px; background: none; border: none; color: var(--primary-text); font-size: var(--fs-meta); cursor: pointer; padding: 4px 8px; }
.cr-bio-empty { margin-top: 10px; background: none; border: 1px dashed var(--outline); border-radius: var(--r-ctl); color: var(--on-surface-variant); font-size: var(--fs-body); padding: 10px 14px; cursor: pointer; }
.cr-meta { margin-top: 10px; font-size: var(--fs-meta); color: var(--on-surface-variant); letter-spacing: .04em; }
.cr-actions { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.cr-actions .btn { margin: 0 5px 8px; min-width: 104px; }
.cr-stats { display: flex; margin: 8px 0 4px; padding: 12px 4px; border: 1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); }
.cr-stat { flex: 1; min-width: 0; display: block; text-align: center; background: none; border: none; color: inherit; font: inherit; padding: 0; }
.cr-stat + .cr-stat { border-left: 1px solid var(--outline); }
.cr-stat b { display: block; font-size: 18px; color: var(--on-bg); }
.cr-stat span { display: block; margin-top: 2px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.cr-stat.is-link { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cr-sec { margin-top: 20px; }
.cr-sec-t { margin: 0 2px 10px; font-size: var(--fs-title); font-weight: 600; color: var(--on-bg); }
.cr-hint { padding: 14px; border: 1px dashed var(--outline); border-radius: var(--r-card); font-size: var(--fs-meta); color: var(--on-surface-variant); text-align: center; }
.cr-toolbar { margin-bottom: 12px; }
.cr-tabs { display: flex; border-bottom: 1px solid var(--outline); }
.cr-tab { position: relative; flex: none; padding: 10px 14px 11px; margin-right: 2px; background: none; border: none; color: var(--on-surface-variant); font-size: var(--fs-body); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cr-tab i { margin-left: 5px; font-style: normal; font-size: var(--fs-meta); opacity: .75; }
.cr-tab.is-on { color: var(--on-bg); font-weight: 600; }
.cr-tab.is-on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.cr-sorts { display: flex; margin-top: 10px; }
.cr-sort { margin-right: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--outline); background: none; color: var(--on-surface-variant); font-size: var(--fs-meta); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cr-sort.is-on { color: var(--on-primary); background: var(--primary-fill); border-color: var(--primary-fill); }
.cr-works { transition: opacity .15s; }
.cr-empty { padding: 36px 12px; text-align: center; color: var(--on-surface-variant); font-size: var(--fs-body); }
.cr-more-wrap { display: flex; justify-content: center; margin-top: 16px; }
.cr-more-btn { min-width: 140px; }
.cr-sentinel { height: 1px; }
.cr-pin { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.42); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.cr-pin.is-on { color: #FFD66B; }
.cr-pinned-mark { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #FFD66B; font-size: 11px; font-weight: 600; }
.cr-menu { display: flex; flex-direction: column; }
.cr-menu-row { display: block; width: 100%; padding: 14px 4px; text-align: left; background: none; border: none; border-bottom: 1px solid var(--outline); color: var(--on-bg); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.cr-menu-row.is-danger { color: var(--error); }
.cr-menu-switch { display: flex; align-items: center; padding: 14px 4px; font-size: var(--fs-body); color: var(--on-surface); }
.cr-menu-switch input { margin-right: 10px; }
.cr-field { display: block; }
.cr-field > span { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: var(--fs-meta); color: var(--on-surface-variant); }
.cr-bio-input { min-height: 120px; line-height: 1.7; resize: vertical; }
.cr-count { font-size: var(--fs-meta); }
.cr-err { min-height: 18px; font-size: var(--fs-meta); color: var(--error); }
.cr-skel-line { width: 160px; height: 14px; margin-top: 12px; border-radius: 7px; background: var(--surface-variant); }
.cr-skel-line.short { width: 100px; }
@media (min-width: 720px) {
  .cr-page { max-width: 760px; margin: 0 auto; }
}
.cr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===== 世界书封面（2026-10-05）：书墙卡片缩略图 + 编辑器里的封面选择 ===== */
.wd-book-top { display: flex; align-items: flex-start; }
.wd-book-info { flex: 1; min-width: 0; }
.wd-book-cover { flex: none; width: 72px; height: 96px; margin-right: 12px; border-radius: 10px; background-color: var(--surface-variant); background-size: cover; background-position: center; border: 1px solid var(--outline); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.wdb-cover { display: flex; align-items: flex-start; margin: 4px 0 14px; }
.wdb-cover-prev { flex: none; width: 96px; height: 128px; margin-right: 14px; border-radius: 12px; border: 1px dashed var(--outline); background-color: var(--surface-variant); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--on-surface-variant); font-size: var(--fs-meta); letter-spacing: .1em; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wdb-cover-prev.has { border-style: solid; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); }
.wdb-cover-side { flex: 1; min-width: 0; }
.wdb-cover-title { font-size: var(--fs-body); font-weight: 600; color: var(--on-bg); margin-bottom: 4px; }
.wdb-cover-btns { display: flex; flex-wrap: wrap; margin-top: 10px; }
.wdb-cover-btns .btn { margin-right: 8px; margin-bottom: 6px; }
.wdb-cover-status { margin-top: 4px; min-height: 16px; }

/* ===== 对话字号（2026-10-06）：设置里的「对话字号」只写 <html> 上的 --chat-scale（chat-font.js），
   上面这些对话文字的 font-size 都是 calc(原字号 * var(--chat-scale, 1))；输入框用 --chat-input-scale（只放大不缩小）。
   下面是设置页那一行的预览条（跟着变量一起变，所见即所得）。写法兼容 Chrome 70。 ===== */
.cs-preview { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-card); background: var(--surface-variant); color: var(--on-surface); font-size: calc(16px * var(--chat-scale, 1)); line-height: 1.7; }

/* ===== 社区整改（2026-10-07，工单「类型区分标注的意思范围有些太广」）：两级分类 / 来源 / 出处作品 / 专题 / 好评 / 18+ 提示 ===== */
.cm-cat-desc, .cm-sub-desc { margin: 0; line-height: 1.5; }
.cm-subs, .cm-origins, .cm-fandom-sugg, .cm-series-sugg, .cm-f-origins, .cm-f-aud .chips, .cm-f-codream .chips, .cm-f-fandoms .chips, .cm-cm-phrases, .cr-series { flex-wrap: wrap; }
.cm-origin-wrap, .cm-series-wrap { display: flex; flex-direction: column; gap: 8px; }
.cm-series-picked { flex-wrap: wrap; }
.cm-series-picked[hidden] { display: none; }
.cm-series-picked-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.cm-series-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-series-x { flex: none; font-size: 17px; line-height: 1; opacity: .75; }
.cm-series-addrow { display: flex; align-items: stretch; gap: 8px; }
.cm-series-addrow .field { flex: 1; min-width: 0; }
.cm-series-add { flex: none; min-height: 44px; padding: 0 18px; }
.cm-series-add:disabled { opacity: .5; }
.cm-series-hint { font-size: 12px; line-height: 1.5; }
.cm-tag-count { margin: -4px 2px 0; }
.cm-tag-count.is-low { color: var(--on-surface-variant); /* 2026-10-15：这是建议不是错误，别用警示橙 */ }
.cm-card-snip { font-size: 12px; line-height: 1.45; color: var(--on-bg); opacity: 0.78; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.cm-subpanel { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: var(--r-ctl); background: var(--surface-variant); }
.cm-subpanel .chips { flex-wrap: wrap; }
.cm-f-aud, .cm-f-codream, .cm-f-fandoms { display: flex; flex-direction: column; gap: 6px; }
.cm-cat-foot { display: flex; gap: 8px; }
.cm-cat-foot .btn { flex: 1; }
.cm-coll { margin: 4px 0 12px; }
/* 本周热门作者横条（2026-10-25）：社区页顶部，与「专题精选」同一条显示规则。
   ⚠️ 类名用 cm-hotbar 不是 cm-hot —— 后者**早就有主**（8619 行的「热门」胶囊，
   position:absolute; top:8px; right:8px），撞名会让整条横条被绝对定位跑到页面顶上。 */
.cm-hotbar { margin: 4px 0 12px; }
.cm-hotbar-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.cm-hotbar-item { flex: 0 0 auto; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-variant); color: var(--on-bg); font: inherit; cursor: pointer; text-align: center; }
.cm-hotbar-item:active { opacity: .85; }
.cm-hotbar-av { width: 44px; height: 44px; font-size: 17px; }
.cm-hotbar-name { max-width: 100%; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-hotbar-item .tier-badge { padding: 1px 7px; font-size: 10px; }
.cm-hotbar-none { font-size: 10px; color: var(--on-surface-variant); }
.cm-hotbar-hint { font-size: 10px; color: var(--on-surface-variant); }
.cm-coll-head { font-size: 13px; font-weight: 700; margin: 0 2px 8px; color: var(--on-bg); }
.cm-coll-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.cm-coll-card { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-variant); color: var(--on-bg); font: inherit; text-align: left; cursor: pointer; }
.cm-coll-covers { display: flex; height: 64px; border-radius: 10px; overflow: hidden; background: var(--outline); }
.cm-coll-covers i { flex: 1; background: center top / cover no-repeat; border-right: 1px solid var(--bg); }
.cm-coll-covers i:last-child { border-right: 0; }
.cm-coll-card b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-coll-card span { font-size: 11px; color: var(--on-surface-variant); }
.cm-adult-hint { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin: 10px 0; font-size: 12px; color: var(--on-surface-variant); border: 1px dashed var(--outline); border-radius: var(--r-ctl); }
.cm-adult-hint[hidden] { display: none; }
.cm-adult-hint small { width: 100%; text-align: center; }
.cm-review { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 12px; background: var(--surface-variant); }
.cm-review[hidden] { display: none; }
.cm-review-sum { font-size: 13px; color: var(--on-bg); }
.cm-review-ask { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--on-bg); }
.cm-creator-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--outline); cursor: pointer; text-align: left; }
.cm-creator-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cm-creator-main span { font-size: 12px; color: var(--on-surface-variant); }
.cm-fix-sub { border-color: var(--primary); color: var(--primary-text); }
.cr-series { margin: 8px 0 4px; }
.chips[hidden], .cm-subs[hidden], .cm-fandom-sugg[hidden], .cm-series-sugg[hidden], .cr-series[hidden] { display: none; }
.cm-cat-tile.is-empty { opacity: 0.55; }
.cm-coll-covers.is-poster { align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.92); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.cm-coll-covers.is-poster .cm-poster-text { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.cm-good { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; line-height: 1.5; color: #fff; background: rgba(0, 0, 0, 0.55); text-shadow: none; }
/* ===== 社区整改二期（2026-10-07）：面向 / 内容分级单选 ===== */
.cm-auds, .cm-aud-bar, .cm-f-rating .chips { flex-wrap: wrap; }
.cm-aud-hint { margin: 0; }
/* .cm-aud-bar 已移除（2026-10-15）：面向筛选收进「筛选」抽屉，首页不再单占一行 */

/* ===== 展示层（2026-10-11，工单 d270b2b7「想要 HTML 美化的角色简介 + 可折叠状态栏」）===== */
/* ① 状态栏：作者自填的「标签 · 内容」对，默认折叠。不用 gap（Chrome 70 没有），全用 margin。 */
.card-bar { border: 1px solid var(--outline); border-radius: 12px; background: var(--surface-variant); }
.card-bar > summary { cursor: pointer; padding: 10px 12px; font-size: 13px; color: var(--primary-text); list-style: none; }
.card-bar > summary::-webkit-details-marker { display: none; }
.card-bar > summary::after { content: '＋'; float: right; font-size: 12px; color: var(--on-surface-variant); }
.card-bar[open] > summary::after { content: '－'; }
.card-bar[open] > summary { border-bottom: 1px solid var(--outline); }
.card-bar-title { font-weight: 600; }
.card-bar-sub { margin-left: 8px; font-size: 12px; color: var(--on-surface-variant); }
.card-bar-grid { display: flex; flex-wrap: wrap; padding: 10px 12px 2px; }
.bar-item { display: flex; align-items: baseline; max-width: 100%; margin: 0 8px 8px 0; padding: 4px 10px; border: 1px solid var(--outline); border-radius: 999px; background: var(--surface); font-size: 12px; }
.bar-k { color: var(--on-surface-variant); }
.bar-k::after { content: '·'; margin: 0 5px; color: var(--primary-text); }
.bar-v { color: var(--on-bg); font-weight: 600; word-break: break-word; }

/* ② 美化简介：作者写的白名单 HTML 渲染在这一盒里。
   ⚠️ contain: layout paint 是安全闸的一部分（modules/intro-html.js 头部第 ⑥ 条）：
      它让这个盒子成为定位包含块、并把绘制裁进盒内 —— 万一清洗漏掉一个
      position:fixed / z-index，它也飞不出这块简介、盖不到充值按钮上。 */
.intro-html { position: relative; contain: layout paint; max-width: 100%; font-size: 13px; line-height: 1.8; color: var(--on-surface); word-break: break-word; overflow-wrap: anywhere; }
.intro-html > * + * { margin-top: 8px; }
.intro-html p { margin: 0; }
.intro-html a { color: var(--primary-text); }
.intro-html img { max-width: 100%; height: auto; border-radius: 8px; }
.intro-html ul, .intro-html ol { margin: 0; padding-left: 1.4em; }
.intro-html li + li { margin-top: 2px; }
.intro-html blockquote { margin: 0; padding: 2px 10px; border-left: 3px solid var(--primary); color: var(--on-surface-variant); }
.intro-html h3, .intro-html h4, .intro-html h5, .intro-html h6 { margin: 0; font-size: 14px; font-weight: 600; color: var(--on-bg); }
.intro-html hr { border: 0; border-top: 1px solid var(--outline); }
.card-opening { width: 100%; min-width: 0; font-size: inherit; white-space: normal; }
.card-opening div { flex-wrap: wrap; }
.card-opening div:has(> div:only-child:empty[style*="width:"][style*="background"]) {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin: 4px 0 8px;
}
.card-opening div > div:only-child:empty[style*="width:"][style*="background"] {
  height: 100%;
  border-radius: 3px;
}

/* ===== 展示预设（2026-10-11）：作者只能选 id，样式全在这里（.intro-html.ip-<id>）===== */
.sb-presets { display: flex; flex-wrap: wrap; margin: 6px 0 4px; }
.sb-presets > * { margin: 0 6px 6px 0; }
.sb-presets > .active { color: var(--primary-text); border-color: var(--primary); }
.intro-html.ip-letter { background-color: #fbf6ea; padding: 14px 16px; border: 1px solid #e3d8c1; border-radius: 6px; font-family: "Songti SC", "Noto Serif SC", serif; color: #4a3f2e; }
.intro-html.ip-night { background-image: linear-gradient(160deg, #1d2b4a, #0f1424); padding: 16px; border-radius: 12px; color: #e8edf7; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.intro-html.ip-night a { color: #9ec5ff; }
.intro-html.ip-film { background-color: #15120f; padding: 14px 16px; border: 1px solid #3a3129; border-radius: 4px; color: #e9d9b8; letter-spacing: 0.4px; }
.intro-html.ip-film a { color: #e0b45a; }
.intro-html.ip-note { background-color: #fff6a8; padding: 14px 16px; color: #4a4120; border-radius: 2px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); transform: rotate(-0.6deg); }
.intro-html.ip-diary { background-color: #fffdf7; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #e3d6bb 27px, #e3d6bb 28px); padding: 14px 16px; border: 1px solid #e3d6bb; border-radius: 4px; color: #3d3a33; line-height: 28px; }
.intro-html.ip-ink { background-color: #f3f0e8; padding: 12px 16px; border-left: 3px solid #1f1f1f; border-radius: 0 4px 4px 0; color: #1f1f1f; font-family: "Kaiti SC", "STKaiti", "Songti SC", serif; letter-spacing: 1px; }
.intro-html.ip-pastel { background-image: linear-gradient(135deg, #cfe8ff, #ffd6e8); padding: 16px; border-radius: 16px; color: #3a3350; box-shadow: 0 4px 12px rgba(120, 100, 160, 0.18); }
.intro-html.ip-neon { background-color: #0b0b14; padding: 14px 16px; border: 1px solid #1ff0ff; border-radius: 10px; color: #e6f7ff; text-shadow: 0 0 6px #1ff0ff; box-shadow: 0 0 14px rgba(31, 240, 255, 0.35); }
.intro-html.ip-forest { background-image: radial-gradient(circle at top right, #dff3e3, #b8e0c1); padding: 14px 16px; border: 1px solid #9fd0ab; border-radius: 12px; color: #24432c; }

/* 状态栏跟着预设走（同一个 ip-<id> class 挂在 details.card-bar 上） */
.card-bar.ip-letter { background-color: #fbf6ea; border-color: #e3d8c1; }
.card-bar.ip-letter > summary { color: #7a5c32; }
.card-bar.ip-letter .bar-item { background-color: #fffdf6; border-color: #e3d8c1; color: #4a3f2e; }
.card-bar.ip-letter .bar-k, .card-bar.ip-letter .bar-v { color: #4a3f2e; }
.card-bar.ip-night { background-color: #18213a; border-color: #2c3b63; }
.card-bar.ip-night > summary { color: #f5d68a; }
.card-bar.ip-night .bar-item { background-color: #1e2a4a; border-color: #2c3b63; color: #e8edf7; }
.card-bar.ip-night .bar-k, .card-bar.ip-night .bar-v { color: #e8edf7; }
.card-bar.ip-film { background-color: #15120f; border-color: #3a3129; }
.card-bar.ip-film > summary { color: #e0b45a; }
.card-bar.ip-film .bar-item { background-color: #1e1a16; border-color: #3a3129; color: #e9d9b8; }
.card-bar.ip-film .bar-k, .card-bar.ip-film .bar-v { color: #e9d9b8; }
.card-bar.ip-note { background-color: #fff6a8; border-color: #e8d96a; }
.card-bar.ip-note > summary { color: #7a6510; }
.card-bar.ip-note .bar-item { background-color: #fffbd0; border-color: #e8d96a; color: #4a4120; }
.card-bar.ip-note .bar-k, .card-bar.ip-note .bar-v { color: #4a4120; }
.card-bar.ip-diary { background-color: #fffdf7; border-color: #e3d6bb; }
.card-bar.ip-diary > summary { color: #6b5b3e; }
.card-bar.ip-diary .bar-item { background-color: #fffdf7; border-color: #e3d6bb; color: #3d3a33; }
.card-bar.ip-diary .bar-k, .card-bar.ip-diary .bar-v { color: #3d3a33; }
.card-bar.ip-ink { background-color: #f3f0e8; border-color: #cfc9bb; }
.card-bar.ip-ink > summary { color: #1f1f1f; }
.card-bar.ip-ink .bar-item { background-color: #f7f5ef; border-color: #cfc9bb; color: #1f1f1f; }
.card-bar.ip-ink .bar-k, .card-bar.ip-ink .bar-v { color: #1f1f1f; }
.card-bar.ip-pastel { background-image: linear-gradient(135deg, #e4f1ff, #ffe6f1); border-color: #cfc3e6; }
.card-bar.ip-pastel > summary { color: #5a4f7a; }
.card-bar.ip-pastel .bar-item { background-color: #ffffff; border-color: #d9cdef; color: #3a3350; }
.card-bar.ip-pastel .bar-k, .card-bar.ip-pastel .bar-v { color: #3a3350; }
.card-bar.ip-neon { background-color: #0b0b14; border-color: #1ff0ff; }
.card-bar.ip-neon > summary { color: #1ff0ff; }
.card-bar.ip-neon .bar-item { background-color: #111a22; border-color: #1ff0ff; color: #e6f7ff; }
.card-bar.ip-neon .bar-k, .card-bar.ip-neon .bar-v { color: #e6f7ff; }
.card-bar.ip-forest { background-image: radial-gradient(circle at top right, #eef9f0, #cfead6); border-color: #9fd0ab; }
.card-bar.ip-forest > summary { color: #2f5a3a; }
.card-bar.ip-forest .bar-item { background-color: #f4fbf5; border-color: #9fd0ab; color: #24432c; }
.card-bar.ip-forest .bar-k, .card-bar.ip-forest .bar-v { color: #24432c; }

/* ===== 聊天气泡预设（2026-10-11）：只挂在助手的气泡上；选择器比 .msg-group.assistant .msg-bubble 高，才盖得住基础样式 ===== */
.msg-group.assistant .msg-bubble.bb-paper { background-color: #fbf6ea; border: 1px solid #e3d8c1; color: #4a3f2e; font-family: "Songti SC", "Noto Serif SC", serif; }
.msg-group.assistant .msg-bubble.bb-night { background-color: #1b2440; color: #e8edf7; }
.msg-group.assistant .msg-bubble.bb-sakura { background-color: #ffe8f0; color: #5a2d3d; border-radius: 18px; }
.msg-group.assistant .msg-bubble.bb-mint { background-color: #e4f7ef; color: #24483a; border-radius: 18px; }
/* 外观（2026-10-11）：圆角 / 边框 / 字号 / 背景图写在元素的行内样式上（数值与白名单生成），这里只管字体与动画。
   选择器与预设同级，放在预设后面，所以外观的字体盖得住预设的字体。 */
.msg-group.assistant .msg-bubble.bb-font-serif { font-family: "Songti SC", "Noto Serif SC", "SimSun", serif; }
.msg-group.assistant .msg-bubble.bb-font-sans { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
.msg-group.assistant .msg-bubble.bb-font-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.msg-group.assistant .msg-bubble.bb-anim-fade { animation: bubble-look-fade .45s ease-out both; }
.msg-group.assistant .msg-bubble.bb-anim-pop { animation: bubble-look-pop .35s ease-out both; }
@keyframes bubble-look-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bubble-look-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .msg-group.assistant .msg-bubble.bb-anim-fade, .msg-group.assistant .msg-bubble.bb-anim-pop { animation: none; }
}
.sb-bubble input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--outline); border-radius: 8px; background: none; }
.intro-html table { width: 100%; border-collapse: collapse; font-size: 12px; }
.intro-html th, .intro-html td { padding: 4px 6px; border: 1px solid var(--outline); text-align: left; }
.intro-html code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.intro-html details { border: 1px solid var(--outline); border-radius: 10px; padding: 0 10px; }
.intro-html details > summary { cursor: pointer; padding: 8px 0; font-size: 12px; color: var(--primary-text); list-style: none; }
.intro-html details > summary::-webkit-details-marker { display: none; }
.intro-html details[open] > summary { border-bottom: 1px solid var(--outline); margin-bottom: 6px; }
.card-intro > .intro-html { padding: 12px 14px; border: 1px solid var(--outline); border-radius: 12px; background: var(--surface); }
/* 编辑器里的预览：虚线边、小一号，明确「这是预览、不是正文」 */
.sb-preview > * + * { margin-top: 8px; }
.sb-preview .intro-html { padding: 8px 10px; border: 1px dashed var(--outline); border-radius: 10px; font-size: 12px; }
.sb-preview .card-bar { background: var(--surface); }

/* ③ 编辑器：状态栏的行（标签 + 内容 + 删除） */
.sb-editor > * + * { margin-top: 8px; }
.sb-row { display: flex; align-items: center; }
.sb-row .field { min-width: 0; }
.sb-label { flex: 0 0 32%; margin-right: 8px; }
.sb-value { flex: 1; margin-right: 8px; }
.sb-del { flex: none; width: 30px; height: 30px; border: 1px solid var(--outline); border-radius: 999px; background: transparent; color: var(--on-surface-variant); font-size: 15px; line-height: 1; cursor: pointer; }
.sb-ops { display: flex; flex-wrap: wrap; margin-top: 8px; }
.sb-ops .btn { margin-right: 8px; }

/* ===== 会员弹层（2026-10-12 重做）：纸感摘要 → 免费/会员对比表 → 规则注释 → 价格与条款 → 订单与退款（折叠）→ 底部固定的开通键
   只用设计令牌；茧丝竖线（3px primary 左边线）是摘要的唯一装饰；不用光晕、玻璃拟态、中文斜体。 */
.mx-box { padding: 2px 0 4px; color: var(--on-surface); }
.mx-hero { margin: 2px 0 16px; padding: 2px 0 2px 14px; border-left: 3px solid var(--primary); }
.mx-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--on-surface-variant); }
.mx-title { margin-top: 6px; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--on-bg); }
.mx-sub { margin-top: 6px; font-size: 13.5px; line-height: 1.7; color: var(--on-surface-variant); }
.mx-table-wrap { margin: 0 -2px; }
.mx-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.55; table-layout: fixed; }
.mx-table th, .mx-table td { padding: 10px 6px; border-bottom: 1px solid var(--outline); vertical-align: top; text-align: left; font-weight: 400; }
.mx-table thead th { padding-top: 4px; padding-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--on-surface-variant); }
.mx-table .mx-k { width: 30%; color: var(--on-surface); font-weight: 500; }
.mx-table .mx-free { width: 33%; color: var(--on-surface-variant); }
.mx-table .mx-mem { width: 37%; color: var(--on-surface); }
.mx-table thead .mx-mem { color: var(--primary-text); }
.mx-table tbody td.mx-mem { background: rgba(204, 120, 92, 0.07); }
.mx-now { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--primary-text); }
.mx-notes { margin: 12px 0 0; padding: 0 0 0 18px; font-size: 12px; line-height: 1.7; color: var(--on-surface-variant); }
.mx-notes li { margin-top: 4px; }
.mx-price { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.mx-price-main { font-family: var(--font-display); font-size: 24px; line-height: 1.2; color: var(--on-bg); }
.mx-price-main small { font-family: var(--font-sans); font-size: 13px; color: var(--on-surface-variant); }
.mx-price-note { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--on-surface-variant); }
.mx-price-note a { color: var(--primary-text); }
.mx-more { margin-top: 16px; border-top: 1px solid var(--outline); padding-top: 4px; }
.mx-more > summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--on-surface); cursor: pointer; list-style: none; }
.mx-more > summary::-webkit-details-marker { display: none; }
.mx-more > summary::after { content: '展开'; margin-left: auto; font-size: 12px; color: var(--on-surface-variant); }
.mx-more[open] > summary::after { content: '收起'; }
.mx-cta { position: sticky; bottom: 0; margin: 16px -20px -4px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--outline); }
.mx-cta .btn { width: 100%; min-height: 48px; margin-top: 0; }

/* ===== 兑换会员码（2026-10-12）：会员弹层里的入口 + 兑换页。只用设计令牌；输入框等宽，便于核对 16 位码 */
.rd-entry { margin-top: 12px; border-top: 1px solid var(--outline); padding-top: 2px; }
.rd-box { padding: 2px 0 4px; color: var(--on-surface); }
.rd-lead { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--on-surface-variant); }
.rd-field { display: block; margin-top: 18px; }
.rd-label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--on-surface-variant); }
.rd-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--on-bg);
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rd-input:focus { outline: none; border-color: var(--primary); }
.rd-input::placeholder { color: var(--on-surface-variant); opacity: 0.55; letter-spacing: 0.1em; }
.rd-err { min-height: 20px; margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--error); }
.rd-go { width: 100%; min-height: 48px; margin-top: 6px; }
.rd-note { margin: 14px 0 0; font-size: 12px; line-height: 1.7; color: var(--on-surface-variant); }

/* ============================================================
   社区首页 + 创作者主页重构（2026-10-15）
   原则：首屏让给作品；同一件事只出现一处；零值与占位不上墙。
   广场顶行（文字标签 + 社区动作）、两行吸顶工具条、两列瀑布流卡片、作品优先的创作者主页。
   覆盖前面的旧规则（同选择器、后写为准），旧规则待样板确认后再清理。
   ============================================================ */

/* ---- 广场顶行：官方精选 | 社区（文字标签），右侧社区动作 ---- */
.plaza-tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -6px 0 10px; min-height: 48px; }
.plaza-seg.plaza-seg--text { display: flex; gap: 20px; padding: 0; margin: 0; background: none; border-radius: 0; }
.plaza-seg--text .plaza-seg-btn { position: relative; flex: none; min-height: 44px; padding: 0 1px; border-radius: 0; background: none; box-shadow: none; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--on-surface-variant); }
.plaza-seg--text .plaza-seg-btn.active { background: none; box-shadow: none; color: var(--on-bg); font-weight: 700; }
.plaza-seg--text .plaza-seg-btn.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 3px; border-radius: 2px; background: var(--primary); }
.plaza-seg--text .plaza-seg-btn .cm-dot { position: absolute; top: 8px; right: -10px; margin: 0; }
.plaza-tabs-actions[hidden] { display: none !important; }
.cm-top-actions { display: flex; align-items: center; gap: 8px; }
.cm-top-ic { position: relative; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--outline); border-radius: 50%; background: var(--surface); color: var(--on-bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cm-top-ic .cm-dot { position: absolute; top: 3px; right: 3px; margin: 0; box-shadow: 0 0 0 2px var(--bg); }
.cm-top-ic.cm-mine { border: 0; background: none; }
.cm-av.cm-av-top { width: 34px; height: 34px; font-size: 14px; box-shadow: 0 0 0 1px var(--outline); }
.cm-pubbtn { flex: none; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--primary-fill); color: var(--on-primary); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cm-pubbtn:active { filter: brightness(0.94); }

/* ---- 社区工具条：两行、吸顶 ---- */
.plaza-community .cm-toolbar { position: sticky; top: -20px; z-index: 6; margin: 0 -20px 12px; padding: 8px 20px 10px; gap: 8px; background: var(--bg); box-shadow: 0 1px 0 var(--outline); }
.cm-search-row { display: flex; align-items: center; gap: 8px; }
.cm-search-row .cm-search { flex: 1; min-width: 0; min-height: 42px; margin: 0; border-radius: 999px; padding-left: 16px; }
.cm-catbtn { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 14px; border: 1px solid var(--outline); border-radius: 999px; background: var(--surface); color: var(--on-bg); font-size: 14px; cursor: pointer; }
.cm-catbtn.active { border-color: var(--primary); color: var(--primary-text); }
.cm-catbtn-ic { font-size: 13px; opacity: 0.8; }
.cm-filter-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-filter-scroll { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cm-filter-scroll::-webkit-scrollbar { display: none; }
.cm-filter-scroll .cm-kinds,
.cm-filter-scroll .cm-tagfilter { display: flex; flex: none; flex-wrap: nowrap; gap: 6px; margin: 0; }
.cm-filter-scroll .cm-tagfilter:empty { display: none; }
.cm-filter-scroll .chip { flex: none; min-height: 32px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.cm-filter-row .cm-sortsel { flex: none; min-height: 32px; padding: 0 2px 0 8px; border: 0; background: none; color: var(--on-surface-variant); font-size: 13px; white-space: nowrap; }

/* ---- 两列瀑布流 ---- */
.cm-grid.cm-masonry { grid-auto-rows: 4px; row-gap: 0; column-gap: 12px; align-items: start; }
.cm-grid.cm-masonry > .cm-masonry-full { grid-column: 1 / -1; margin-bottom: 12px; }

/* ---- 卡片 ---- */
.cm-card { border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 19, 0.06); }
.cm-cover { aspect-ratio: 1 / 1.4; }
.cm-cover.cm-cover-poster { aspect-ratio: 1 / 1 !important; }
.cm-cover-poster .cm-poster-text { font-size: 30px; }
.cm-card .cm-kind { top: 7px; left: 7px; padding: 1px 7px; font-size: 10.5px; }
.cm-card .cm-rate { position: absolute; top: 7px; right: 7px; }
.cm-lock-mark { position: absolute; right: 7px; bottom: 7px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.cm-codream-mark { position: absolute; left: 7px; bottom: 7px; padding: 1px 7px; border-radius: 999px; background: rgba(93, 184, 166, 0.9); color: #10201c; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.cm-codream-tag { color: var(--tertiary); border-color: rgba(93, 184, 166, 0.45); background: rgba(93, 184, 166, 0.12); }
.cm-card-body { padding: 8px 10px 10px; gap: 7px; }
.cm-card-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.38; font-size: 14px; }
.cm-card-foot { font-size: 11.5px; }
.cm-card .cm-author { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cm-author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-card .cm-stat { flex: none; white-space: nowrap; }
.cm-card .cm-st-ad { font-weight: 600; color: var(--on-surface); }
.cm-card .cm-st-ad.is-new { padding: 0 6px; border: 1px solid currentColor; border-radius: 999px; font-size: 10.5px; line-height: 16px; color: var(--primary-text); }

/* ---- 创作者主页：作品优先 ---- */
.app-shell.cr-mode .app-header { display: none; }
.cr-top { position: sticky; top: -20px; z-index: 7; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; margin: -20px -20px -56px; padding: 0 12px; transition: background-color 0.2s, box-shadow 0.2s; }
.cr-top.is-solid { background: var(--bg); box-shadow: 0 1px 0 var(--outline); }
.cr-top-t { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 16px; color: var(--on-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.cr-top.is-solid .cr-top-t { opacity: 1; }
.cr-top .cr-ic { flex: none; width: 38px; height: 38px; font-size: 18px; }
.cr-top.is-solid .cr-ic { background: transparent; color: var(--on-bg); }
.cr-hero { height: 112px; }
.cr-head { margin-top: -36px; align-items: stretch; text-align: left; gap: 10px; }
.cr-id-row { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.cr-av-wrap { flex: none; padding: 3px; }
.cr-av.cm-av-xl { width: 72px; height: 72px; font-size: 28px; }
.cr-id { min-width: 0; padding-bottom: 4px; }
.cr-name { justify-content: flex-start; margin-top: 0; }
.cr-name-t { font-size: 21px; margin-right: 8px; }
.cr-sig { margin-top: 2px; font-size: 13px; color: var(--on-surface-variant); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-bio { margin: 0; font-size: 14px; line-height: 1.6; color: var(--on-surface); text-align: left; }
.cr-bio.is-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-bio-toggle { align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: none; color: var(--primary-text); font-size: 13px; }
.cr-bio-empty { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--primary-text); font-size: 13px; cursor: pointer; }
.cr-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 13px; color: var(--on-surface-variant); }
.cr-stat { display: inline-flex; align-items: baseline; gap: 3px; flex: none; padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.cr-stat b { font-size: 15px; font-weight: 700; color: var(--on-bg); }
.cr-stat.is-link { cursor: pointer; }
.cr-stat-sep { font-style: normal; opacity: 0.55; }
.cr-stat-new { font-size: 13px; color: var(--on-surface-variant); }
.cr-actions { justify-content: stretch; flex-wrap: nowrap; gap: 10px; margin-top: 2px; }
.cr-actions .btn,
.cr-actions .cm-follow-lg { flex: 1; min-width: 0; margin: 0; min-height: 40px; }
.cr-sec--pins { margin-top: 18px; }
.cr-pins { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cr-pins::-webkit-scrollbar { display: none; }
.cr-pins .cm-card { flex: 0 0 132px; }
.cr-sec--works { margin-top: 16px; }
.cr-toolbar { position: sticky; top: 36px; z-index: 5; margin: 0 -20px 10px; padding: 0 20px 8px; background: var(--bg); }
.cr-sorts { margin-top: 8px; gap: 16px; }
.cr-sort { padding: 2px 0; border: 0; border-radius: 0; background: none; font-size: 13px; color: var(--on-surface-variant); }
.cr-sort.is-on { background: none; color: var(--on-bg); font-weight: 600; }
.cr-hint { margin: 0 0 10px; font-size: 12px; color: var(--on-surface-variant); }
.cr-hint { margin: 0 0 10px; padding: 0; border: 0; border-radius: 0; background: none; text-align: left; font-size: 12px; color: var(--on-surface-variant); }

/* ---- 作品详情：整页（2026-10-15） ---- */
.cast-sheet.cast-sheet--full { height: 100%; max-width: 640px; gap: 0; padding: 0; border: 0; border-radius: 0; }
.cast-sheet-head.cast-sheet-head--full { flex: none; height: 56px; padding: 0 6px; border-bottom: 1px solid var(--outline); }
.cast-sheet-back,
.cast-sheet-menu { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--on-bg); font-size: 20px; line-height: 1; cursor: pointer; }
.cast-sheet-menu.is-empty { display: inline-block; }
.cast-sheet--full .cast-sheet-title { flex: 1; text-align: center; font-size: 16px; }
.cast-sheet--full .ui-sheet-body { flex: 1; padding: 0 16px 20px; }
.ui-sheet-foot { flex: none; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--outline); background: var(--bg); }
.cm-detail-foot { flex-wrap: nowrap; gap: 10px; }
.cm-detail-foot .btn { flex: 1; min-width: 0; min-height: 46px; }
.cm-detail-foot .cm-adopt { flex: 2; }
.cast-sheet--full .cm-detail { gap: 14px; }
.cast-sheet--full .cm-detail-cover { width: calc(100% + 32px); max-width: none; margin: 0 -16px; border-radius: 0; aspect-ratio: 4 / 5; }
.cast-sheet--full .cm-detail-cover.cm-cover-poster { aspect-ratio: 16 / 9; }
.cm-detail-title { margin: 4px 0 -4px; font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--on-bg); }
.cast-sheet--full .cm-authorcard { padding: 10px 12px; }

/* ---- 发布表单：整页、分组、说明折叠（2026-10-15 重构） ---- */
.cast-sheet--full .ui-sheet-body:has(> .cm-publish) { padding-bottom: 0; }
.cast-sheet--full .cm-publish { gap: 0; }
.cm-pub-hero { display: flex; align-items: flex-start; gap: 14px; margin: 4px 0 6px; }
.cm-pub-hero .cm-preview { flex: none; width: 140px; padding: 0; }
.cm-pub-hero .cm-preview .cm-card { width: 140px; box-shadow: 0 2px 10px rgba(20, 20, 19, 0.1); }
.cm-pub-hero-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.cm-pub-hero-t { font-size: 15px; font-weight: 600; color: var(--on-bg); line-height: 1.4; }
.cm-pub-hero-s { font-size: 12.5px; color: var(--on-surface-variant); }
.cm-pub-hero .cm-prevbox { margin-top: 8px; }
.cm-pub-hero .cm-prevbox summary { font-size: 13px; }
.cm-publish > .cm-revive:not([hidden]) { padding: 10px 12px; border-radius: 12px; background: var(--surface-variant); }
.cm-pub-sec { display: flex; flex-direction: column; gap: 8px; padding: 18px 0 4px; border-top: 1px solid var(--outline); margin-top: 14px; }
.cm-pub-h { margin: 0 0 2px; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--on-bg); }
.cm-pub-sec .cm-sec-label[hidden] { display: none; }
.cm-pub-sec .cm-sec-label { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--on-surface); }
.cm-pub-sub { font-weight: 400; font-size: 12px; color: var(--on-surface-variant); }
.cm-pub-sec .field { margin: 0; }
.cm-pub-sec .cm-tag-hint { margin: 0; font-size: 12px; }
.cm-pub-sec .cm-tagsuggest { flex-direction: row; flex-wrap: wrap; gap: 6px; margin: 0; }
.cm-pub-sec .cm-taggroup { border: 1px solid var(--outline); border-radius: 999px; background: var(--surface); }
.cm-pub-sec .cm-taggroup summary { padding: 5px 12px; font-size: 13px; }
.cm-pub-sec .cm-taggroup[open] { flex-basis: 100%; border-radius: 14px; background: var(--surface-variant); }
.cm-pub-sec .cm-classify,
.cm-pub-sec .cm-pairing-wrap,
.cm-pub-sec .cm-origin-wrap,
.cm-pub-sec .cm-series-wrap { display: flex; flex-direction: column; gap: 8px; }
.cm-pub-sec .cm-lock,
.cm-pub-sec .cm-bubble,
.cm-pub-sec .cm-intro { padding: 4px 0; }
.cm-pub-sec label.cm-agree { font-size: 14px; flex-wrap: wrap; }
.cm-help-btn { flex: none; margin-left: 2px; padding: 1px 8px; border: 1px solid var(--outline); border-radius: 999px; background: none; color: var(--on-surface-variant); font-size: 11.5px; font-weight: 400; line-height: 1.5; cursor: pointer; }
.cm-help-btn.is-open { border-color: var(--primary); color: var(--primary-text); }
.cm-help:not(.is-open) { display: none; }
.cm-help.is-open { margin: 2px 0 4px; padding: 8px 10px; border-radius: 10px; background: var(--surface-variant); font-size: 12px; line-height: 1.65; }
.cm-pub-notes { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--outline); }
.cm-pub-notes > summary { cursor: pointer; font-size: 13px; color: var(--on-surface-variant); }
.cm-pub-notes[open] > summary { margin-bottom: 8px; }
.cm-pub-notes .cm-notes { margin: 0 0 8px; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.cm-rules-gate-note { margin: 10px 0 0; font-size: 12px; line-height: 1.65; }
.cm-foot-rule { font-size: 12px; line-height: 1.5; color: var(--on-surface-variant); text-align: center; }
.cast-sheet--full .cm-publish .cm-foot { bottom: 0; margin: 8px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 12px rgba(20, 20, 19, 0.05); }
.cast-sheet--full .cm-publish-edit { gap: 0; }
.cm-pub-warn { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-variant); line-height: 1.6; }
.cm-sync-hint { margin: 0; font-size: 12px; line-height: 1.65; }
.cm-edit-foot { display: flex; flex-direction: column; }
.cm-edit-foot .btn { width: 100%; }
.cr-needsub { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 12px; background: var(--surface-variant); color: var(--on-surface); font-size: 13px; line-height: 1.5; text-align: left; cursor: pointer; }
.cr-needsub[hidden] { display: none; }
.cr-needsub b { flex: none; font-weight: 600; color: var(--primary-text); }
/* ---- 发布前社区规则闸门（2026-10-31）---- */
.pub-rules-overlay {
  z-index: 130;
  padding: 20px;
  background: rgba(10, 12, 17, .58);
}
.pub-rules-card {
  width: min(560px, calc(100vw - 40px));
  max-width: 560px;
  max-height: min(88vh, 88dvh);
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .34);
}
.pub-rules-card:focus { outline: none; }
.pub-rules-head {
  flex: none;
  padding: 22px 24px 15px;
  border-bottom: 1px solid var(--outline);
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 38%),
    var(--bg);
}
.pub-rules-kicker {
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--primary-text);
}
.pub-rules-head .modal-title {
  margin: 0 0 7px;
  font-size: 23px;
  line-height: 1.25;
}
.pub-rules-lead {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--on-surface-variant);
}
.pub-rules-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 24px 10px;
  scrollbar-gutter: stable;
}
.pub-rules-scroll:focus { outline: none; }
.pub-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pub-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface);
}
.pub-rule-no {
  flex: none;
  width: 24px;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--on-surface-variant);
}
.pub-rule-copy { min-width: 0; flex: 1; }
.pub-rule-text {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: var(--on-surface);
}
.pub-rule-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0 6px 3px 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: 1px;
}
.pub-rule.is-critical {
  border-color: color-mix(in srgb, var(--error) 46%, var(--outline));
  background: color-mix(in srgb, var(--error) 7%, var(--bg));
}
.pub-rule.is-critical .pub-rule-no { color: var(--error); }
.pub-rules-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px 2px;
  font-size: 11.5px;
  color: var(--on-surface-variant);
}
.pub-rules-version {
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.pub-rules-foot {
  flex: none;
  padding: 12px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--outline);
  background: var(--bg);
  box-shadow: 0 -8px 24px rgba(20, 20, 19, .06);
}
.pub-rules-progress {
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--on-surface-variant);
}
.pub-rules-progress.is-ready { color: var(--primary-text); font-weight: 600; }
.pub-rules-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--on-bg);
  cursor: pointer;
}
.pub-rules-ack input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}
.pub-rules-ack.is-disabled {
  color: var(--on-surface-variant);
  cursor: default;
}
.pub-rules-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.pub-rules-actions .btn {
  flex: 1;
  min-height: 44px;
}
.pub-rules-ok { flex: 1.35 !important; }
@media (max-width: 767px) {
  .pub-rules-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .pub-rules-card {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
  .pub-rules-head { padding: 20px 18px 13px; }
  .pub-rules-head .modal-title { font-size: 21px; }
  .pub-rules-scroll { padding: 12px 18px 8px; }
  .pub-rules-foot { padding-right: 18px; padding-left: 18px; }
}
/* 创作者主页背景（会员，2026-10-15）：自定义背景清晰显示、头图加高；本人右下角「更换背景」 */
.cr-hero.cr-hero--tall { height: 168px; }
.cr-cover-img.is-custom { top: 0; right: 0; bottom: 0; left: 0; -webkit-filter: none; filter: none; background-position: center; }
/* 自定义背景只在最底下四分之一过渡到底色（头像压在那里），上面保持原图；裁剪框里叠同一层，所见即所得 */
.cr-hero--tall .cr-cover-shade,
.cr-crop-shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 74%, var(--bg) 100%); }
.cr-crop-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; pointer-events: none; }
.cr-cover-edit { position: absolute; right: 12px; bottom: 44px; z-index: 2; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 12.5px; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cr-crop-frame { position: relative; width: 100%; height: 0; padding-top: 41.6667%; /* 12:5；不用 aspect-ratio（Chrome 83 的壳不认） */ border-radius: 12px; background-color: var(--surface-variant); background-repeat: no-repeat; background-size: cover; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; box-shadow: inset 0 0 0 1px var(--outline); }
.cr-crop-frame:active { cursor: grabbing; }
.ui-sheet-foot .btn[data-cover-save] { width: 100%; }

/* ============================================================
   创作者主页装扮（2026-10-15）：主题色 .cr-accent--ID / 全屏背景 .cr-bg--ID / 作品排列 .cr-layout--single
   套在 .app-shell 上，只作用在创作者主页本页（main.js 离开该页时摘掉）；id 与 backend/src/lib/creator-theme.js 一一对应（jest 钉）。
   主题色全部低饱和：2026-10-09 试过全站换饱和主题色，铺在奶油纸底上很违和，已回退——这里只改本页，且收着用。
   背景全是叠在 var(--bg) 上的半透明渐变 / 纹理：文字色不变，任何一款都不会让字看不清；零图片。
   ============================================================ */
.cr-accent--rose { --primary: #B05468; --primary-deep: #8C3A4D; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--rose { --primary: #E08FA0; --primary-deep: #E08FA0; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--rose { --primary: #E08FA0; --primary-deep: #E08FA0; --on-primary: #141413; }
.cr-accent--amber { --primary: #9C6419; --primary-deep: #7D4F12; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--amber { --primary: #E0A85A; --primary-deep: #E0A85A; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--amber { --primary: #E0A85A; --primary-deep: #E0A85A; --on-primary: #141413; }
.cr-accent--olive { --primary: #5B7B4A; --primary-deep: #3F5C33; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--olive { --primary: #9DBF7E; --primary-deep: #9DBF7E; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--olive { --primary: #9DBF7E; --primary-deep: #9DBF7E; --on-primary: #141413; }
.cr-accent--teal { --primary: #3F7F7A; --primary-deep: #2D6560; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--teal { --primary: #7CC4BE; --primary-deep: #7CC4BE; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--teal { --primary: #7CC4BE; --primary-deep: #7CC4BE; --on-primary: #141413; }
.cr-accent--blue { --primary: #4A6FA5; --primary-deep: #345580; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--blue { --primary: #8FB0E0; --primary-deep: #8FB0E0; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--blue { --primary: #8FB0E0; --primary-deep: #8FB0E0; --on-primary: #141413; }
.cr-accent--violet { --primary: #7B5EA7; --primary-deep: #5E4486; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--violet { --primary: #B79DE0; --primary-deep: #B79DE0; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--violet { --primary: #B79DE0; --primary-deep: #B79DE0; --on-primary: #141413; }
.cr-accent--slate { --primary: #5A6270; --primary-deep: #3F4652; --on-primary: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-accent--slate { --primary: #AEB6C4; --primary-deep: #AEB6C4; --on-primary: #141413; }
}
:root[data-theme="dark"] .cr-accent--slate { --primary: #AEB6C4; --primary-deep: #AEB6C4; --on-primary: #141413; }
.cr-bg--mist { --cr-bg-img: linear-gradient(180deg, rgba(120, 150, 190, 0.3) 0%, rgba(120, 150, 190, 0) 62%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--mist { --cr-bg-img: linear-gradient(180deg, rgba(90, 120, 170, 0.3) 0%, rgba(90, 120, 170, 0) 66%); }
}
:root[data-theme="dark"] .cr-bg--mist { --cr-bg-img: linear-gradient(180deg, rgba(90, 120, 170, 0.3) 0%, rgba(90, 120, 170, 0) 66%); }
.cr-bg--sand { --cr-bg-img: linear-gradient(180deg, rgba(214, 168, 112, 0.34) 0%, rgba(214, 168, 112, 0) 62%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--sand { --cr-bg-img: linear-gradient(180deg, rgba(190, 140, 90, 0.26) 0%, rgba(190, 140, 90, 0) 66%); }
}
:root[data-theme="dark"] .cr-bg--sand { --cr-bg-img: linear-gradient(180deg, rgba(190, 140, 90, 0.26) 0%, rgba(190, 140, 90, 0) 66%); }
.cr-bg--pine { --cr-bg-img: linear-gradient(180deg, rgba(96, 130, 110, 0.3) 0%, rgba(96, 130, 110, 0) 62%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--pine { --cr-bg-img: linear-gradient(180deg, rgba(70, 120, 96, 0.3) 0%, rgba(70, 120, 96, 0) 66%); }
}
:root[data-theme="dark"] .cr-bg--pine { --cr-bg-img: linear-gradient(180deg, rgba(70, 120, 96, 0.3) 0%, rgba(70, 120, 96, 0) 66%); }
.cr-bg--sunset { --cr-bg-img: linear-gradient(180deg, rgba(238, 138, 96, 0.36) 0%, rgba(226, 120, 150, 0.24) 34%, rgba(226, 120, 150, 0) 70%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--sunset { --cr-bg-img: linear-gradient(180deg, rgba(224, 110, 80, 0.34) 0%, rgba(190, 80, 130, 0.26) 36%, rgba(190, 80, 130, 0) 72%); }
}
:root[data-theme="dark"] .cr-bg--sunset { --cr-bg-img: linear-gradient(180deg, rgba(224, 110, 80, 0.34) 0%, rgba(190, 80, 130, 0.26) 36%, rgba(190, 80, 130, 0) 72%); }
.cr-bg--sea { --cr-bg-img: linear-gradient(180deg, rgba(80, 170, 180, 0.34) 0%, rgba(70, 120, 190, 0.2) 40%, rgba(70, 120, 190, 0) 72%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--sea { --cr-bg-img: linear-gradient(180deg, rgba(40, 150, 170, 0.34) 0%, rgba(40, 90, 170, 0.26) 42%, rgba(40, 90, 170, 0) 74%); }
}
:root[data-theme="dark"] .cr-bg--sea { --cr-bg-img: linear-gradient(180deg, rgba(40, 150, 170, 0.34) 0%, rgba(40, 90, 170, 0.26) 42%, rgba(40, 90, 170, 0) 74%); }
.cr-bg--sakura { --cr-bg-img: linear-gradient(180deg, rgba(232, 140, 168, 0.34) 0%, rgba(232, 140, 168, 0) 64%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--sakura { --cr-bg-img: linear-gradient(180deg, rgba(210, 100, 140, 0.3) 0%, rgba(210, 100, 140, 0) 68%); }
}
:root[data-theme="dark"] .cr-bg--sakura { --cr-bg-img: linear-gradient(180deg, rgba(210, 100, 140, 0.3) 0%, rgba(210, 100, 140, 0) 68%); }
.cr-bg--lavender { --cr-bg-img: linear-gradient(180deg, rgba(150, 120, 200, 0.34) 0%, rgba(150, 120, 200, 0) 64%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--lavender { --cr-bg-img: linear-gradient(180deg, rgba(130, 100, 200, 0.32) 0%, rgba(130, 100, 200, 0) 68%); }
}
:root[data-theme="dark"] .cr-bg--lavender { --cr-bg-img: linear-gradient(180deg, rgba(130, 100, 200, 0.32) 0%, rgba(130, 100, 200, 0) 68%); }
.cr-bg--stars { --cr-bg-img: radial-gradient(circle, rgba(70, 80, 130, 0.3) 1px, transparent 1.6px) 0 0 / 38px 38px, radial-gradient(circle, rgba(70, 80, 130, 0.2) 1px, transparent 1.6px) 19px 19px / 38px 38px, linear-gradient(180deg, rgba(90, 100, 160, 0.2) 0%, rgba(90, 100, 160, 0) 70%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--stars { --cr-bg-img: radial-gradient(circle, rgba(255, 255, 255, 0.5) 1px, transparent 1.6px) 0 0 / 38px 38px, radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1.6px) 19px 19px / 38px 38px, linear-gradient(180deg, rgba(70, 80, 170, 0.3) 0%, rgba(70, 80, 170, 0) 72%); }
}
:root[data-theme="dark"] .cr-bg--stars { --cr-bg-img: radial-gradient(circle, rgba(255, 255, 255, 0.5) 1px, transparent 1.6px) 0 0 / 38px 38px, radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1.6px) 19px 19px / 38px 38px, linear-gradient(180deg, rgba(70, 80, 170, 0.3) 0%, rgba(70, 80, 170, 0) 72%); }
.cr-bg--paper { --cr-bg-img: repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.07) 0, rgba(120, 100, 70, 0.07) 1px, transparent 1px, transparent 6px), linear-gradient(180deg, rgba(214, 190, 150, 0.22) 0%, rgba(214, 190, 150, 0) 60%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--paper { --cr-bg-img: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 6px), linear-gradient(180deg, rgba(170, 140, 100, 0.16) 0%, rgba(170, 140, 100, 0) 60%); }
}
:root[data-theme="dark"] .cr-bg--paper { --cr-bg-img: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 6px), linear-gradient(180deg, rgba(170, 140, 100, 0.16) 0%, rgba(170, 140, 100, 0) 60%); }
.cr-bg--aurora { --cr-bg-img: radial-gradient(ellipse 90% 46% at 20% 0%, rgba(90, 200, 160, 0.34), transparent 70%), radial-gradient(ellipse 80% 42% at 90% 8%, rgba(150, 110, 220, 0.3), transparent 70%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-bg--aurora { --cr-bg-img: radial-gradient(ellipse 90% 46% at 20% 0%, rgba(60, 200, 150, 0.36), transparent 70%), radial-gradient(ellipse 80% 42% at 90% 8%, rgba(130, 90, 230, 0.4), transparent 70%); }
}
:root[data-theme="dark"] .cr-bg--aurora { --cr-bg-img: radial-gradient(ellipse 90% 46% at 20% 0%, rgba(60, 200, 150, 0.36), transparent 70%), radial-gradient(ellipse 80% 42% at 90% 8%, rgba(130, 90, 230, 0.4), transparent 70%); }

/* 全屏背景：画在滚动容器 #app-body 自己的背景上（background-attachment 默认 scroll = 不随内容滚动，等于固定在屏幕上，
   不用 fixed 附着——老 WebView 上那个会卡）。吸顶的顶栏 / 标签栏改成半透明 + 模糊，不然是一块和渐变不搭的实色板。 */
.app-shell.cr-bgmode { --cr-bar: rgba(250, 249, 245, 0.76); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-shell.cr-bgmode { --cr-bar: rgba(10, 12, 17, 0.76); }
}
:root[data-theme="dark"] .app-shell.cr-bgmode { --cr-bar: rgba(10, 12, 17, 0.76); }
.app-shell.cr-bgmode #app-body { background: var(--cr-bg-img), var(--bg); }
.app-shell.cr-bgmode .cr-top.is-solid,
.app-shell.cr-bgmode .cr-toolbar { background: var(--cr-bar); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* 头图是自动封面（作品立绘 / 昵称渐变）时，选了背景就不画它：让背景一直铺到页顶，不然最浓的那一段被头图盖住 */
.app-shell.cr-bgmode .cr-hero:not(.cr-hero--custom) .cr-cover { display: none; }
/* 作品排列：单列大图（默认两列瀑布流不用写）。封面在单列里按横幅比例，不然一张竖图占满一屏 */
.app-shell.cr-layout--single .cr-grid { grid-template-columns: minmax(0, 1fr); }
.app-shell.cr-layout--single .cr-grid .cm-cover { aspect-ratio: 16 / 10 !important; }
.app-shell.cr-layout--single .cr-grid .cm-cover.cm-cover-poster { aspect-ratio: 16 / 9 !important; }
.app-shell.cr-layout--single .cr-grid .cm-card-title { font-size: 15px; }
/* 装扮面板 */
.cr-decor { gap: 18px; }
.cr-decor-sec { display: flex; flex-direction: column; gap: 10px; }
.cr-decor-h { margin: 0; font-size: 14px; font-weight: 600; color: var(--on-bg); display: flex; align-items: center; gap: 8px; }
.cr-decor-h small { font-weight: 400; font-size: 12px; color: var(--on-surface-variant); }
.cr-decor-row { display: flex; gap: 10px; }
/* 主题色 / 背景是网格，不是横滑的一排：面板里不该有任何横向滑动（2026-10-16 反馈「一拖整个里面都动」） */
.cr-decor-row--accent { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 4px; }
.cr-decor-row--bg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 6px; padding: 4px; }
.cr-decor-row .cr-layout-btn { flex: 1 1 0; min-width: 0; }
.ui-sheet-foot .btn[data-theme-save],
.ui-sheet-foot .btn[data-bg-save] { width: 100%; }
.cr-swatch { position: relative; flex: none; width: auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--on-surface-variant); font-size: 11.5px; cursor: pointer; }
.cr-swatch-dot { display: block; width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--outline); }
.cr-swatch.is-on { color: var(--on-bg); font-weight: 600; }
.cr-swatch.is-on .cr-swatch-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--on-bg); }
.cr-swatch-dot.is-accent { background: var(--primary); }
.cr-swatch-tile.is-none { background: var(--bg); }
.cr-swatch-tile { display: block; width: 100%; height: 0; padding-top: 138%; border-radius: 10px; background: var(--cr-bg-img), var(--bg); box-shadow: 0 0 0 1px var(--outline); }
.cr-swatch.is-on .cr-swatch-tile { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--on-bg); }
.cr-swatch-vip { position: absolute; top: 3px; right: 3px; padding: 0 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 10px; line-height: 15px; }
.cr-layout-btn { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--outline); border-radius: 10px; background: var(--surface); color: var(--on-surface); font-size: 14px; cursor: pointer; }
.cr-layout-btn.is-on { border-color: var(--primary); color: var(--primary-deep); font-weight: 600; }
.cr-decor-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--on-surface-variant); }
.cr-decor-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-decor-head .btn { flex: none; min-height: 36px; padding: 0 14px; }

/* ============================================================
   会员自己的全屏背景图（2026-10-16）：图写在滚动容器 #app-body 的背景上（不随内容滚动），
   头部和每个内容区垫一层「磨砂面板」（半透明的主题底色，不用 backdrop-filter：低端安卓上大面积模糊滚动会卡）。
   面板透明度三档：默认 .82 · 通透 .64 · 厚实 .94；次要文字在面板里加深（浅色 #4E4B46 / 深色 #A9ADB8），
   实算：默认和厚实两档压在纯黑 / 纯白图上，正文与次要文字对比度都 ≥ 5.2:1；通透档不保证（面板上有说明）。
   ============================================================ */
.app-shell.cr-bgimg { --cr-glass-rgb: 250, 249, 245; --cr-ga: 0.82; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-shell.cr-bgimg { --cr-glass-rgb: 10, 12, 17; }
}
:root[data-theme="dark"] .app-shell.cr-bgimg { --cr-glass-rgb: 10, 12, 17; }
.app-shell.cr-bgimg.cr-glass--clear { --cr-ga: 0.64; }
.app-shell.cr-bgimg.cr-glass--solid { --cr-ga: 0.94; }
.app-shell.cr-bgimg #app-body { background: var(--cr-bg-url) center top / cover no-repeat, var(--bg); }
.app-shell.cr-bgimg .cr-head,
.app-shell.cr-bgimg .cr-sec { margin-left: -10px; margin-right: -10px; padding: 14px 16px; border-radius: 18px; background: rgba(var(--cr-glass-rgb), var(--cr-ga)); --on-surface-variant: #4E4B46; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-shell.cr-bgimg .cr-head,
  :root:not([data-theme="light"]) .app-shell.cr-bgimg .cr-sec { --on-surface-variant: #A9ADB8; }
}
:root[data-theme="dark"] .app-shell.cr-bgimg .cr-head,
:root[data-theme="dark"] .app-shell.cr-bgimg .cr-sec { --on-surface-variant: #A9ADB8; }
/* 吸顶的标签栏对齐面板边缘（原来是对齐页面边距，会比面板宽出一截） */
.app-shell.cr-bgimg .cr-toolbar { margin: 0 -16px 10px; padding: 0 16px 8px; }
/* 装扮面板里的「我的图」缩略图 / 面板透明度 / 背景图裁剪框（9:16，窄一点，不然一屏装不下） */
.cr-swatch-tile { position: relative; }
.cr-swatch-tile.is-mine { background: var(--surface-variant) center / cover no-repeat; }
.cr-swatch-plus { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--on-surface-variant); }
.cr-decor-row.cr-decor-row--wrap { flex-wrap: wrap; overflow: visible; padding: 0; margin: 0; }
.cr-crop-frame.cr-crop-frame--bg { width: 52%; margin: 0 auto; padding-top: 92.4444%; /* 9:16 */ }
/* 装扮面板压矮：下面的页面要露出一截，点了背景 / 面板透明度才看得到预览（!important：openSheet 会用 JS 给内容区写 max-height） */
.cr-decor-sheet .ui-sheet-body { max-height: 44vh !important; overflow-x: hidden; }

/* ==========================================================================
   梦钥（接口服务，2026-10-16；结构重排 2026-10-17）
   纸上养茧的签名语言在这里只用一次：卡身一道茧丝竖线（border-left 3px primary）。
   2026-10-17 结构重排（设计评审后，保纸感只修结构）：资产前置、花钱先确认、
   行级可达性（真按钮、44px 起）、暗色亮灰提亮到 AA。皮不动，全部吃设计令牌。
   兼容旧 WebView：不用 flex gap（用相邻兄弟 margin 代替）。
   ========================================================================== */
.dk-card, .dk-sheet { --dk-dim: var(--on-surface-variant); --dk-accent: var(--primary-deep); }
/* 暗色局部重映射：--on-surface-variant(#6B6F7B) 压深底只有 ~3.5:1；
   --primary-deep 只在浅色定义，暗色下描边/价格会变成两种橙（#D98A72 与 #A0573B）。 */
:root:not([data-theme="light"]) .dk-card, :root[data-theme="dark"] .dk-card,
:root:not([data-theme="light"]) .dk-sheet, :root[data-theme="dark"] .dk-sheet {
  --dk-dim: #9BA1AE;
  --dk-accent: var(--primary);
}

.dk-card { display:block; width:100%; text-align:left; cursor:pointer; font-family:inherit;
  background: linear-gradient(180deg, var(--surface), var(--surface-variant));
  border:0; border-left:3px solid var(--primary); border-radius: var(--r-card);
  padding: 14px 40px 14px 16px; position:relative; }
/* 「我的」页上引语已经用掉了茧丝竖线（契约：一屏至多一个装饰手势），
   这里的梦钥卡降成 1px 描边，不跟引语抢；并补一圈整描边，跟其它卡对齐。 */
.me-page .dk-card { border-left: 1px solid var(--outline); border-top: 1px solid var(--outline); border-right: 1px solid var(--outline); border-bottom: 1px solid var(--outline); }
.dk-card .dk-kicker { display:block; font-family: var(--font-mono); font-size:10px; letter-spacing:.14em;
  color: var(--dk-dim); text-transform:uppercase; }
.dk-card .dk-title { display:block; font-family: var(--font-display); font-size:17px; font-weight:600; color: var(--on-bg); margin-top:4px; }
.dk-card .dk-sub { display:block; font-size:12px; color: var(--dk-dim); margin-top:2px; }
.dk-card .dk-state { display:block; font-size:12px; color: var(--dk-accent); margin-top:8px; }
.dk-card .dk-chev { position:absolute; right:14px; top:50%; transform: translateY(-50%); color: var(--dk-dim); }

.dk-sheet { font-family: var(--font-sans); }
.dk-lead { font-size:13.5px; line-height:1.75; color: var(--on-surface); }
.dk-lead b { color: var(--dk-accent); font-weight:600; }

/* 栏目头（2026-10-17 评审：原来 10px 灰 mono 当栏目头，比商品按钮还小、读不出层级）：
   换成衬线大字头；mono kicker 只留给入口卡当品牌标签。间距头上 24 / 头下 10。 */
.dk-h { font-family: var(--font-display); font-size:15.5px; font-weight:600; color: var(--on-bg);
  margin:24px 0 10px; }

/* ---- 我的梦钥（资产卡） ---- */
.dk-keybox { border:1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); padding:14px 16px; }
.dk-balrow { display:flex; align-items:baseline; justify-content:space-between; }
.dk-bal b { font-family: var(--font-display); font-size:22px; color: var(--on-bg); }
.dk-bal.low b { color: var(--error); }
.dk-bal i { font-style:normal; font-size:11px; color: var(--dk-dim); margin-left:6px; }
.dk-baltimes { font-size:12px; color: var(--dk-dim); text-align:right; margin-left:10px; flex-shrink:0; }
/* 每次单价（2026-10-17 产品定版：余额正下方常驻，写成 0.0156 元/次 的精确值） */
.dk-priceline { font-size:12px; color: var(--on-surface); margin-top:6px; }
.dk-keyrow { display:flex; align-items:center; margin-top:10px; }
.dk-key { font-family: var(--font-mono); font-size:12px; color: var(--on-bg); line-height:1.7; word-break:break-all; }
.dk-keyrow .dk-key { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 打码串不可选中（2026-10-17 工单：用户长按抄「打码预览」当钥匙 → 查无此钥）。
   想要完整钥匙只有一条路：点「复制」，或点这把钥匙本身。 */
.dk-keyrow .dk-key { -webkit-user-select:none; user-select:none; cursor:pointer; }
.dk-keyhint { font-size:11.5px; color: var(--dk-dim); margin-top:6px; }
.dk-keymsg { font-size:13px; line-height:1.75; color: var(--on-surface); }
.dk-key-actions { display:flex; margin-top:14px; }
.dk-keyfoot { display:flex; align-items:center; justify-content:space-between; margin-top:6px; }
.dk-keyfoot > span { font-size:11px; color: var(--dk-dim); }
.dk-linkbtn { border:0; background:none; padding:0 0 0 12px; min-height:44px; font:inherit;
  font-size:12.5px; color: var(--dk-accent); cursor:pointer; }
.dk-btn { flex:1; min-height: var(--tap); border: 1px solid var(--primary-text); border-radius: var(--r-ctl);
  background:transparent; color: var(--dk-accent); font-size:13.5px; font-weight:600; cursor:pointer; }
.dk-btn + .dk-btn { margin-left:10px; }
.dk-btn.primary { background: var(--primary-fill); color: var(--on-primary); border-color: var(--primary-fill); }

/* ---- 充值 ---- */
.dk-packs { display:block; }
.dk-pack { display:flex; justify-content:space-between; align-items:center;
  border:1px solid var(--outline); border-radius: var(--r-card);
  background: linear-gradient(180deg, var(--surface), var(--surface-variant)); padding:14px; }
.dk-pack + .dk-pack { margin-top:10px; }
.dk-pack .info { min-width:0; }
.dk-pack .name { font-size:14px; color: var(--on-bg); font-weight:600; }
.dk-pack .desc { font-size:11px; color: var(--dk-dim); margin-top:3px; }
.dk-pack .price { text-align:right; margin-left:12px; flex:none; }
.dk-pack .price b { display:block; font-family: var(--font-display); font-size:20px; color: var(--dk-accent); }
.dk-pack .fee { font-size:11px; color: var(--dk-dim); margin:2px 0 8px; white-space:nowrap; }
.dk-buy { min-height: var(--tap); min-width:88px; padding:0 16px; border:0; border-radius: var(--r-ctl);
  background: var(--primary-fill); color: var(--on-primary); font-size:13.5px; font-weight:600; cursor:pointer; }
.dk-buy:disabled { opacity:.45; cursor:not-allowed; }
/* 梦钥套餐的人工兜底入口：单独一行贴在购买按钮下面，右对齐（2026-11-15）。
   并排时 .price 列会撑到 250px，.info 只剩四十来像素，套餐名被挤成一字一行。 */
.dk-manual { margin-top: 8px; text-align: right; }

/* ---- 支持模型（折叠 + 分组；行是按钮，点行复制英文名） ---- */
.dk-models { border:1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); overflow:hidden; }
.dk-mgroup { display:flex; justify-content:space-between; align-items:baseline; padding:10px 12px 6px;
  background: var(--surface-variant); border-top:1px solid var(--outline); font-size:12px; }
.dk-mgroup:first-child { border-top:0; }
.dk-mgroup .t { color: var(--on-surface); font-weight:600; }
.dk-mgroup .p { font-family: var(--font-mono); font-size:11.5px; color: var(--dk-accent); }
.dk-model { display:flex; width:100%; justify-content:space-between; align-items:baseline; text-align:left;
  min-height: var(--tap); padding:10px 12px; border:0; background:none; font:inherit; color:inherit; cursor:pointer; }
.dk-model + .dk-model { border-top:1px solid var(--outline); }
.dk-model:hover { background: var(--surface-variant); }
.dk-model .n { font-size:13px; color: var(--on-surface); min-width:0; }
.dk-model .id { display:block; font-family: var(--font-mono); font-size:10px; font-style:normal; color: var(--dk-dim); margin-top:3px; }
.dk-model .tr { margin-left:10px; flex-shrink:0; }
.dk-model .tr .t { font-size:11px; color: var(--dk-dim); text-align:right; }
/* 窄屏（390px 级）：模型行两行堆叠——note 不再被挤成「最轻/快」、英文名不再横折（2026-10-17 评审 P1） */
@media (max-width: 480px) {
  .dk-model { flex-direction:column; align-items:stretch; }
  .dk-model .tr { margin-left:0; }
  .dk-model .tr .t { display:block; text-align:left; margin-top:4px; }
  .dk-model .id { word-break:break-all; }
}

/* ---- 梦钥模型列表（2026-10-29：与织机同源，双筛选 + 两列卡片） ---- */
.dk-model-picker { border:1px solid var(--outline); border-radius:var(--r-card);
  background:var(--surface); padding:12px; }
.dk-model-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.dk-model-billing { display:flex; gap:6px; }
.dk-model-tab { min-height:36px; padding:0 12px; border:1px solid var(--outline);
  border-radius:999px; background:var(--surface); color:var(--on-surface); font:inherit;
  font-size:12px; cursor:pointer; }
.dk-model-tab.active { border-color:var(--primary-text); background:var(--primary-fill);
  color:var(--on-primary); }
.dk-model-searchrow { display:flex; align-items:center; flex:1; min-width:180px;
  justify-content:flex-end; margin-left:10px; }
.dk-model-search { flex:1; min-width:0; min-height:38px; border:1px solid var(--outline);
  border-radius:var(--r-ctl); background:var(--surface); color:var(--on-surface);
  font:inherit; font-size:12px; padding:0 10px; }
.dk-model-reset { min-height:38px; margin-left:6px; padding:0 10px; border:1px solid var(--outline);
  border-radius:var(--r-ctl); background:var(--surface); color:var(--dk-accent);
  font:inherit; font-size:12px; cursor:pointer; }
.dk-model-brands { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.dk-model-brand-filter { display:inline-flex; align-items:center; gap:5px; min-height:32px;
  padding:0 9px; border:1px solid var(--outline); border-radius:999px;
  background:var(--surface); color:var(--on-surface); font:inherit; font-size:11.5px; cursor:pointer; }
.dk-model-brand-filter small { color:var(--dk-dim); font-family:var(--font-mono); font-size:9.5px; }
.dk-model-brand-filter.active { border-color:var(--primary-text);
  background:var(--surface-variant); color:var(--dk-accent); }
.dk-model-meta { display:flex; justify-content:space-between; gap:10px; margin:12px 0 8px;
  color:var(--dk-dim); font-size:10.5px; }
.dk-model-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.dk-model-card { display:block; width:100%; min-width:0; padding:12px; border:1px solid var(--outline);
  border-radius:var(--r-card); background:var(--surface-variant); color:inherit;
  font:inherit; text-align:left; cursor:pointer; }
.dk-model-card[hidden] { display:none; }
.dk-model-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:7px; }
.dk-model-card-head b { min-width:0; color:var(--on-bg); font-size:13px; line-height:1.45; }
.dk-model-brand { flex-shrink:0; padding:1px 5px; border:1px solid var(--outline);
  border-radius:999px; color:var(--dk-dim); font-size:9.5px; }
.dk-model-note { display:block; margin-top:4px; color:var(--dk-dim); font-size:10.5px; }
.dk-model-id { display:block; margin-top:7px; color:var(--on-surface); font-family:var(--font-mono);
  font-size:10px; line-height:1.55; word-break:break-all; }
.dk-model-price { display:block; margin-top:9px; padding-top:8px; border-top:1px dashed var(--outline);
  color:var(--dk-accent); font-family:var(--font-mono); font-size:12px; font-weight:700; }
.dk-model-empty { margin:10px 0 2px; color:var(--dk-dim); font-size:12px; text-align:center; }
@media (max-width: 560px) {
  .dk-model-searchrow { width:100%; flex-basis:100%; margin:8px 0 0; }
  .dk-model-grid { grid-template-columns:1fr; }
  .dk-model-meta { flex-direction:column; gap:3px; }
}

/* ---- 充值记录 ---- */
.dk-orders { border:1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); overflow:hidden; }
.dk-order { display:flex; align-items:center; width:100%; text-align:left; min-height: var(--tap);
  padding:10px 12px; font:inherit; font-size:12px; color: var(--on-surface); background:none; border:0; }
.dk-order + .dk-order { border-top:1px solid var(--outline); }
.dk-order .when { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color: var(--dk-dim); }
.dk-order .amt { font-family: var(--font-mono); margin-left:10px; flex-shrink:0; }
.dk-order .st { color: var(--dk-dim); margin-left:10px; flex-shrink:0; }
.dk-order.resumable { cursor:pointer; }
.dk-order.resumable .st { color: var(--dk-accent); }

/* ---- 折叠块 / 复制行 / 小按钮 / 注释 ---- */
.dk-fold { margin-top:10px; border:1px solid var(--outline); border-radius: var(--r-card); background: var(--surface); }
.dk-fold > summary { min-height:44px; display:flex; align-items:center; padding:0 14px; font-size:13.5px; color: var(--on-surface); cursor:pointer; list-style:none; }
.dk-fold > summary::-webkit-details-marker { display:none; }
.dk-fold > summary::after { content:'展开'; margin-left:auto; font-size:12px; color: var(--dk-dim); }
.dk-fold[open] > summary::after { content:'收起'; }
.dk-fold-body { padding:0 14px 12px; }
.dk-fold-body p { font-size:12.5px; color: var(--on-surface); line-height:1.7; margin:8px 0; }
.dk-fold-body code { font-family: var(--font-mono); font-size:11.5px; background: var(--surface-variant); padding:2px 6px; border-radius:6px; word-break:break-all; }
.dk-fold-body .dk-note { font-size:11.5px; }
.dk-copyln { display:flex; align-items:center; }
.dk-copyln code { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-right:6px; }
.dk-mini { min-height: var(--tap); border:1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--on-surface); font-size:12px; padding:0 14px; cursor:pointer; margin-left:6px; flex-shrink:0; }
.dk-note { font-size:11.5px; color: var(--dk-dim); line-height:1.7; margin-top:14px; }

/* ---- 扫码付款（临时通道，2026-10-17；收款渠道维护期，pay-page.js 的面板用） ---- */
.payscan { gap: 10px; }
.payscan-head { font-weight: 600; color: var(--on-bg); margin: 0 0 2px; }
.payscan-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; line-height: 1.7; color: var(--on-surface-variant); }
.payscan-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px dashed var(--outline); border-radius: 10px; font-size: 13px; color: var(--on-surface-variant); }
.payscan-note code { font-size: 13px; color: var(--on-bg); word-break: break-all; }
.payscan-note .ad-btn { width: auto; margin: 0; padding: 0 12px; min-height: 32px; font-size: 12px; }
.payscan-qr { text-align: center; margin-top: 4px; }
.payscan-qr img { width: 100%; max-width: 300px; border-radius: 12px; border: 1px solid var(--outline); }
.payscan-qr-label { margin-top: 4px; font-size: 13px; color: var(--on-surface-variant); }

/* ---------- 麦克风自检（应用设置 → 帮助与关于） ----------
   刻意不用颜色区分对错：只用 ✓ / ✗ 加文字，色弱也能读，也不动品牌色板。 */
.mic-check-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.mic-check-row { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.6; }
.mic-check-mark { flex: none; width: 14px; font-weight: 700; color: var(--on-surface); }
.mic-check-main { flex: 1; min-width: 0; }
.mic-check-label { color: var(--on-surface); }
.mic-check-detail {
  display: block; margin-top: 1px;
  font-size: 12.5px; line-height: 1.55; color: var(--on-surface-variant); overflow-wrap: break-word;
}
.mic-check-verdict {
  font-size: 14px; line-height: 1.7; color: var(--on-surface);
  padding: 12px 14px; border-radius: 10px; background: var(--surface-variant);
}

/* ---- 「验一把」块（2026-10-19）----
   整条福利流程里唯一给「成没成」反馈的地方。视觉上要像一张表单，
   不能像又一段说明文字——否则用户不会去填。 */
.dreamgift-verify { border:1px solid var(--outline); border-radius: var(--r-card);
  background: var(--surface); padding:14px 16px; }
.dreamgift-field { display:flex; align-items:center; margin-top:10px; }
.dreamgift-field-k { flex:none; width:56px; font-size:12px; color: var(--dk-dim); }
.dreamgift-inp { flex:1; min-width:0; box-sizing:border-box; min-height: var(--tap);
  padding:0 12px; border:1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--surface-variant); color: var(--on-bg); font:inherit; font-size:13px; }
.dreamgift-inp:focus { outline:2px solid var(--primary); outline-offset:1px; }
.dreamgift-verify-actions { display:flex; margin-top:12px; }

.dreamgift-probe-slot:not(:empty) { margin-top:12px; }
.dreamgift-probe { border-radius: var(--r-card); padding:12px 14px; border:1px solid var(--outline); }
.dreamgift-probe.ok { border-left:3px solid var(--primary); background: var(--surface-variant); }
.dreamgift-probe.bad { border-left:3px solid var(--error); background: var(--surface); }
.dreamgift-probe-head { font-size:13.5px; font-weight:600; color: var(--on-bg); }
.dreamgift-probe.bad .dreamgift-probe-head { color: var(--error); }
.dreamgift-probe p { margin:8px 0 0; font-size:12.5px; line-height:1.75; color: var(--on-surface); }
.dreamgift-probe b { color: var(--on-bg); font-weight:600; }
.dreamgift-probe-hint { font-size:11.5px; color: var(--dk-dim); }
.dreamgift-probe-todo { font-size:12px; color: var(--dk-dim); }

@media (max-width: 480px) {
  .dreamgift-field-k { width:48px; font-size:11.5px; }
}

/* ---- 领取前的风险告知（2026-10-19）----
   视觉上要比福利卡「重」：这是全流程里唯一一处警告，不能被当成又一张说明卡。
   用 error 色做左侧竖条与图标，但正文保持常规前景色——通篇红字反而没人读。 */
.dreamgift-risk-banner { display:flex; align-items:flex-start; margin-bottom:10px; }
.dreamgift-risk-ico { flex:none; width:22px; height:22px; border-radius:999px; margin-right:10px;
  display:flex; align-items:center; justify-content:center;
  background: var(--error); color: var(--on-primary); font-size:14px; font-weight:700;
  font-family: var(--font-display); line-height:1; }
.dreamgift-risk-title { font-family: var(--font-display); font-size:16px; font-weight:600; color: var(--on-bg); }
.dreamgift-risk-lead { font-size:13px; line-height:1.75; color: var(--on-surface); margin:0 0 12px; }
.dreamgift-risk-lead b { color: var(--error); font-weight:600; }

.dreamgift-risk-list { border:1px solid var(--outline); border-left:3px solid var(--error);
  border-radius: var(--r-card); background: var(--surface); overflow:hidden; }
.dreamgift-risk-item { display:flex; padding:12px 14px; }
.dreamgift-risk-item + .dreamgift-risk-item { border-top:1px solid var(--outline); }
/* 标签列：「后果·服务商」这类 6 字标签必须一行放得下，
   否则会断成「后果·服务／商」——中文在没有 break-all 时按词断，宽度给不够就会裂。 */
.dreamgift-risk-k { flex:none; width:84px; font-size:12px; font-weight:600; color: var(--error);
  line-height:1.7; white-space:nowrap; }
.dreamgift-risk-t { flex:1; min-width:0; font-size:12.5px; line-height:1.75; color: var(--on-surface); }
.dreamgift-risk-t b { color: var(--on-bg); font-weight:600; }

.dreamgift-risk-foot { font-size:12px; line-height:1.7; color: var(--dk-dim); margin:14px 0 0;
  padding:10px 12px; border-radius:8px; background: var(--surface-variant); }

/* 底部操作条：告知要读，但不该逼人滚到底才点得到 */
.dreamgift-risk-actions { display:flex; margin-top:16px; padding-top:14px;
  border-top:1px solid var(--outline); }
.dreamgift-risk-actions .dk-btn { flex:1; }
.dreamgift-risk-actions .dk-btn + .dk-btn { margin-left:10px; }

@media (max-width: 480px) {
  .dreamgift-risk-k { width:78px; font-size:11.5px; }
}

/* ---- 会员福利 · 免费 API（2026-10-19）----
   梦钥弹层顶部的一张卡 + 梦钥入口卡下的一行小字。
   视觉语言沿用梦钥（纸面渐变 + 茧丝左边线），但把边线换成暖金：
   它是「白送的东西」，不该和「按次购买」的梦钥长得一模一样。
   兼容旧 WebView：不用 flex gap，相邻兄弟 margin 代替。 */
.dreamgift-card { border:1px solid var(--outline); border-left:3px solid var(--primary);
  border-radius: var(--r-card); padding:14px 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-variant));
  /* 显式 left：2026-10-19 两次线上事故都是「继承到别人的 text-align:center」，
     内容被居中看着像布局坏了。这里写死不继承，守卫也盯着这条。 */
  text-align:left; }
.dreamgift-card-head { display:flex; align-items:center; justify-content:space-between; }
.dreamgift-card-kicker { font-family: var(--font-mono); font-size:10px; letter-spacing:.14em;
  color: var(--dk-dim); text-transform:uppercase; }
.dreamgift-card-tag { font-size:10.5px; padding:2px 8px; border-radius:999px;
  background: var(--primary-fill); color: var(--on-primary); flex-shrink:0; margin-left:8px; }
.dreamgift-card.locked .dreamgift-card-tag { background: var(--surface-variant); color: var(--dk-dim); }
.dreamgift-card-title { font-family: var(--font-display); font-size:16px; font-weight:600;
  color: var(--on-bg); margin-top:6px; }
.dreamgift-card-sub { font-size:12px; line-height:1.7; color: var(--dk-dim); margin-top:4px; }
.dreamgift-card-models { margin-top:8px; }
.dreamgift-card-models code { display:inline-block; font-family: var(--font-mono); font-size:10.5px;
  color: var(--dk-dim); background: var(--surface); border:1px solid var(--outline);
  padding:2px 7px; border-radius:6px; margin:4px 6px 0 0; }
/* 两个按钮并排、主次分明：主按钮实心、次按钮描边。
   注意 .dk-btn 默认 flex:1——同一行里两个都 flex:1 会等宽铺满，
   这里显式给主按钮更大的比重，次级按钮按内容宽度。
   ⚠️ 容器必须 box-sizing:border-box 且不溢出：两个按钮都有 1px 边框，
   早先窄屏下「查看教程」右边框被卡片内边距吃掉（截图里描边缺一条边）。 */
.dreamgift-card-actions { display:flex; box-sizing:border-box; margin-top:12px; }
.dreamgift-card-actions .dk-btn { flex:0 1 auto; box-sizing:border-box; min-width:0; padding:0 16px; }
.dreamgift-card-actions .dk-btn.primary { flex:1 1 auto; }
.dreamgift-card-actions.tight { margin-top:14px; }

/* 非会员态：整卡压暗一档，但文字仍达 AA（不是「灰到看不见」，是「看得见但要解锁」） */
.dreamgift-card.locked { background: var(--surface); }
.dreamgift-card.locked .dreamgift-card-title { color: var(--on-surface); }

/* 梦钥入口卡下面那行小字（在「我的」页，非会员也看得到） */
.dk-gifttip { display:flex; align-items:center; margin-top:8px; padding-top:8px;
  border-top:1px dashed var(--outline); font-size:11.5px; color: var(--dk-accent); }
.dk-gifttip > span:last-child { margin-left:6px; min-width:0; }
.dk-card .dk-gifttip { color: var(--primary-deep); }
:root:not([data-theme="light"]) .dk-card .dk-gifttip,
:root[data-theme="dark"] .dk-card .dk-gifttip { color: var(--primary); }

/* ---- 教程弹层 ---- */
.dreamgift-sheet .dk-h:first-of-type { margin-top:18px; }
.dreamgift-lockrow { display:flex; align-items:center; justify-content:space-between;
  margin-top:12px; padding:10px 12px; border:1px dashed var(--outline); border-radius: var(--r-card);
  font-size:12.5px; color: var(--dk-dim); }
.dreamgift-lockrow .dk-linkbtn { padding-left:8px; }

.dreamgift-steps { border:1px solid var(--outline); border-radius: var(--r-card);
  background: var(--surface); overflow:hidden; }
.dreamgift-step { display:flex; padding:12px 14px; }
.dreamgift-step + .dreamgift-step { border-top:1px solid var(--outline); }
.dreamgift-step-n { flex-shrink:0; font-family: var(--font-display); font-size:15px;
  color: var(--dk-accent); width:26px; line-height:1.5; }
.dreamgift-step-body { min-width:0; }
.dreamgift-step-t { font-size:13.5px; font-weight:600; color: var(--on-bg); }
.dreamgift-step-d { font-size:12.5px; line-height:1.7; color: var(--on-surface); margin:4px 0 0; }

.dreamgift-copyrow { display:flex; align-items:center; margin-top:10px; }
.dreamgift-copyrow-k { flex-shrink:0; font-size:11.5px; color: var(--dk-dim); width:56px; }
.dreamgift-copyrow code { flex:1; min-width:0; font-family: var(--font-mono); font-size:11.5px;
  color: var(--on-bg); background: var(--surface-variant); padding:8px 10px; border-radius:8px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 遮罩值（2026-10-19）：接口地址与模型名不印真名，只留「点复制」。
   视觉上要让人一眼看出「这不是完整内容」，否则用户会拿它当值抄。 */
.dreamgift-copyrow code.dreamgift-masked { color: var(--dk-dim); letter-spacing:.08em;
  -webkit-user-select:none; user-select:none; }

.dreamgift-notes { border:1px solid var(--outline); border-radius: var(--r-card);
  background: var(--surface); overflow:hidden; }
.dreamgift-note { display:flex; padding:10px 14px; }
.dreamgift-note + .dreamgift-note { border-top:1px solid var(--outline); }
.dreamgift-note-k { flex-shrink:0; width:44px; font-size:11.5px; font-weight:600; color: var(--dk-accent); }
.dreamgift-note-t { flex:1; min-width:0; font-size:12px; line-height:1.7; color: var(--on-surface); }

/* 窄屏也不竖排：两张按钮并排仍放得下（主按钮「去注册领取」5 字 + 「查看教程」4 字），
   竖排会把福利卡顶到半屏高，把下面的「我的梦钥」挤出首屏。只把内边距收一点。
   ⚠️ 内边距不能压到 10px 以下：次级按钮按内容定宽，10px 时文字会贴住右边框（4x 截图实锤）。 */
@media (max-width: 480px) {
  .dreamgift-card-actions .dk-btn { padding-left:12px; padding-right:12px; font-size:13px; }
  .dreamgift-card-actions .dk-btn + .dk-btn { margin-left:8px; }
  .dreamgift-copyrow-k { width:48px; }
}

/* ==========================================================================
   仅悬停指针（鼠标 / 触控板）：悬停反馈
   大屏骨架（≥768px 两栏）现在按宽度生效，触屏大屏（iPad）也会拿到它。
   :hover 在这些设备上「点一下就一直亮着」，所以只给真有指针悬停能力的设备。
   2026-10-19 从大屏骨架块里拆出来，规则本身没改。
   ========================================================================== */
@media (hover: hover) {
  .nav-btn:hover { background: var(--surface-variant); }
  .hl-recent:hover { background: var(--surface-variant); }
  .dream-book-card:hover { border-color: var(--primary); }
  .wd-door:hover { filter: brightness(1.06); }
  .sheet-btn:hover { background: var(--surface-variant); }
}

/* 2026-10-19：社区发帖额度提示（并发协作者批次，随会员档位上线）
   本行由 member-gift 批次补回——发版前核对线上/本地差异时发现只差这一条，
   补进本地再发，避免我的 CSS 覆盖把它冲掉。 */
.cm-quota-hint { font-size: 12px; color: var(--primary); font-weight: 600; }

/* ---------- 免费模型通道选择（2026-10-21 晚改版，profile.js openTrialPicker）----------
   手机：底部升起的弹层，头部 / 底栏固定、只滚中间（以前居中小窗放不下 7 张卡，「完成」被截在外面）。
   宽屏（≥600px）：仍居中，宽 440。结构沿用 .modal-overlay > .modal-card，守卫按这些类名找元素。 */
.tp-overlay { align-items: flex-end; padding: 0; }
.modal-card.tp-sheet {
  max-width: 520px; padding: 0;
  display: flex; flex-direction: column;
  max-height: 88vh; max-height: min(88vh, 88dvh);
  overflow: hidden;
  border-radius: 20px 20px 0 0; border-bottom: 0;
  animation: sheet-up .24s cubic-bezier(.2, .9, .3, 1);
}
.tp-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--outline); margin: 8px auto 0; flex: none; }
.tp-head { flex: none; padding: 10px 20px 10px; }
.tp-head .modal-title { margin-bottom: 2px; font-size: 18px; }
.tp-head-sub { margin: 0; font-size: 12px; color: var(--on-surface-variant); }
.tp-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 16px 14px;
}
.tp-body > * { flex-shrink: 0; }
.tp-foot {
  flex: none; margin: 0;
  padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline); background: var(--bg);
}
.tp-done { width: 100%; font-weight: 600; }
@media (min-width: 600px) {
  .tp-overlay { align-items: center; padding: 24px; }
  .modal-card.tp-sheet { max-width: 440px; border-radius: 18px; border-bottom: 1px solid var(--outline); animation: modal-pop .2s cubic-bezier(.2, .9, .3, 1); }
  .tp-grip { display: none; }
  .tp-head { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { .modal-card.tp-sheet { animation: none; } }

/* 顶部「正在使用」 */
.tp-now {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(204, 120, 92, .14), rgba(204, 120, 92, .04));
  border: 1px solid rgba(204, 120, 92, .28);
}
.tp-now-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--primary-text);
}
.tp-now-main { display: flex; flex-direction: column; min-width: 0; }
.tp-now-k { font-size: 11px; color: var(--on-surface-variant); letter-spacing: .3px; }
.tp-now-v { font-size: 15px; font-weight: 600; color: var(--on-bg); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-warn {
  font-size: 12px; line-height: 1.6; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-variant); color: var(--on-surface);
}
.tp-event {
  padding: 14px;
  border: 1px solid var(--outline);
  border-color: color-mix(in srgb, var(--tertiary) 38%, var(--outline));
  border-radius: 16px;
  background: var(--surface);
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--tertiary) 16%, transparent), transparent 42%),
    var(--surface);
}
.tp-event-head { display: flex; flex-direction: column; gap: 4px; }
.tp-event-kicker {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10.5px; line-height: 1.4; color: var(--on-surface-variant);
}
.tp-event-state {
  display: inline-flex; align-items: center; min-height: 20px; padding: 1px 7px;
  border-radius: 999px; background: var(--tertiary); color: var(--bg);
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.tp-event-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  line-height: 1.35; color: var(--on-bg);
}
.tp-event-rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tp-event-rules span {
  padding: 4px 8px; border-radius: 999px; background: var(--surface-variant);
  color: var(--on-surface); font-size: 11px; line-height: 1.35;
}
.tp-event-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--outline);
  font-size: 11px; line-height: 1.55; color: var(--on-surface-variant);
}
.tp-event-foot strong { flex: none; color: var(--primary-text); font-size: 12px; }
.tp-event-foot span { text-align: right; }
.tp-sec {
  font-size: 12px; font-weight: 600; color: var(--on-surface-variant);
  letter-spacing: .5px; margin: 6px 4px -2px;
}

/* 通道卡：外框在 .tp-item 上，选中时型号区在同一个框里 */
.tp-item {
  border: 1px solid var(--outline); border-radius: 16px;
  background: var(--surface); overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tp-item.is-on {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset, 0 6px 18px rgba(204, 120, 92, .12);
}
.tp-item.is-locked { background: transparent; border-style: dashed; }
/* 「即将开放」占位卡（2026-11-08）：高级模型还没接通后端时的形态。
   与「会员专属」区分：那个是"你没买"，这个是"还没开"，用中性灰而不是强调色，
   也不套 dashed 边框（dashed 在这个界面里已经承载"锁住"的语义，复用会混淆）。 */
.tp-item.is-soon { background: var(--surface); border-style: solid; opacity: .78; }
.tp-item.is-soon .tp-icon,
.tp-item.is-soon .feat-title { opacity: .7; }
.tp-item.is-soon .tp-sub { opacity: .75; }


.tp-item .tp-card {
  border: 0; border-radius: 0; background: transparent;
  padding: 13px 14px; gap: 12px; align-items: flex-start; cursor: pointer;
}
.tp-item .tp-card:hover { box-shadow: none; transform: none; }
/* 高级模型的余额块是 .tp-item 的直接子元素（不在 .tp-card 里）：
   卡片本身 padding 13px 14px，这里对齐同一套边距，视觉上仍像卡片的一部分。 */
.tp-item > .tp-premium { margin: 0 14px 13px; }
.tp-item.is-on > .tp-premium { border-color: rgba(93, 184, 166, .38); }

.tp-item.is-locked .tp-card { cursor: default; }
.tp-item.is-locked .tp-icon, .tp-item.is-locked .feat-title, .tp-item.is-locked .tp-sub { opacity: .55; }
.tp-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); margin-top: 1px; }
.tp-logo { width: 22px; height: 22px; object-fit: contain; display: block; }
.tp-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tp-card .feat-title { font-size: 15px; }
.tp-card .tp-sub { display: block; white-space: normal; line-height: 1.5; }
.tp-tag {
  font-size: 10px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 999px;
  letter-spacing: .3px;
}
.tp-tag--member { color: #9A6B12; background: rgba(214, 164, 64, .18); }
.tp-tag--promo { color: var(--tertiary); background: rgba(93, 184, 166, .16); }
.tp-tag--tuned { display: inline-flex; align-items: center; color: var(--primary-text); background: var(--surface-variant); border: 1px solid var(--outline); white-space: nowrap; }
.tp-now-v .tp-tag--tuned { margin-left: 6px; vertical-align: middle; }
.tp-tag--freeform { color: var(--primary-text); background: var(--bg); border: 1px solid var(--outline); white-space: nowrap; }

.modal-card.tp-sheet { width: 100%; height: 94vh; height: 94dvh; max-height: 94vh; max-height: 94dvh; }
.modal-card.tp-sheet:focus { outline: none; }
.tp-sheet .tp-head { padding: 18px 20px 12px; }
.tp-sheet .tp-head .modal-title { font-size: 22px; line-height: 1.4; }
.tp-summary { flex: none; padding: 0 20px; }
.tp-summary .tp-now { padding: 8px 0 14px; gap: 10px; border: 0; border-radius: 0; background: none; }
.tp-summary .tp-now-icon { width: 30px; height: 30px; background: var(--surface-variant); }
.tp-summary .tp-now-v { font-size: 13px; line-height: 1.6; white-space: normal; }
.tp-summary .tp-warn { margin-bottom: 10px; }
.tp-free-filter-box { flex: none; margin: 0 20px; border-top: 1px solid var(--outline); }
.tp-free-filter { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 60px; padding: 10px 0; border: 0; background: none; color: var(--on-bg); font: inherit; text-align: left; cursor: pointer; }
.tp-free-filter-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tp-free-filter-title { font-size: 14px; line-height: 1.5; font-weight: 600; }
.tp-free-filter-hint { color: var(--on-surface); font-size: 12px; line-height: 1.5; }
.tp-free-filter .switch { flex: none; }
.tp-free-filter:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; border-radius: var(--r-ctl); }
.tp-free-filter-clear { margin-top: 12px; }
/* 稳定通道开关条（2026-11-13）：头部下的一条细行，整行可点。状态只靠标题变色 +
   「正在使用」卡说话，不写说明长文 —— 卡片是单列列表，矮屏上多一行就要多滚。 */
.tp-stable { flex: none; padding: 0 20px; border-bottom: 1px solid var(--outline); }
.tp-stable-row { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 42px; padding: 5px 0; border: 0; background: none; color: var(--on-bg); text-align: left; cursor: pointer; }
.tp-stable-title { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 600; color: var(--on-bg); white-space: nowrap; }
.tp-stable-row.is-on .tp-stable-title { color: var(--primary-text); }
.tp-stable-tag { font-size: 10px; font-weight: 500; line-height: 1; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--outline); color: var(--on-surface-variant); }
.tp-stable-row.is-on .tp-stable-tag { color: var(--primary-text); border-color: var(--primary-fill); }
.tp-stable-sub { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; font-size: 11px; color: var(--on-surface-variant); }
.tp-stable-row .switch { flex: none; }
.tp-tabs { display: flex; flex: none; gap: 24px; margin: 0 20px; border-bottom: 1px solid var(--outline); }
.tp-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 46px; padding: 10px 0; border: 0; background: none; color: var(--on-surface-variant); font-size: 14px; cursor: pointer; }
.tp-tab[aria-selected="true"] { color: var(--primary-text); font-weight: 600; }
.tp-tab[aria-selected="true"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--primary-fill); border-radius: 2px; }
.tp-tab-count { font-size: 10px; font-weight: 500; color: var(--on-surface-variant); }
.tp-tab:focus-visible, .tp-family-toggle:focus-visible, .tp-unavailable-toggle:focus-visible { outline: 2px solid var(--primary-text); outline-offset: -2px; border-radius: var(--r-ctl); }
.tp-sheet .tp-body { padding: 14px 20px 12px; gap: 0; }
.tp-catalog-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--on-surface-variant); font-size: 11px; padding: 4px 0 12px; }
.tp-catalog-intro > :last-child { white-space: nowrap; }
.tp-premium-family .tp-card { align-items: center; min-height: 54px; }
.tp-premium-family .tp-mark { height: auto; }
.tp-premium-family .tp-premium-model .tp-sub { display: none; }
.tp-premium-model .tp-note--lock { display: none; }
.tp-premium-model.is-soon { opacity: 1; }
.tp-premium-model.is-soon .feat-title { opacity: .8; }
.tp-premium-model.is-soon .tp-icon { opacity: 1; }
.tp-body > .tp-premium { margin: 0 0 14px; }
/* Kimi 的单色品牌资产在深色背景反白，其余品牌保留原色。 */
:root[data-theme="dark"] .tp-logo--monochrome { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-logo--monochrome { filter: invert(1); }
}
.tp-family { border-bottom: 1px solid var(--outline); }
/* 稳定通道顶栏（2026-11-14 用户给的样式）：只用 .tp-stable-row 那一套，不额外加布局。 */
.tp-family-toggle { display: flex; width: 100%; min-height: 78px; align-items: center; gap: 12px; padding: 16px 0; background: none; color: var(--on-bg); border: 0; text-align: left; cursor: pointer; }
.tp-family-toggle:hover { background: var(--surface); }
.tp-family-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--primary-text); background: var(--surface-variant); }
.tp-family-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tp-family-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 600; line-height: 1.4; }
.tp-family-description { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--on-surface-variant); font-size: 11px; line-height: 1.6; }
.tp-family-current { font-size: 10px; font-weight: 500; color: var(--primary-text); }
.tp-family-meta { display: flex; align-items: center; gap: 8px; color: var(--on-surface-variant); flex: none; }
.tp-family-count { font-size: 11px; white-space: nowrap; }
.tp-family-chevron { transform: rotate(90deg); }
.tp-family.is-expanded .tp-family-chevron { transform: rotate(-90deg); }
.tp-unavailable-toggle[aria-expanded="true"] .tp-unavailable-chevron { transform: rotate(90deg); }
.tp-family.is-expanded { margin: 4px 0 8px; border: 1px solid var(--outline); border-radius: 16px; background: var(--surface); }
.tp-family.is-expanded .tp-family-toggle { padding: 14px 12px; }
.tp-family.is-expanded .tp-family-toggle:hover { background: none; }
.tp-family-detail { padding: 0 12px; }
.tp-family-costs { margin: 0; padding: 0 0 10px; font-size: 11px; line-height: 1.6; color: var(--on-surface-variant); }
.tp-family-detail .tp-item { border: 0; border-top: 1px solid var(--outline); border-radius: 0; background: none; box-shadow: none; }
.tp-family-detail .tp-item .tp-card { padding: 12px 0; gap: 8px; }
.tp-family-detail .tp-icon { display: none; }
.tp-family-detail .tp-mark { height: 24px; align-self: center; }
.tp-family-detail .tp-title-row { gap: 8px; }
.tp-family-detail .tp-card .feat-title { font-size: 13px; }
.tp-family-detail .tp-card .tp-sub { font-size: 11px; }
.tp-family-detail .tp-models { padding: 0 0 14px; }
.tp-family-detail .tp-models-label { display: none; }
.tp-family-detail .tp-chip { min-height: 38px; font-size: 12px; }
.tp-family-detail .tp-chip.is-on { color: var(--on-primary); background: var(--primary-fill); border-color: var(--primary-fill); }
.tp-family-detail .tp-item > .tp-premium { margin: 0 0 14px; }
.tp-family-detail .tp-premium-hint { color: var(--on-surface); }
.tp-billing { color: var(--on-surface-variant); font-size: 10px; line-height: 1.5; font-weight: 500; }
.tp-billing--paid { color: var(--primary-text); }
.tp-unavailable { margin-top: 18px; border-top: 1px solid var(--outline); }
.tp-unavailable-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 12px 0; border: 0; background: none; color: var(--on-surface-variant); font-size: 12px; text-align: left; cursor: pointer; }
.tp-unavailable-toggle > :last-child { margin-left: auto; }
.tp-unavailable .tp-item { margin: 0 0 8px; }
.tp-catalog-empty { padding: 44px 12px; text-align: center; font-size: 14px; color: var(--on-surface); }
.tp-catalog-empty p { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: var(--on-surface-variant); }
.tp-body > .tp-hint { margin: 18px 0 6px; }
.tp-body > .tp-event { margin-bottom: 14px; }
.tp-body > .tp-item { margin-bottom: 12px; }
.tp-family-detail[hidden], .tp-unavailable [hidden] { display: none; }

/* HY3推广额度：选用与邀请分开，保留家族列表的纸感层级。 */
.tp-item--hy3 .tp-card .tp-sub { color: var(--on-surface); }
.tp-hy3 { padding: 0 0 12px; color: var(--on-bg); }
.tp-hy3-balance { display: flex; align-items: baseline; justify-content: space-between; }
.tp-hy3-label { flex: none; margin-right: 12px; font-size: 12px; color: var(--on-surface); }
.tp-hy3-value { min-width: 0; font-family: var(--font-display); font-size: 25px; line-height: 1.35; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; word-wrap: break-word; }
.tp-hy3-total { font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--on-surface); }
.tp-hy3-meter { height: 3px; margin: 10px 0; overflow: hidden; border-radius: 2px; background: var(--outline); }
.tp-hy3-meter-fill { display: block; height: 100%; background: var(--primary-text); }
.tp-hy3-sources { display: grid; grid-template-columns: 1fr auto 1fr; grid-column-gap: 12px; font-size: 12px; line-height: 1.7; color: var(--on-surface); }
.tp-hy3-sources > :last-child { text-align: right; }
.tp-hy3-sources strong { color: var(--on-bg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-hy3-source-plus { color: var(--on-surface); }
.tp-hy3-reset { margin: 5px 0 0; font-size: 11px; line-height: 1.6; color: var(--on-surface); }
.tp-hy3-invite { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--outline); }
.tp-hy3-invite-copy { min-width: 0; margin: 0 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--on-bg); }
.tp-hy3-invite-copy > span { display: block; font-size: 11px; color: var(--on-surface); }
.tp-hy3-link { display: inline-flex; flex: none; align-items: center; justify-content: center; min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--primary-text); font-family: inherit; font-size: 12px; line-height: 1.5; text-align: left; cursor: pointer; }
.tp-hy3-link > svg { margin-left: 5px; }
.tp-hy3-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tp-hy3-link:disabled { cursor: wait; color: var(--on-surface); }
.tp-hy3-rules { color: var(--on-surface); font-size: 11px; line-height: 1.7; }
.tp-hy3-rules > summary { display: flex; align-items: center; min-height: 44px; width: fit-content; cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.tp-hy3-rules > summary::-webkit-details-marker { display: none; }
.tp-hy3-rules > p { margin: 0; padding: 0 0 8px; }
.tp-hy3-message { margin: 8px 0 0; color: var(--on-surface); font-size: 12px; line-height: 1.7; }
.tp-hy3-message--empty { color: var(--primary-text); }
.tp-hy3--empty .tp-hy3-value { color: var(--primary-text); }
.tp-hy3--member .tp-hy3-value, .tp-hy3--unknown .tp-hy3-value, .tp-hy3--unavailable .tp-hy3-value { font-family: var(--font-sans); font-size: 18px; }
@media (max-width: 360px) {
  .tp-hy3-value { font-size: 22px; }
  .tp-hy3-invite { align-items: flex-start; flex-direction: column; }
  .tp-hy3-invite-copy { margin-right: 0; }
}
@media (min-width: 600px) {
  .modal-card.tp-sheet { max-width: 580px; height: min(88vh, 820px); height: min(88dvh, 820px); max-height: 88vh; max-height: 88dvh; }
  .tp-sheet .tp-head { padding: 24px 24px 12px; }
  .tp-summary { padding: 0 24px; }
  .tp-tabs { margin: 0 24px; }
  .tp-sheet .tp-body { padding: 16px 24px; }
}
@media (max-height: 520px) {
  .modal-card.tp-sheet { height: 98vh; height: 98dvh; max-height: 98vh; max-height: 98dvh; }
  .tp-sheet .tp-head { padding-top: 8px; padding-bottom: 4px; }
  .tp-sheet .tp-head .modal-title { font-size: 18px; }
  .tp-summary .tp-now { padding: 4px 0 8px; }
  .tp-family-toggle { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
}
/* 通道可用率（2026-10-27）：标题行最右侧的「● 99.2%」。
   刻意压成一行、不换行、不加高度——卡片是单列列表，矮屏上多一行就要多滚。
   颜色走语义令牌：正常 teal / 波动琥珀 / 不稳 error；点一下把三档念出来（见 profile.js）。 */
.tp-health {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  padding-left: 4px; font-size: 11px; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
  color: var(--on-surface-variant);
}
.tp-health::before {
  content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
/* 锁定卡（会员专属/待解锁）：跟着标题一起压暗，别把视线吸到一张点不了的卡上 */
.tp-item.is-locked .tp-health { opacity: .55; }
.tp-health--ok { color: var(--tertiary); }
.tp-health--warn { color: #B8801F; }
.tp-health--bad { color: var(--error); }
.tp-health--unknown { cursor: default; }
/* 深色下琥珀要提亮，否则压深底几乎看不见（同 .tp-tag--member 的处理） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-health--warn { color: #E0B455; }
}
:root[data-theme="dark"] .tp-health--warn { color: #E0B455; }
/* 高级模型卡（2026-11-08）：余额 + 价位 + 去兑换。
   放在 .tp-note 旁边，因为它们是同一种东西——卡片里的小字说明。
   空余额用偏暖的底色提示「这里缺点东西」，但不用红色：红色会被读成「你被封了」。 */
.tp-premium {
  margin-top: 8px; padding: 9px 11px;
  border-radius: 10px;
  background: rgba(93, 184, 166, .08);
  border: 1px solid rgba(93, 184, 166, .22);
}
.tp-premium--empty {
  background: rgba(214, 164, 64, .10);
  border-color: rgba(214, 164, 64, .30);
}
.tp-premium-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tp-premium-label { font-size: 11px; color: var(--on-surface-variant); letter-spacing: .04em; }
.tp-premium-credits {
  font-size: 16px; font-weight: 600; color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}
.tp-premium--empty .tp-premium-credits { color: #9A6B12; }
.tp-premium-hint {
  margin-top: 5px; font-size: 11px; line-height: 1.55;
  color: var(--on-surface-variant);
}
.tp-usage-examples {
  width: 100%; margin-top: 9px; border-collapse: collapse; table-layout: fixed;
  color: var(--on-surface); font-size: 12px; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.tp-usage-examples th, .tp-usage-examples td { padding: 5px 4px; text-align: right; white-space: nowrap; font-weight: 400; }
.tp-usage-examples th:first-child { text-align: left; }
.tp-usage-examples thead { color: var(--on-surface-variant); border-bottom: 1px solid var(--outline); }
.tp-usage-examples [data-price-tier="member"] { color: var(--primary-text); }
.tp-usage-examples [data-price-tier="member"] th, .tp-usage-examples [data-price-tier="member"] td { font-weight: 600; }
.tp-premium-model > .tp-usage-examples { width: calc(100% - 28px); margin: 0 14px 12px; }
.tp-usage-note { margin-top: 5px; color: var(--on-surface); font-size: 11px; line-height: 1.6; }
.tp-usage-note--catalog { margin: -5px 2px 12px; }
.tp-premium .eco-btn { margin-top: 8px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-premium--empty .tp-premium-credits { color: #E0B455; }
}
:root[data-theme="dark"] .tp-premium--empty .tp-premium-credits { color: #E0B455; }

.tp-note { display: block; font-size: 11px; line-height: 1.55; margin-top: 4px; color: var(--on-surface-variant); }
.tp-note--lock { color: var(--primary-text); opacity: .9; }
.tp-mark { flex: none; display: flex; align-items: center; height: 40px; }
.tp-radio {
  width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--outline); background: var(--bg);
  transition: border-color .15s ease, border-width .15s ease;
}
.tp-radio.is-on { border: 6px solid var(--primary); }

/* 型号区（选中卡内） */
.tp-models { padding: 0 14px 13px 66px; }
.tp-models-label { font-size: 11px; color: var(--on-surface-variant); margin: 0 0 7px; letter-spacing: .3px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; line-height: 1.2;
  border: 1px solid var(--outline); background: var(--bg); color: var(--on-surface);
  cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tp-chip.is-on { border-color: var(--primary); background: var(--primary); color: var(--on-primary); font-weight: 600; }
.tp-chip.is-locked { opacity: .55; cursor: not-allowed; }
.tp-chip-tag { font-size: 10px; padding: 2px 5px; border-radius: 999px; color: #9A6B12; background: rgba(214, 164, 64, .18); }
.tp-chip.is-on .tp-chip-tag { color: inherit; background: rgba(255, 255, 255, .22); }
.tp-chip.is-on .tp-health { color: inherit; }
.tp-chip--stat { cursor: default; }
.tp-models .tp-note { margin-top: 8px; }
.tp-hint { font-size: 11.5px; line-height: 1.7; text-align: center; color: var(--on-surface-variant); margin-top: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-tag--member,
  :root:not([data-theme="light"]) .tp-chip-tag { color: #E8C277; background: rgba(214, 164, 64, .16); }
  :root:not([data-theme="light"]) .tp-icon,
  :root:not([data-theme="light"]) .tp-now-icon { background: rgba(255, 255, 255, .06); }
}
:root[data-theme="dark"] .tp-tag--member,
:root[data-theme="dark"] .tp-chip-tag { color: #E8C277; background: rgba(214, 164, 64, .16); }
:root[data-theme="dark"] .tp-icon,
:root[data-theme="dark"] .tp-now-icon { background: rgba(255, 255, 255, .06); }

/* ---------- 角色卷宗列表（目录页 · 2026-10-23 重构） ----------
   以前每行右侧挤三枚 chip（置顶/重命名/🗑），标题只剩一半宽、长标题直接被截断；
   现在收成一个「⋯」按钮 + 一行「最后一句」预览，横向空间还给了标题。
   行本体沿用 ui-kit 的 .ui-row 家族（跟「我的」页同一套设计语言）。 */
.conv-char { display: flex; gap: 12px; align-items: center; }
/* 人设只给两行：以前整段铺开，把下面的卷宗列表挤出屏幕 */
.conv-char-desc {
  font-size: 12px; color: var(--on-surface-variant); margin-top: 3px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.conv-search-wrap { position: relative; }
.conv-search { min-height: 42px; border-radius: 999px; padding: 0 40px 0 38px; }
.conv-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--on-surface-variant); pointer-events: none; display: flex;
}
.conv-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 50%; background: none;
  color: var(--on-surface-variant); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.conv-search-clear:active { background: var(--surface-variant); }
.conv-row { cursor: default; }
/* 卷号徽标：卷号是**故事顺序**、列表是**最近活跃**，两个方向天然相反，
   所以做成安静的徽标，不让它读起来像「第几位」 */
.conv-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--r-ctl);
  background: var(--surface-variant); color: var(--on-surface-variant);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.conv-num.is-pinned { color: var(--primary-text); }
.conv-main { cursor: pointer; }
.conv-row .ui-row-sub { min-height: 17px; }
.conv-more {
  flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: none; color: var(--on-surface-variant);
  display: flex; align-items: center; justify-content: center;
}
.conv-more:active { background: var(--surface-variant); }
.conv-actions { display: flex; gap: 10px; }
.conv-actions .btn { flex: 1; }
.conv-hint { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; margin: 0 2px; }
.conv-line-head {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.conv-line-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-line-state {
  flex: none; margin-left: auto; color: var(--primary-text);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0;
}
.conv-line-main-btn {
  flex: none; min-height: 30px; margin-left: auto; padding: 4px 10px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface); color: var(--primary-text);
  font: inherit; font-size: 11px; letter-spacing: 0; cursor: pointer;
}
.conv-line-main-btn:active { background: var(--surface-variant); }
.conv-line-main-btn:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* ---------- 创作者段位（2026-10-25）---------- */
.tier-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
/* 灼光 / 曜光（2026-10-26 加的两档）单独取色：公告栏那四个颜色是给通知用的语义色，
   再挪用会让「紫色的通知」和「曜光段位」撞脸。取色规则跟那里一致：
   文字够深、底色是同色低透明度、描边居中。 */
:root {
  --tier-blaze: #B3462F; --tier-blaze-bg: rgba(205, 90, 55, 0.13); --tier-blaze-bd: rgba(179, 70, 47, 0.34);
  --tier-radiant: #6D4AA8; --tier-radiant-bg: rgba(122, 79, 168, 0.12); --tier-radiant-bd: rgba(122, 79, 168, 0.32);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="huiming"]):not([data-theme="sakura"]) {
    --tier-blaze: #E8735A; --tier-blaze-bg: rgba(232, 115, 90, 0.15); --tier-blaze-bd: rgba(232, 115, 90, 0.38);
    --tier-radiant: #B592E0; --tier-radiant-bg: rgba(181, 146, 224, 0.16); --tier-radiant-bd: rgba(181, 146, 224, 0.38);
  }
}
:root[data-theme="dark"] {
  --tier-blaze: #E8735A; --tier-blaze-bg: rgba(232, 115, 90, 0.15); --tier-blaze-bd: rgba(232, 115, 90, 0.38);
  --tier-radiant: #B592E0; --tier-radiant-bg: rgba(181, 146, 224, 0.16); --tier-radiant-bd: rgba(181, 146, 224, 0.38);
}
.tier-shine { color: var(--nt-news); background: var(--nt-news-bg); }
.tier-glow { color: var(--nt-warn); background: var(--nt-warn-bg); }
.tier-blaze { color: var(--tier-blaze); background: var(--tier-blaze-bg); }
.tier-radiant { color: var(--tier-radiant); background: var(--tier-radiant-bg); }
.cr-tier-slot:empty { display: none; }
.cr-tier-slot { display: inline-block; margin-left: 8px; vertical-align: middle; }

/* 「我的」页的段位卡（点进去是段位页） */
.tier-card { margin: 0 0 14px; }
.tier-card-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-card); text-align: left; cursor: pointer; }
.tier-card-main:active { background: var(--surface-variant); }
/* 段位页 / 段位卡上的头像：圆 + 段位色描边（2026-10-25 用户定：用本人头像，不用段位首字）。
   为什么换：一个汉字放进圆里太像「头像没加载出来」（用户提的）；头像更有归属感，
   段位名就写在下面，信息不丢。没头像时 avatarNode 会退回昵称首字 + 固定配色。 */
.tier-av { flex-shrink: 0; border-radius: 50%; background-size: cover; background-position: center; box-sizing: border-box; }
.tier-av-sm { width: 34px; height: 34px; }
.tier-av-lg { width: 60px; height: 60px; font-size: 24px; }
.tier-av-shine { box-shadow: 0 0 0 2px var(--nt-news-bd); }
.tier-av-glow { box-shadow: 0 0 0 2px var(--nt-warn-bd); }
.tier-av-blaze { box-shadow: 0 0 0 2px var(--tier-blaze-bd); }
.tier-av-radiant { box-shadow: 0 0 0 2px var(--tier-radiant-bd); }
.tier-av-lg.tier-av-shine { box-shadow: 0 0 0 3px var(--nt-news-bd); }
.tier-av-lg.tier-av-glow { box-shadow: 0 0 0 3px var(--nt-warn-bd); }
.tier-av-lg.tier-av-blaze { box-shadow: 0 0 0 3px var(--tier-blaze-bd); }
.tier-av-lg.tier-av-radiant { box-shadow: 0 0 0 3px var(--tier-radiant-bd); }
.tier-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tier-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--primary-text); }
.tier-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--on-surface); }
.tier-next { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.tier-rank { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.tier-rank b { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--on-surface); }
.tier-rank small { font-size: 11px; color: var(--on-surface-variant); margin-top: 3px; }

/* 段位页 */
.app-body.tier-page { padding: 0; }
.tier-wrap { display: flex; flex-direction: column; gap: 16px; padding: 20px 20px 28px; max-width: 560px; margin: 0 auto; }
.tier-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-card); }
.tier-hero-tier { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--on-surface); }
.tier-hero-rank { font-size: 13px; color: var(--on-surface-variant); }
.tier-hero-prog { width: 100%; margin-top: 12px; text-align: left; }
.tier-hero-prog-head { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-meta); color: var(--on-surface-variant); margin-bottom: 5px; }
.tier-hero-count { font-family: var(--font-mono); color: var(--primary-text); flex-shrink: 0; }
.tier-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-variant); overflow: hidden; }
.tier-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--primary); }
.tier-card-flat { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-card); padding: 15px 16px; }
.tier-h { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--on-surface); }
.tier-p { margin: 0 0 7px; font-size: var(--fs-body); line-height: 1.7; color: var(--on-surface-variant); }
.tier-limits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tier-limit { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-variant); border-radius: var(--r-ctl); }
.tier-limit b { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--on-surface); line-height: 1.1; }
.tier-limit span { font-size: var(--fs-meta); color: var(--on-surface-variant); }
.tier-board { list-style: none; margin: 0; padding: 0; }
.tier-board-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--outline); }
.tier-board-row:last-child { border-bottom: 0; }
.tier-board-rank { width: 24px; flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; color: var(--on-surface-variant); }
.tier-board-row.top .tier-board-rank { color: var(--nt-warn); font-weight: 700; }
.tier-board-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tier-board-name { font-size: var(--fs-body); color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-board-tier { font-size: var(--fs-meta); color: var(--primary-text); }
.tier-board-score { font-size: var(--fs-meta); color: var(--on-surface-variant); flex-shrink: 0; }
.tier-board-score b { font-family: var(--font-mono); color: var(--on-surface); font-size: 14px; }
.tier-foot { margin: 0; font-size: var(--fs-meta); color: var(--on-surface-variant); line-height: 1.6; }
.tier-error { text-align: center; }

/* ==========================================================================
   入梦 · 共梦房间（2026-10-26）
   多人房间沿用单人入梦的「舞台」排版：旁白是主角（无框、衬线、大行距），
   玩家行动是配角。新增的只有四样——
     ① 别人的行动有自己的头像与名字（和 NPC 同一套几何，但不继承 NPC 的括号行为）
     ② 系统提示（加入 / 离开 / 被拦）居中弱化，不冒充旁白
     ③ 顶栏下一行中性状态：玩法 + 封存进度 + 连接状态（不吃错误红）
     ④ 逐条入场（fill-mode 必须 backwards，见 scripts/guard-repaint.mjs）
   颜色一律走令牌：写死的色值在深色主题下会失真（房间页第一版就栽在这上面）。
   ========================================================================== */

/* 顶栏副标题：轮到你时用主色，等别人时仍是辅助色 */
.dream-top-act.is-mine { color: var(--primary-text); font-weight: 600; }

/* 顶栏下一行中性状态条：玩法标签 + 进度/连接 + 「有新消息」浮标。
   min-height 固定：它在「有内容 / 没内容」之间切换时不推挤剧本流。 */
.dream-room-hint {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  min-height: 24px; padding: 0 6px;
  font-size: var(--fs-meta); line-height: 1.5;
  color: var(--on-surface-variant);
  overflow: hidden;
}
.dream-room-hint > .me-tag { flex-shrink: 0; }
.dream-room-hint-text {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 连接降级 / 轮到你：用主色提醒，但不用错误红（红只留给真错误） */
.dream-room-hint-text.is-note { color: var(--primary-text); }

/* 「有新消息 ↓」：只在用户往上翻历史时出现，放进状态条右端，不抢浮层 */
.dream-room-jump {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 3px;
  min-height: 22px; padding: 0 9px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface); color: var(--primary-text);
  font: inherit; font-size: var(--fs-meta); cursor: pointer;
}
.dream-room-jump:active { background: var(--surface-variant); }
.dream-room-jump[hidden] { display: none; }

/* 别人的行动：与旁白同处舞台，但有自己的头像与名字（几何同 .dream-line.npc） */
.dream-line.other {
  align-self: flex-start; max-width: 88%;
  display: flex; align-items: flex-start; gap: 8px;
}
.dream-line.other .dream-line-avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-variant); border: 1px solid var(--outline);
  font-family: var(--font-display); font-size: 14px; color: var(--primary-text);
}
.dream-line.other .dream-line-main { min-width: 0; }
.dream-line.other .dream-line-body {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: 6px 18px 18px 18px;
  padding: 10px 14px; white-space: pre-wrap;
}
/* 动作在心里独占一行、淡一点；不做中文伪斜体（设计契约禁止） */
.dream-line.other .dream-act { display: block; color: inherit; opacity: .8; }
.dream-line.other .dream-act + .dream-act { margin-top: 2px; }

/* 系统提示（加入 / 离开 / 被拦）：居中弱化，不与旁白抢分量 */
.dream-line.system {
  align-self: center; max-width: 92%;
  text-align: center; font-size: var(--fs-meta); line-height: 1.6;
  color: var(--on-surface-variant);
  padding: 2px 8px;
}

/* 逐条入场：只动透明度与 6px 位移。fill-mode 必须 backwards ——
   both / forwards 会把 transform:none 永久留在元素上，整棵子树常驻合成层，
   安卓 WebView 键盘开合时漏绘出「白线」（scripts/guard-repaint.mjs 守的就是这条）。 */
.dream-line-in { animation: dream-line-in .2s cubic-bezier(.16, 1, .3, 1) backwards; }
@keyframes dream-line-in { from { opacity: 0; transform: translateY(6px); } }

/* 自己刚发出去、还没等到旁白的那一条 */
.dream-line.player.is-pending { opacity: .55; }

/* 轮不到你 / 已散场：输入框要有明确的「不能写」的样子 */
.dream-input-field:disabled {
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  cursor: not-allowed;
}
.dream-input-field:disabled::placeholder { color: var(--on-surface-variant); }

@media (prefers-reduced-motion: reduce) {
  .dream-line-in { animation: none; }
}

/* 弹层里的一排按钮（开房 / 加入 / 房间操作）：两个以上横排平分，单个占满 */
.sheet-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-btns > .btn { flex: 1; min-width: 0; }
/* 三个按钮时（同幕：推进 / 我离开 / 散场）主操作独占一行，别被挤成两行字 */
.sheet-btns > .btn.is-full { flex: 0 0 100%; }

/* 弹层表单的错误行：占位固定，出错才显形（避免提交时整块跳一下） */
.form-err {
  margin: 0; min-height: 18px;
  font-size: var(--fs-meta); line-height: 1.5;
  color: var(--error);
}

/* 同幕：自己那条已封存的行动上的说明（在主色气泡里，沿用气泡前景色） */
.dream-line.player .dream-sealed-tag { color: inherit; opacity: .7; margin: 4px 0 0; }

/* 邀请弹层：房间码是主角，邀约正文是可整段复制的 */
.dream-invite-code {
  text-align: center;
  padding: 8px 0 2px;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: .16em;
  color: var(--primary-text);
}
.dream-invite-hint {
  margin: 0;
  font-size: var(--fs-meta);
  line-height: 1.6;
  color: var(--on-surface-variant);
}
.dream-invite-text {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--outline);
  border-radius: var(--r-ctl);
  background: var(--surface-variant);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 全房表决：常驻在输入框上面的一张纸卡（投完收成一行「决议：…」） */
.dream-vote {
  margin: 0 12px 6px;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: var(--r-card);
  background: var(--surface);
}
.dream-vote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dream-vote-q { font-size: 14px; color: var(--on-surface); }
.dream-vote-count { flex-shrink: 0; font-size: 11px; color: var(--on-surface-variant); }
.dream-vote-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dream-vote-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; min-height: 36px; border-radius: 999px;
  border: 1px solid var(--outline); background: none; color: var(--on-surface);
  font: inherit; font-size: 13px; cursor: pointer;
}
.dream-vote-opt.is-mine {
  border-color: var(--primary-text); color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.dream-vote-opt-n { font-size: 11px; opacity: .7; }
.dream-vote-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px;
}
.dream-vote-link {
  border: none; background: none; padding: 4px 0;
  color: var(--primary-text); font: inherit; font-size: 12px; cursor: pointer;
}
.dream-vote-tip { font-size: 11px; color: var(--on-surface-variant); }
.dream-vote-result { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--primary-text); }

/* 免费旁观者：输入区整块换成一条只读说明 + 开通入口 */
.dream-spectate-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 2px 4px;
}
/* display:flex 会盖掉 [hidden] 的 UA 样式 —— 与 `.dream-input[hidden]` 同型，必须显式关掉 */
.dream-spectate-bar[hidden],
.dream-input-row[hidden] { display: none; }
.dream-spectate-text {
  font-size: 13px; line-height: 1.5; color: var(--on-surface-variant);
}
/* 旁观者看到的表决选项：不可点，不要按钮的按压感 */
.dream-vote-opt.is-readonly { cursor: default; }
/* 旁观者行比玩家行轻一档（只读、不占座） */
.dream-member-row.is-spectator .dream-member-av { opacity: .8; }

/* 公开房间：共梦页「正在上演」列表的封面缩略（与「我的房间」同一套行结构） */
.dream-public-cover {
  flex: none; width: 40px; height: 52px; border-radius: 8px;
  background-color: var(--surface-variant); background-size: cover; background-position: center;
  border: 1px solid var(--outline);
}
/* 公开卡上的引梦人一行：题材在副标题里，引梦人单独弱化一行，窄屏不跟人数挤 */
.dream-public-host {
  font-size: 11px; line-height: 1.4; color: var(--on-surface-variant);
}

/* 公开房的题材筛选（chips）与「再看 20 桌」 */
.dream-cat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.dream-cat-row[hidden],
.dream-public-more[hidden] { display: none; }
.dream-cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--outline); background: none; color: var(--on-surface);
  font: inherit; font-size: 13px; cursor: pointer;
}
.dream-cat-chip.is-active {
  border-color: var(--primary-text); color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.dream-cat-chip-n { font-size: 11px; opacity: .65; }
.dream-public-more { display: flex; justify-content: center; margin: 10px 0 0; }

/* 剧本流里的时间分隔：跨天/隔了很久才出现一条，居中、弱化，不抢旁白 */
.dream-time-sep {
  margin: 18px 0 6px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--on-surface-variant);
  opacity: .55;
}

/* 空态下面的行动按钮（房间打不开时的「再试一次」） */
.empty-hint-act {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}

/* 「开一桌」那张卡是 button（书墙里同一个 class 是 div）：
   button 默认居中、有底色，不改的话文字会飘到中间、底色盖住纸感 */
button.wd-book-new {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}

/* ==========================================================================
   共梦 · 出戏 / 散场续局（2026-10-26）
   出戏是**玩家之间的商量**，不是戏里发生的事：灰色小字、带「出戏」前缀，
   与旁白（衬线正文）、行动（气泡）都明显不同。不调模型、不扣次数。
   ========================================================================== */

/* 输入行左侧的「出戏」开关（小胶囊，和发送键不同层级） */
.dream-ooc-btn {
  flex-shrink: 0; align-self: flex-end;
  min-height: 32px; padding: 0 10px; margin-bottom: 6px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: none; color: var(--on-surface-variant);
  font: inherit; font-size: var(--fs-meta); cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.dream-ooc-btn.is-on {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-color: var(--primary-text); color: var(--primary-text); font-weight: 600;
}
.dream-ooc-btn:active { transform: scale(.97); }
/* 出戏模式下输入框走虚线：一眼看出"这句不会成为戏里的台词" */
.dream-input-field.is-ooc { border-style: dashed; border-color: var(--primary-text); }

/* 剧本流里的出戏行 */
.dream-line.ooc {
  align-self: flex-start; max-width: 92%;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  font-size: var(--fs-meta); line-height: 1.7;
  color: var(--on-surface-variant);
  padding: 0 6px;
}
.dream-ooc-tag {
  flex-shrink: 0; padding: 0 6px; border-radius: 999px;
  border: 1px dashed var(--outline);
  font-size: 10px; letter-spacing: .08em;
}
.dream-ooc-who { flex-shrink: 0; color: var(--on-surface); }
.dream-ooc-text { min-width: 0; }

/* 散场后的整块：纪要 + 「结着再来一夜」 */
.dream-room-closed {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--outline);
  background: var(--surface);
}
.dream-room-closed[hidden] { display: none; }
.dream-room-closed-t { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.dream-room-closed-p {
  margin: 0; font-size: var(--fs-body); line-height: 1.8; color: var(--on-surface-variant);
  max-height: 30vh; overflow-y: auto;
}

/* .dream-input 是 display:flex（会压过 [hidden] 的 UA display:none）⇒ 散场收起要显式一条 */
.dream-input[hidden] { display: none; }

/* ==========================================================================
   共梦 · 房间管理（2026-10-26）：公告横幅 · 成员行 · 角色胶囊
   参照的是「设置页式的动作表」：成员行本身就是入口，点开才是具体动作，
   不在列表里堆一排按钮。颜色全部走令牌，深色自动跟随。
   ========================================================================== */

/* 房间公告：贴在顶栏下面的一条。用茧丝竖线（全站唯一的手势）而不是另造装饰 */
.dream-announce {
  flex-shrink: 0;
  display: flex; align-items: flex-start; gap: 8px;
  margin: 2px 6px 0; padding: 8px 10px 8px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  font-size: var(--fs-meta); line-height: 1.7; color: var(--on-surface);
  animation: announce-in .22s cubic-bezier(.16, 1, .3, 1) backwards;
}
.dream-announce[hidden] { display: none; }
.dream-announce-ico { flex-shrink: 0; color: var(--primary-text); line-height: 1.7; }
.dream-announce-text {
  flex: 1; min-width: 0; white-space: pre-wrap;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.dream-announce.is-open .dream-announce-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.dream-announce-more {
  flex-shrink: 0; border: 0; background: none; padding: 0 2px;
  color: var(--primary-text); font: inherit; font-size: var(--fs-meta); cursor: pointer;
}
.dream-announce-more[hidden] { display: none; }
@keyframes announce-in { from { opacity: 0; transform: translateY(-4px); } }

/* 弹层里的成员行：头像 + 名字/副行 + 角色胶囊 + 箭头（引梦人才可点） */
.dream-member-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 8px 12px;
  background: none; border: 0; text-align: left; font: inherit; color: var(--on-bg);
  transition: background-color .12s ease;
}
.dream-member-row:active { background: var(--surface-variant); }
.dream-member-row + .dream-member-row { border-top: 1px solid var(--outline); }
.dream-member-av {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-variant); border: 1px solid var(--outline);
  font-family: var(--font-display); font-size: 15px; color: var(--primary-text);
}
.dream-member-av.is-offline { opacity: .5; }
.dream-member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dream-member-name {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-title); font-weight: 500; line-height: 1.35;
}
.dream-member-sub {
  font-size: var(--fs-meta); color: var(--on-surface-variant);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dream-role-tag {
  flex-shrink: 0; padding: 0 7px; border-radius: 999px;
  font-size: 10px; line-height: 1.7; letter-spacing: .04em;
  border: 1px solid var(--outline); color: var(--on-surface-variant);
}
.dream-role-tag.is-host {
  border-color: var(--primary-text); color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.dream-role-tag.is-turn { border-color: var(--outline); color: var(--on-surface); }
/* 次数用完 · 旁观：虚线而不是实线 —— 这是"暂时不在场"，不是身份 */
.dream-role-tag.is-out { border-style: dashed; color: var(--on-surface-variant); opacity: .85; }
.dream-member-chev { flex-shrink: 0; color: var(--on-surface-variant); opacity: .5; }

/* 成员操作层里的按钮沿用 .sheet-btn（已有 48px 命中面与危险色） */
@media (prefers-reduced-motion: reduce) {
  .dream-announce { animation: none; }
}

/* ==========================================================================
   半梦桌面（2026-11-01）

   手机式主屏只负责“把已有 App 放进一个生活化的空间”，不再复制梦信内部
   功能。颜色沿用半梦的暖纸 / 赤陶 / 青绿，不仿 iOS 图标，也不使用外域素材。
   ========================================================================== */
.dp-phone {
  --dp-ink: #243036;
  --dp-ink-soft: rgba(36, 48, 54, .62);
  --dp-line: rgba(55, 67, 69, .13);
  --dp-panel: rgba(255, 252, 245, .58);
  --dp-panel-strong: rgba(255, 253, 248, .78);
  --dp-shadow: 0 18px 48px rgba(71, 61, 51, .16);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--dp-ink);
  background:
    radial-gradient(circle at 78% 8%, rgba(255, 205, 143, .92) 0, rgba(255, 205, 143, 0) 36%),
    radial-gradient(circle at 12% 72%, rgba(100, 176, 167, .42) 0, rgba(100, 176, 167, 0) 43%),
    linear-gradient(155deg, #f4ecdf 0%, #e7e1d8 49%, #c7d6d3 100%);
}
.dp-phone::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .45;
  background:
    linear-gradient(115deg, transparent 0 47%, rgba(255,255,255,.25) 47.2% 47.5%, transparent 47.7%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .dp-phone {
    --dp-ink: #f2eee6;
    --dp-ink-soft: rgba(242, 238, 230, .62);
    --dp-line: rgba(255, 255, 255, .11);
    --dp-panel: rgba(25, 31, 39, .52);
    --dp-panel-strong: rgba(31, 38, 47, .76);
    --dp-shadow: 0 20px 54px rgba(0, 0, 0, .3);
    background:
      radial-gradient(circle at 80% 8%, rgba(213, 135, 99, .52) 0, rgba(213, 135, 99, 0) 34%),
      radial-gradient(circle at 12% 70%, rgba(70, 147, 143, .33) 0, rgba(70, 147, 143, 0) 42%),
      linear-gradient(155deg, #151a21 0%, #20242e 48%, #2f3038 100%);
  }
}
:root[data-theme='dark'] .dp-phone {
  --dp-ink: #f2eee6;
  --dp-ink-soft: rgba(242, 238, 230, .62);
  --dp-line: rgba(255, 255, 255, .11);
  --dp-panel: rgba(25, 31, 39, .52);
  --dp-panel-strong: rgba(31, 38, 47, .76);
  --dp-shadow: 0 20px 54px rgba(0, 0, 0, .3);
  background:
    radial-gradient(circle at 80% 8%, rgba(213, 135, 99, .52) 0, rgba(213, 135, 99, 0) 34%),
    radial-gradient(circle at 12% 70%, rgba(70, 147, 143, .33) 0, rgba(70, 147, 143, 0) 42%),
    linear-gradient(155deg, #151a21 0%, #20242e 48%, #2f3038 100%);
}
.dp-status {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: env(safe-area-inset-top) 20px 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .045em;
}
.dp-status-brand,
.dp-status-side {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
}
.dp-status-brand { gap: 7px; }
.dp-status-brand i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d48363;
  box-shadow: 0 0 0 4px rgba(212, 131, 99, .13);
}
.dp-status-side { color: var(--dp-ink-soft); font-weight: 500; }
.dp-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px 20px 14px;
  scrollbar-width: none;
}
.dp-scroll::-webkit-scrollbar { display: none; }
.dp-hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 2px 2px 20px;
}
.dp-owner {
  display: flex;
  align-items: center;
  gap: 11px;
}
.dp-owner-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 252, 246, .72) center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 6px 18px rgba(74, 61, 49, .12);
  font-family: var(--font-display);
  font-size: 17px;
  color: #7b5b4d;
}
.dp-owner-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dp-owner-copy strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}
.dp-owner-copy span {
  font-size: 11px;
  color: var(--dp-ink-soft);
}
.dp-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 2px;
}
.dp-clock-kicker {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .24em;
  color: var(--dp-ink-soft);
}
.dp-clock-time {
  font-family: var(--font-display);
  font-size: clamp(42px, 12vw, 56px);
  line-height: .98;
  font-weight: 600;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}
.dp-clock-date {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dp-ink-soft);
}
.dp-recent {
  width: 100%;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 15px 16px 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 22px;
  background: var(--dp-panel);
  color: var(--dp-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--dp-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  transition: transform .16s ease, background-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.dp-recent:active { transform: scale(.985); }
.dp-recent:disabled { cursor: default; opacity: .8; }
.dp-recent-kicker {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  color: var(--dp-ink-soft);
}
.dp-recent-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}
.dp-recent-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 252, 247, .82);
  background-position: center;
  background-size: cover;
  color: #7b5b4d;
  font-family: var(--font-display);
  font-size: 18px;
}
.dp-recent-avatar-group { color: #315b59; background: rgba(198, 231, 225, .75); }
.dp-recent-avatar-group svg { width: 23px; height: 23px; }
.dp-recent-avatar-empty { opacity: .55; }
.dp-recent-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dp-recent-copy strong,
.dp-recent-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-recent-copy strong { font-size: 15px; font-weight: 650; }
.dp-recent-copy span {
  font-size: 12px;
  color: var(--dp-ink-soft);
}
.dp-recent-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c96c57;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.dp-recent-arrow {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: var(--dp-ink-soft);
  font-size: 18px;
}
.dp-recent { position: relative; }
.dp-app-section { padding: 24px 2px 6px; }
.dp-section-label {
  margin-bottom: 14px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .16em;
  color: var(--dp-ink-soft);
}
.dp-app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 12px;
}
.dp-app {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dp-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dp-app-icon-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: block;
  transition: transform .16s cubic-bezier(.2, .8, .2, 1);
}
.dp-app:active .dp-app-icon-wrap { transform: scale(.91); }
.dp-app-icon {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dp-icon-ink, #fff);
  box-shadow: 0 9px 22px rgba(66, 58, 51, .18), inset 0 1px 0 rgba(255,255,255,.28);
}
.dp-app-icon svg { width: 29px; height: 29px; }
.dp-app-icon .dp-app-logo { width: 30px; height: 30px; display: block; }
.dp-app-icon-deepseek {
  background: linear-gradient(145deg, #6B85FF 0%, #3B55E6 100%);
}
.dp-app-icon-deepseek .dp-app-logo { filter: brightness(0) invert(1); }
.dp-app-icon-chat {
  background: linear-gradient(145deg, #46baa7 0%, #238d80 100%);
}
.dp-app-icon-moments {
  background: linear-gradient(145deg, #6ca6ca 0%, #486f9b 100%);
}
.dp-app-icon-wallet {
  background: linear-gradient(145deg, #e8b965 0%, #b8793d 100%);
}
.dp-app-icon-friends {
  background: linear-gradient(145deg, #e49a77 0%, #b85f4f 100%);
}
.dp-app-icon-settings {
  background: linear-gradient(145deg, #6e7984 0%, #414b58 100%);
}
.dp-app-icon-echo {
  background: linear-gradient(145deg, #b97c67 0%, #6f4651 100%);
}
.dp-app-icon-calendar {
  background: linear-gradient(145deg, #7397b6 0%, #48647d 100%);
}
.dp-app-icon-album {
  background: linear-gradient(145deg, #83a67a 0%, #537159 100%);
}
.dp-app-icon-halfdream {
  background: linear-gradient(145deg, #343a44 0%, #151a21 100%);
}
.dp-phone[data-dp-icon-color='custom'] .dp-app-icon {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .2), rgba(0, 0, 0, .18)),
    var(--dp-icon-custom, #b96953);
}
.dp-app-label {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
  font-weight: 550;
  text-shadow: 0 1px 0 rgba(255,255,255,.18);
}
.dp-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid rgba(245, 239, 228, .96);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c95e50;
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.dp-badge[hidden] { display: none; }
.dp-dock {
  flex-shrink: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.dp-dock-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 13px 14px 11px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 27px;
  background: var(--dp-panel-strong);
  box-shadow: 0 16px 42px rgba(63, 54, 47, .15);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  backdrop-filter: blur(24px) saturate(1.35);
}
.dp-app-dock { gap: 6px; }
.dp-app-dock .dp-app-icon-wrap { width: 52px; height: 52px; }
.dp-app-dock .dp-app-icon { border-radius: 15px; }
.dp-app-dock .dp-app-icon svg { width: 26px; height: 26px; }
.dp-app-dock .dp-app-label { font-size: 10px; }

/* 梦信一级页左上角：用「小手机 + Home」图标明确区分二级页的返回箭头。 */
.ta-wechat-header .ta-wx-home svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 360px) {
  .dp-scroll { padding-left: 16px; padding-right: 16px; }
  .dp-status { padding-left: 16px; padding-right: 16px; }
  .dp-hero { gap: 22px; }
  .dp-app-grid { gap: 18px 8px; }
  .dp-app-icon-wrap { width: 54px; height: 54px; }
  .dp-app-icon svg { width: 27px; height: 27px; }
  .dp-dock { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .dp-app-icon-wrap,
  .dp-recent { transition: none; }
}

/* 官方桌面模板：默认 dawn 直接使用上面的暖纸晨光。 */
.dp-phone[data-dp-template='rain'] {
  --dp-ink: #edf5f5;
  --dp-ink-soft: rgba(224, 240, 243, .66);
  --dp-line: rgba(196, 228, 234, .14);
  --dp-panel: rgba(17, 31, 43, .58);
  --dp-panel-strong: rgba(20, 37, 50, .82);
  --dp-shadow: 0 20px 52px rgba(1, 7, 12, .36);
  background:
    radial-gradient(circle at 78% 8%, rgba(92, 153, 163, .42), transparent 34%),
    radial-gradient(circle at 16% 76%, rgba(38, 98, 116, .3), transparent 42%),
    linear-gradient(155deg, #0d141d, #172432 52%, #263c49);
}
.dp-phone[data-dp-template='cinema'] {
  --dp-ink: #f4ead9;
  --dp-ink-soft: rgba(231, 210, 183, .63);
  --dp-line: rgba(236, 205, 166, .13);
  --dp-panel: rgba(49, 34, 25, .58);
  --dp-panel-strong: rgba(55, 38, 28, .82);
  --dp-shadow: 0 20px 52px rgba(20, 10, 5, .35);
  background:
    radial-gradient(circle at 82% 8%, rgba(213, 153, 80, .37), transparent 32%),
    radial-gradient(circle at 10% 72%, rgba(129, 77, 52, .28), transparent 42%),
    linear-gradient(155deg, #1b120e, #3a281f 50%, #644534);
}
.dp-phone[data-dp-template='paper'] {
  --dp-ink: #3d2e25;
  --dp-ink-soft: rgba(75, 56, 44, .65);
  --dp-line: rgba(95, 68, 51, .14);
  --dp-panel: rgba(255, 250, 238, .66);
  --dp-panel-strong: rgba(255, 252, 244, .84);
  --dp-shadow: 0 16px 42px rgba(85, 60, 40, .15);
  background:
    repeating-linear-gradient(0deg, rgba(120, 89, 62, .035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 84% 7%, rgba(202, 164, 111, .3), transparent 34%),
    linear-gradient(155deg, #f7eedc, #eadbc3 56%, #d7c0a0);
}
.dp-phone[data-dp-template='starlight'] {
  --dp-ink: #eef4f6;
  --dp-ink-soft: rgba(209, 226, 235, .64);
  --dp-line: rgba(181, 217, 231, .13);
  --dp-panel: rgba(14, 26, 44, .58);
  --dp-panel-strong: rgba(17, 32, 52, .82);
  --dp-shadow: 0 22px 56px rgba(0, 5, 12, .4);
  background:
    radial-gradient(circle at 75% 11%, rgba(102, 154, 184, .4), transparent 30%),
    radial-gradient(circle at 12% 67%, rgba(74, 84, 146, .24), transparent 41%),
    radial-gradient(circle at 67% 47%, rgba(255, 255, 255, .4) 0 1px, transparent 1.5px),
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .34) 0 1px, transparent 1.5px),
    linear-gradient(155deg, #080e1a, #15243a 50%, #2b4259);
  background-size: auto, auto, 89px 83px, 131px 127px, auto;
}
.dp-phone[data-dp-template='garden'] {
  --dp-ink: #29372e;
  --dp-ink-soft: rgba(55, 77, 62, .63);
  --dp-line: rgba(62, 92, 69, .13);
  --dp-panel: rgba(249, 253, 243, .58);
  --dp-panel-strong: rgba(249, 253, 244, .78);
  --dp-shadow: 0 18px 46px rgba(43, 72, 49, .15);
  background:
    radial-gradient(circle at 82% 9%, rgba(244, 197, 150, .36), transparent 33%),
    radial-gradient(circle at 10% 70%, rgba(112, 165, 124, .4), transparent 43%),
    linear-gradient(155deg, #edf3e2, #d2e3c9 55%, #b7d2bb);
}
.dp-phone[data-dp-template='ember'] {
  --dp-ink: #f5e9df;
  --dp-ink-soft: rgba(235, 208, 189, .62);
  --dp-line: rgba(245, 199, 171, .13);
  --dp-panel: rgba(55, 31, 29, .58);
  --dp-panel-strong: rgba(65, 36, 32, .82);
  --dp-shadow: 0 22px 55px rgba(17, 6, 5, .4);
  background:
    radial-gradient(circle at 80% 6%, rgba(220, 126, 86, .45), transparent 31%),
    radial-gradient(circle at 8% 70%, rgba(130, 70, 62, .27), transparent 42%),
    linear-gradient(155deg, #1c1212, #3b2222 50%, #5d342f);
}
.dp-custom-bg {
  position: absolute;
  inset: -24px;
  z-index: -2;
  background-position: center;
  background-size: cover;
  filter: blur(var(--dp-custom-blur, 12px));
  transform: scale(1.06);
  pointer-events: none;
}
.dp-custom-bg[hidden] { display: none; }
.dp-phone[data-dp-template='custom'] {
  --dp-ink: #f4f1eb;
  --dp-ink-soft: rgba(235, 232, 225, .64);
  --dp-line: rgba(255, 255, 255, .13);
  --dp-panel: rgba(22, 25, 31, .52);
  --dp-panel-strong: rgba(25, 29, 36, .76);
  --dp-shadow: 0 20px 52px rgba(0, 0, 0, .32);
  background: #171b21;
}
.dp-phone[data-dp-template='custom']::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(6, 9, 13, var(--dp-custom-veil, .28));
  pointer-events: none;
}
.dp-phone[data-dp-icon-shape='circle'] .dp-app-icon { border-radius: 50%; }
.dp-phone[data-dp-icon-shape='squircle'] .dp-app-icon { border-radius: 21px; }
.dp-phone[data-dp-dock-style='solid'] .dp-dock-inner {
  background: var(--dp-panel-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.dp-phone[data-dp-dock-style='clear'] .dp-dock-inner {
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.dp-theme-entry {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--dp-line);
  border-radius: 999px;
  background: var(--dp-panel);
  color: var(--dp-ink-soft);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

/* 桌面美化设置页 */
.dt-page {
  --dt-ink: #242629;
  --dt-soft: #74736f;
  --dt-line: rgba(48, 50, 51, .12);
  --dt-paper: #f5f0e7;
  --dt-card: rgba(255, 253, 248, .76);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--dt-ink);
  background:
    radial-gradient(circle at 88% 0, rgba(232, 166, 126, .24), transparent 33%),
    linear-gradient(180deg, #fbf7ef, var(--dt-paper));
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .dt-page {
    --dt-ink: #f0ece4;
    --dt-soft: #9d9992;
    --dt-line: rgba(255, 255, 255, .1);
    --dt-paper: #141820;
    --dt-card: rgba(29, 34, 43, .78);
    background:
      radial-gradient(circle at 88% 0, rgba(194, 115, 83, .23), transparent 33%),
      linear-gradient(180deg, #191e26, var(--dt-paper));
  }
}
:root[data-theme='dark'] .dt-page {
  --dt-ink: #f0ece4;
  --dt-soft: #9d9992;
  --dt-line: rgba(255, 255, 255, .1);
  --dt-paper: #141820;
  --dt-card: rgba(29, 34, 43, .78);
  background:
    radial-gradient(circle at 88% 0, rgba(194, 115, 83, .23), transparent 33%),
    linear-gradient(180deg, #191e26, var(--dt-paper));
}
.dt-header {
  flex-shrink: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: env(safe-area-inset-top) 8px 0;
}
.dt-header strong { text-align: center; font-size: 17px; }
.dt-head-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--dt-ink);
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.dt-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 18px calc(30px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.dt-body::-webkit-scrollbar { display: none; }
.dt-loading { padding: 70px 10px; color: var(--dt-soft); text-align: center; font-size: 13px; }
.dt-hero { padding: 10px 2px 22px; }
.dt-kicker {
  color: #b96953;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .22em;
}
.dt-hero h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: -.03em;
}
.dt-hero p { margin-top: 5px; color: var(--dt-soft); font-size: 12px; }
.dt-preview {
  position: relative;
  height: 176px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 24px;
  background:
    radial-gradient(circle at 78% 8%, rgba(255, 205, 143, .92), transparent 36%),
    radial-gradient(circle at 12% 72%, rgba(100, 176, 167, .42), transparent 43%),
    linear-gradient(155deg, #f4ecdf, #e7e1d8 49%, #c7d6d3);
  background-position: center;
  background-size: cover;
  color: #243036;
  box-shadow: 0 18px 44px rgba(60, 49, 40, .16);
}
.dt-preview[data-dp-template='rain'] { background: linear-gradient(155deg, #101923, #1c2b3a 50%, #2d5262); color: #eef7f7; }
.dt-preview[data-dp-template='cinema'] { background: linear-gradient(155deg, #211813, #4b3528 50%, #9a6c4e); color: #f4ead9; }
.dt-preview[data-dp-template='paper'] { background: linear-gradient(155deg, #f4ead7, #e5d2b7 50%, #c9a97f); color: #3d2e25; }
.dt-preview[data-dp-template='starlight'] { background: linear-gradient(155deg, #0d1320, #1a2940 50%, #345a72); color: #eef4f6; }
.dt-preview[data-dp-template='garden'] { background: linear-gradient(155deg, #e9f0df, #c9ddc2 50%, #8fb89d); color: #29372e; }
.dt-preview[data-dp-template='ember'] { background: linear-gradient(155deg, #221a19, #4d2e2b 50%, #a35f4d); color: #f5e9df; }
.dt-preview-time {
  position: absolute;
  top: 22px;
  left: 22px;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: -.04em;
}
.dt-preview-icons {
  position: absolute;
  left: 22px;
  top: 83px;
  display: flex;
  gap: 12px;
}
.dt-preview-icons i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.32);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.dt-preview[data-dp-icon-shape='circle'] .dt-preview-icons i { border-radius: 50%; }
.dt-preview[data-dp-icon-shape='squircle'] .dt-preview-icons i { border-radius: 13px; }
.dt-preview[data-dp-icon-color='custom'] .dt-preview-icons i {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .2), rgba(0, 0, 0, .18)),
    var(--dp-icon-custom, #b96953);
  color: var(--dp-icon-ink, #fff);
}
.dt-preview-dock {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 15px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(255,255,255,.42);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.dt-preview[data-dp-dock-style='solid'] .dt-preview-dock { background: rgba(255,255,255,.72); }
.dt-preview[data-dp-dock-style='clear'] .dt-preview-dock { background: transparent; }
.dt-preview-dock i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(45, 55, 62, .72);
}
.dt-official { padding: 2px 0 24px; }
.dt-official h2 { margin-bottom: 12px; font-family: var(--font-display); font-size: 18px; }
.dt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dt-theme-card {
  position: relative;
  min-width: 0;
  padding: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--dt-line);
  border-radius: 17px;
  background: var(--dt-card);
  color: var(--dt-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.dt-theme-card.active { border-color: #b96953; box-shadow: 0 0 0 2px rgba(185,105,83,.16); }
.dt-theme-art {
  position: relative;
  display: block;
  height: 86px;
  overflow: hidden;
  background: #ddd;
}
.dt-theme-art > i {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  opacity: .8;
}
.dt-theme-tile {
  position: absolute;
  left: 12px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.55);
  color: #332d29;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.dt-theme-card > strong,
.dt-theme-card > span:not(.dt-theme-art) {
  display: block;
  padding: 0 12px;
}
.dt-theme-card > strong { margin-top: 10px; font-size: 13px; }
.dt-theme-card > span:not(.dt-theme-art) {
  margin-top: 3px;
  color: var(--dt-soft);
  font-size: 10px;
  line-height: 1.45;
}
.dt-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20,20,20,.65);
  color: #fff;
  font-size: 9px;
  font-style: normal;
}
.dt-custom {
  position: relative;
  padding: 18px;
  border: 1px solid var(--dt-line);
  border-radius: 22px;
  background: var(--dt-card);
}
.dt-lock-banner {
  width: 100%;
  min-height: 42px;
  margin-bottom: 10px;
  border: 1px solid rgba(185,105,83,.26);
  border-radius: 12px;
  background: rgba(185,105,83,.08);
  color: #a45f4c;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.dt-section-title { display: flex; align-items: center; margin-bottom: 12px; }
.dt-section-title strong { font-family: var(--font-display); font-size: 18px; }
.dt-member-tag {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(185,105,83,.12);
  color: #b96953;
  font-size: 9px;
}
.dt-upload {
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px dashed rgba(185,105,83,.42);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  background: rgba(185,105,83,.05);
  color: var(--dt-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dt-upload strong { font-size: 13px; }
.dt-upload span { color: var(--dt-soft); font-size: 10px; }
.dt-remove {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #b3563e;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.dt-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin-top: 10px;
}
.dt-control strong { flex: 0 0 76px; font-size: 11px; }
.dt-range { flex: 1; accent-color: #b96953; }
.dt-control-label {
  display: block;
  margin: 14px 0 8px;
  color: var(--dt-soft);
  font-size: 10px;
  font-weight: 650;
}
.dt-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.dt-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--dt-line);
  border-radius: 999px;
  background: transparent;
  color: var(--dt-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.dt-chip.active { border-color: transparent; background: var(--dt-ink); color: var(--dt-paper); }
.dt-color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dt-color-chip,
.dt-color-custom {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--dt-line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--dt-soft);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.dt-color-chip.active,
.dt-color-custom.active {
  border-color: transparent;
  background: var(--dt-ink);
  color: var(--dt-paper);
  font-weight: 650;
}
.dt-color-dot {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(127, 127, 127, .28);
  border-radius: 50%;
  background:
    linear-gradient(45deg, rgba(127, 127, 127, .25) 25%, transparent 25% 75%, rgba(127, 127, 127, .25) 75%),
    linear-gradient(45deg, rgba(127, 127, 127, .25) 25%, transparent 25% 75%, rgba(127, 127, 127, .25) 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}
.dt-color-input {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.dt-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.dt-color-input::-webkit-color-swatch {
  border: 1px solid rgba(127, 127, 127, .32);
  border-radius: 50%;
}
.dt-save {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: 13px;
  background: var(--dt-ink);
  color: var(--dt-paper);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.dt-save:disabled { opacity: .45; }
@media (max-width: 360px) {
  .dt-body { padding-left: 14px; padding-right: 14px; }
  .dt-grid { gap: 8px; }
  .dt-preview { height: 160px; }
}

/* ==========================================================================
   共享日历
   ========================================================================== */
.cal-page {
  --cal-ink: #262b2c;
  --cal-soft: #737572;
  --cal-line: rgba(48, 54, 53, .12);
  --cal-paper: #f5f0e7;
  --cal-card: rgba(255, 253, 248, .76);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--cal-ink);
  background:
    radial-gradient(circle at 88% 0, rgba(115, 151, 182, .22), transparent 34%),
    linear-gradient(180deg, #faf7ef, var(--cal-paper));
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .cal-page {
    --cal-ink: #f0ece5;
    --cal-soft: #9c9992;
    --cal-line: rgba(255,255,255,.1);
    --cal-paper: #141820;
    --cal-card: rgba(29,34,43,.78);
    background:
      radial-gradient(circle at 88% 0, rgba(82, 119, 149, .3), transparent 34%),
      linear-gradient(180deg, #191e26, var(--cal-paper));
  }
}
.cal-header {
  flex-shrink: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  align-items: center;
  padding: env(safe-area-inset-top) 8px 0;
}
.cal-header strong { text-align: center; font-size: 17px; }
.cal-head-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--cal-ink);
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.cal-head-btn:active { background: var(--cal-line); }
.cal-add { font-size: 24px; }
.cal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 16px calc(28px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.cal-body::-webkit-scrollbar { display: none; }
.cal-loading { padding: 70px 10px; text-align: center; color: var(--cal-soft); font-size: 13px; }
.cal-empty { padding: 80px 24px; text-align: center; color: var(--cal-soft); line-height: 1.8; }
.cal-chars {
  display: flex;
  gap: 8px;
  padding: 4px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cal-chars::-webkit-scrollbar { display: none; }
.cal-char {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 4px 11px 4px 5px;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.28);
  color: var(--cal-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.cal-char.active { border-color: transparent; background: var(--cal-ink); color: var(--cal-paper); }
.cal-char-avatar.cavatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
}
.cal-time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 1px solid var(--cal-line);
  border-radius: 15px;
  background: rgba(255,255,255,.28);
}
.cal-time-switch {
  flex: 0 0 auto;
  display: flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--cal-line);
}
.cal-time-btn {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cal-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.cal-time-btn.active {
  background: var(--cal-ink);
  color: var(--cal-paper);
}
.cal-time-btn:disabled {
  opacity: .36;
  cursor: default;
}
.cal-time-copy {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-time-copy strong {
  color: var(--cal-ink);
  font-size: 11px;
  font-weight: 650;
}
.cal-time-source {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cal-soft);
  font: inherit;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}
.cal-time-source:disabled { cursor: default; }
.cal-time-source span { margin-left: 4px; font-size: 13px; }
.cal-time-hint {
  flex-basis: 100%;
  color: var(--cal-soft);
  font-size: 9px;
  line-height: 1.55;
}
.cal-today-alert {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: -3px 2px 13px;
  padding: 9px 11px;
  border-left: 3px solid #b96953;
  border-radius: 4px 12px 12px 4px;
  background: rgba(185,105,83,.09);
  color: var(--cal-ink);
  font-size: 11px;
  line-height: 1.55;
}
.cal-today-alert strong {
  flex: none;
  color: #a55440;
  font-size: 9px;
  letter-spacing: .06em;
}
.cal-today-alert span { min-width: 0; }
.cal-source-wrap { display: flex; flex-direction: column; gap: 12px; padding: 2px 2px 16px; }
.cal-source-list { display: flex; flex-direction: column; gap: 8px; }
.cal-source-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 13px;
  border: 1px solid var(--cal-line);
  border-radius: 13px;
  background: var(--cal-card);
  color: var(--cal-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cal-source-item strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.cal-source-item span { color: var(--cal-soft); font-size: 10px; }
.cal-source-item.active { border-color: var(--cal-ink); }
.cal-month-title {
  display: flex;
  align-items: center;
  padding: 5px 2px 12px;
}
.cal-month-title strong {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -.02em;
}
.cal-month-title > span {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.cal-month-title button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--cal-line);
  border-radius: 10px;
  background: transparent;
  color: var(--cal-ink);
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}
.cal-week,
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week { margin-bottom: 4px; }
.cal-week span {
  padding: 5px 0;
  text-align: center;
  color: var(--cal-soft);
  font-size: 9px;
}
.cal-grid { gap: 2px; }
.cal-day {
  position: relative;
  min-width: 0;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--cal-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cal-day.outside { color: var(--cal-soft); opacity: .36; }
.cal-day.today span {
  width: 27px;
  height: 27px;
  margin: auto;
  border: 1px solid var(--cal-ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.cal-day.selected { background: var(--cal-ink); color: var(--cal-paper); }
.cal-day.selected.today span { border-color: transparent; }
.cal-day i {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b96953;
  transform: translateX(-50%);
}
.cal-selected-title {
  margin: 18px 2px 10px;
  color: var(--cal-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
}
.cal-events { display: flex; flex-direction: column; gap: 9px; }
.cal-none {
  min-height: 115px;
  border: 1px dashed var(--cal-line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cal-soft);
  font-size: 12px;
}
.cal-none button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--cal-ink);
  color: var(--cal-paper);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.cal-event {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--cal-line);
  border-radius: 16px;
  background: var(--cal-card);
}
.cal-event.locked { background: rgba(115,151,182,.09); }
.cal-event-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #b96953;
}
.cal-event-main { flex: 1; min-width: 0; }
.cal-event-title { display: flex; align-items: center; gap: 7px; }
.cal-event-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 15px;
}
.cal-event-title em {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--cal-line);
  color: var(--cal-soft);
  font-size: 8px;
  font-style: normal;
}
.cal-event p {
  margin-top: 5px;
  color: var(--cal-soft);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.cal-event-meta { margin-top: 6px; display: flex; gap: 8px; color: var(--cal-soft); font-size: 9px; }
.cal-event-actions {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: flex;
  gap: 5px;
}
.cal-event-actions button {
  border: 0;
  background: transparent;
  color: var(--cal-soft);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}
.cal-form { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 18px; }
.cal-form > label { display: flex; flex-direction: column; gap: 7px; color: var(--cal-soft); font-size: 10px; }
.cal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-form-row label { display: flex; flex-direction: column; gap: 7px; color: var(--cal-soft); font-size: 10px; }
.cal-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--cal-line);
  border-radius: 12px;
  background: var(--cal-card);
  color: var(--cal-ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.cal-note { min-height: 82px; resize: vertical; line-height: 1.65; }
.cal-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.cal-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  background: transparent;
  color: var(--cal-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.cal-chip.active { border-color: transparent; background: var(--cal-ink); color: var(--cal-paper); }
.cal-save {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  background: var(--cal-ink);
  color: var(--cal-paper);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.cal-save:disabled { opacity: .45; }

/* ==========================================================================
   相册
   ========================================================================== */
.album-page {
  --alb-ink: #242728;
  --alb-soft: #72736f;
  --alb-line: rgba(46,50,49,.12);
  --alb-paper: #f3eee5;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--alb-ink);
  background:
    radial-gradient(circle at 88% 0, rgba(131,166,122,.2), transparent 34%),
    linear-gradient(180deg, #faf6ee, var(--alb-paper));
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .album-page {
    --alb-ink: #f0ece5;
    --alb-soft: #9b9891;
    --alb-line: rgba(255,255,255,.1);
    --alb-paper: #141820;
    background:
      radial-gradient(circle at 88% 0, rgba(83, 126, 76, .25), transparent 34%),
      linear-gradient(180deg, #191e26, var(--alb-paper));
  }
}
.album-header {
  flex-shrink: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 44px;
  align-items: center;
  padding: env(safe-area-inset-top) 8px 0;
}
.album-header strong { text-align: center; font-size: 17px; }
.album-head-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--alb-ink);
  font: inherit;
  font-size: 30px;
  cursor: pointer;
}
.album-header-mark { text-align: center; color: #789473; font-size: 17px; }
.album-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 14px calc(28px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.album-body::-webkit-scrollbar { display: none; }
.album-loading { padding: 70px 10px; text-align: center; color: var(--alb-soft); font-size: 13px; }
.album-hero { padding: 12px 4px 17px; }
.album-kicker { color: #789473; font-size: 9px; font-weight: 750; letter-spacing: .22em; }
.album-hero h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 29px;
  line-height: 1.22;
  letter-spacing: -.03em;
}
.album-hero p { margin-top: 6px; color: var(--alb-soft); font-size: 12px; }
.album-tabs {
  display: flex;
  gap: 7px;
  padding: 2px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.album-tabs::-webkit-scrollbar { display: none; }
.album-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--alb-line);
  border-radius: 999px;
  background: transparent;
  color: var(--alb-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.album-tab.active { border-color: transparent; background: var(--alb-ink); color: var(--alb-paper); }
.album-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 0 3px 7px;
  color: var(--alb-soft);
  font-size: 9px;
}
.album-cap {
  margin-left: auto;
  color: var(--alb-ink);
  font-size: 10px;
  font-weight: 700;
}
.album-limit {
  padding: 0 3px 12px;
  color: var(--alb-soft);
  font-size: 9px;
  line-height: 1.55;
}
.album-sections { display: flex; flex-direction: column; gap: 20px; }
.album-group-head {
  display: flex;
  align-items: center;
  margin: 0 3px 8px;
}
.album-group-head strong { font-family: var(--font-display); font-size: 17px; }
.album-group-head span { margin-left: auto; color: var(--alb-soft); font-size: 9px; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  grid-auto-rows: minmax(96px, 31vw);
  gap: 4px;
}
.album-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--alb-line);
  cursor: pointer;
}
.album-tile-wide { grid-column: span 2; grid-row: span 2; }
.album-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-tile:active img { transform: scale(1.03); }
.album-source {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 8px;
  opacity: 0;
  transition: opacity .15s ease;
}
.album-tile:hover .album-source { opacity: 1; }
.album-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--alb-soft);
  text-align: center;
}
.album-empty strong { color: var(--alb-ink); font-family: var(--font-display); font-size: 18px; }
.album-empty p { max-width: 260px; font-size: 12px; line-height: 1.75; }
@media (max-width: 360px) {
  .cal-body, .album-body { padding-left: 10px; padding-right: 10px; }
  .cal-day { height: 40px; }
  .album-grid { grid-auto-rows: minmax(88px, 30vw); }
}

/* ==========================================================================
   回声 · 公共反馈议题
   ========================================================================== */
.echo-page {
  --echo-ink: #222729;
  --echo-soft: #6c706e;
  --echo-line: rgba(53, 57, 56, .12);
  --echo-paper: #f5f0e7;
  --echo-card: rgba(255, 253, 248, .76);
  --echo-accent: #b96752;
  --echo-teal: #3f8f83;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--echo-ink);
  background:
    radial-gradient(circle at 88% 0, rgba(235, 173, 132, .25), transparent 32%),
    radial-gradient(circle at 0 40%, rgba(93, 176, 163, .16), transparent 38%),
    linear-gradient(180deg, #fbf7ef 0%, var(--echo-paper) 100%);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .echo-page {
    --echo-ink: #f0ece4;
    --echo-soft: #9c9993;
    --echo-line: rgba(255, 255, 255, .1);
    --echo-paper: #141820;
    --echo-card: rgba(29, 34, 43, .78);
    --echo-accent: #dc8c72;
    --echo-teal: #6cbdb0;
    background:
      radial-gradient(circle at 88% 0, rgba(194, 115, 83, .25), transparent 32%),
      radial-gradient(circle at 0 40%, rgba(70, 146, 137, .18), transparent 38%),
      linear-gradient(180deg, #181d25 0%, var(--echo-paper) 100%);
  }
}
:root[data-theme='dark'] .echo-page {
  --echo-ink: #f0ece4;
  --echo-soft: #9c9993;
  --echo-line: rgba(255, 255, 255, .1);
  --echo-paper: #141820;
  --echo-card: rgba(29, 34, 43, .78);
  --echo-accent: #dc8c72;
  --echo-teal: #6cbdb0;
  background:
    radial-gradient(circle at 88% 0, rgba(194, 115, 83, .25), transparent 32%),
    radial-gradient(circle at 0 40%, rgba(70, 146, 137, .18), transparent 38%),
    linear-gradient(180deg, #181d25 0%, var(--echo-paper) 100%);
}
.echo-top { flex-shrink: 0; }
.echo-header {
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: env(safe-area-inset-top) 8px 0;
}
.echo-header > strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 650;
}
.echo-head-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--echo-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.echo-head-btn svg { width: 22px; height: 22px; }
.echo-head-btn:active { background: var(--echo-line); }
.echo-intro {
  padding: 20px 24px 18px;
}
.echo-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--echo-accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .24em;
}
.echo-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(27px, 8vw, 34px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.03em;
}
.echo-intro p {
  margin-top: 6px;
  color: var(--echo-soft);
  font-size: 13px;
}
.echo-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.echo-tabs::-webkit-scrollbar { display: none; }
.echo-filter-label {
  padding: 0 23px 6px;
  color: var(--echo-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}
.echo-category-tabs {
  padding-bottom: 10px;
}
.echo-category-tab {
  min-height: 31px;
  padding: 0 12px;
  background: transparent;
}
.echo-tab-count {
  display: inline-block;
  min-width: 12px;
  margin-left: 5px;
  color: var(--echo-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.echo-tab-count:empty { display: none; }
.echo-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--echo-line);
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  color: var(--echo-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.echo-tab.active {
  border-color: transparent;
  background: var(--echo-ink);
  color: var(--echo-paper);
  font-weight: 650;
}
.echo-tab.active .echo-tab-count { color: inherit; opacity: .72; }
.echo-list,
.echo-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 18px calc(28px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.echo-list::-webkit-scrollbar,
.echo-detail::-webkit-scrollbar { display: none; }
.echo-loading {
  padding: 60px 10px;
  text-align: center;
  color: var(--echo-soft);
  font-size: 13px;
}
.echo-section-label {
  margin: 14px 4px 10px;
  color: var(--echo-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}
.echo-member-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 84%);
  gap: 10px;
  margin: 0 -18px;
  padding: 0 18px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.echo-member-rail::-webkit-scrollbar { display: none; }
.echo-member-rail .echo-card { scroll-snap-align: start; }
.echo-card-list { display: flex; flex-direction: column; gap: 10px; }
.echo-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px;
  border: 1px solid var(--echo-line);
  border-radius: 18px;
  background: var(--echo-card);
  color: var(--echo-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(64, 56, 49, .07);
  -webkit-tap-highlight-color: transparent;
}
.echo-card:active { transform: scale(.99); }
.echo-card-compact {
  min-height: 160px;
  background:
    linear-gradient(145deg, rgba(185, 103, 82, .1), transparent 55%),
    var(--echo-card);
}
.echo-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.echo-chip,
.echo-member,
.echo-carry {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.5;
  font-weight: 650;
}
.echo-chip { background: rgba(63, 143, 131, .12); color: var(--echo-teal); }
.echo-chip-wait { background: rgba(203, 147, 55, .13); color: #9b6a21; }
.echo-chip-seen { background: rgba(77, 122, 189, .12); color: #5478ad; }
.echo-chip-planned { background: rgba(139, 100, 177, .13); color: #8162a1; }
.echo-chip-fixed { background: rgba(63, 143, 131, .15); color: var(--echo-teal); }
.echo-chip-muted { background: var(--echo-line); color: var(--echo-soft); }
.echo-category-chip,
.echo-kind-chip {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.5;
  font-weight: 650;
}
.echo-category-chip {
  border: 1px solid var(--echo-line);
  color: var(--echo-soft);
}
.echo-kind-bug { background: rgba(185, 103, 82, .12); color: var(--echo-accent); }
.echo-kind-suggestion { background: rgba(63, 143, 131, .12); color: var(--echo-teal); }
.echo-member { background: rgba(185, 103, 82, .13); color: var(--echo-accent); }
.echo-carry { border: 1px dashed var(--echo-line); color: var(--echo-soft); }
.echo-card-time {
  margin-left: auto;
  color: var(--echo-soft);
  font-size: 10px;
}
.echo-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.45;
}
.echo-card-copy {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--echo-soft);
  font-size: 12px;
  line-height: 1.65;
}
.echo-card-foot {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--echo-soft);
  font-size: 10px;
}
.echo-card-stats {
  margin-left: auto;
  display: flex;
  gap: 9px;
}
.echo-mine-link {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: 1px dashed var(--echo-line);
  border-radius: 14px;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.echo-top-tools {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 12px;
}
.echo-top-tools .echo-mine-link {
  width: auto;
  margin-top: 0;
  padding: 9px 13px;
  border-style: solid;
  border-radius: 999px;
  font-size: 11px;
}
.echo-board-page { padding-top: 8px; }
.echo-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}
.echo-board-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--echo-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 0, rgba(185, 103, 82, .2), transparent 40%),
    linear-gradient(145deg, rgba(63, 143, 131, .1), transparent 58%),
    var(--echo-card);
  box-shadow: 0 18px 42px rgba(64, 56, 49, .08);
}
.echo-board-hero::after {
  content: "◌";
  position: absolute;
  right: 12px;
  bottom: -34px;
  color: rgba(185, 103, 82, .12);
  font-family: var(--font-display);
  font-size: 112px;
  line-height: 1;
  pointer-events: none;
}
.echo-board-hero .echo-kicker { margin-bottom: 14px; }
.echo-board-hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.echo-board-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.echo-board-hero-copy > * {
  overflow-wrap: anywhere;
}
.echo-board-hero-rank {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.2;
  letter-spacing: -.03em;
}
.echo-board-hero-tier {
  display: block;
  margin-top: 6px;
  color: var(--echo-soft);
  font-size: 11px;
  line-height: 1.6;
}
.echo-board-hero-score {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 103, 82, .22);
  border-radius: 16px;
  background: rgba(255, 253, 248, .36);
  text-align: right;
}
.echo-board-hero-score b {
  display: block;
  color: var(--echo-accent);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
}
.echo-board-hero-score small {
  display: block;
  margin-top: 5px;
  color: var(--echo-soft);
  font-size: 9px;
}
.echo-board-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.echo-board-stat {
  min-width: 0;
  padding: 10px 11px;
  border-top: 1px solid var(--echo-line);
}
.echo-board-stat b {
  display: block;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
}
.echo-board-stat small {
  display: block;
  margin-top: 4px;
  color: var(--echo-soft);
  font-size: 9px;
}
.echo-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.echo-board-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--echo-line);
  border-radius: 999px;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.echo-board-action.primary {
  border-color: transparent;
  background: var(--echo-ink);
  color: var(--echo-paper);
  font-weight: 650;
}
.echo-board-section {
  padding: 17px 16px;
  border: 1px solid var(--echo-line);
  border-radius: 20px;
  background: rgba(255, 253, 248, .28);
}
.echo-board-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.echo-board-section-head h2 {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
}
.echo-board-section-head span {
  flex-shrink: 0;
  color: var(--echo-soft);
  font-size: 9px;
  text-align: right;
}
.echo-board-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.echo-board-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 253, 248, .38);
}
.echo-board-row.top {
  border-color: rgba(185, 103, 82, .16);
  background: rgba(185, 103, 82, .07);
}
.echo-board-row.me {
  border-color: rgba(63, 143, 131, .36);
  box-shadow: inset 3px 0 0 var(--echo-teal);
}
.echo-board-rank {
  width: 30px;
  height: 30px;
  border: 1px solid var(--echo-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--echo-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
}
.echo-board-row.top .echo-board-rank {
  border-color: transparent;
  background: var(--echo-accent);
  color: #fffaf4;
}
.echo-board-person {
  min-width: 0;
  overflow: hidden;
}
.echo-board-person strong {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
}
.echo-board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.echo-board-person small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--echo-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.echo-board-me {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(63, 143, 131, .13);
  color: var(--echo-teal);
  font-size: 8px;
  font-weight: 700;
}
.echo-board-score {
  flex: 0 0 auto;
  min-width: 54px;
  text-align: right;
  white-space: nowrap;
}
.echo-board-score b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
}
.echo-board-score small {
  color: var(--echo-soft);
  font-size: 8px;
}
.echo-board-empty {
  padding: 18px 6px 8px;
  color: var(--echo-soft);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}
.echo-board-topic-list .echo-card-compact { min-height: 0; }
.echo-board-note {
  padding: 0 6px;
  color: var(--echo-soft);
  font-size: 9px;
  line-height: 1.75;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .echo-board-hero-score,
  html:not([data-theme='light']) .echo-board-row {
    background: rgba(255, 255, 255, .045);
  }
  html:not([data-theme='light']) .echo-board-section {
    background: rgba(255, 255, 255, .028);
  }
  html:not([data-theme='light']) .echo-board-row.top {
    background: rgba(185, 103, 82, .12);
  }
}
:root[data-theme='dark'] .echo-board-hero-score,
:root[data-theme='dark'] .echo-board-row {
  background: rgba(255, 255, 255, .045);
}
:root[data-theme='dark'] .echo-board-section {
  background: rgba(255, 255, 255, .028);
}
:root[data-theme='dark'] .echo-board-row.top {
  background: rgba(185, 103, 82, .12);
}
.echo-empty {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--echo-soft);
}
.echo-empty-orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--echo-line);
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--echo-accent);
}
.echo-empty strong { color: var(--echo-ink); font-family: var(--font-display); font-size: 17px; }
.echo-primary,
.echo-submit {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--echo-ink);
  color: var(--echo-paper);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.echo-detail-head { flex-shrink: 0; }
.echo-topic {
  margin-top: 8px;
  padding: 20px 18px;
  border: 1px solid var(--echo-line);
  border-radius: 22px;
  background: var(--echo-card);
}
.echo-topic-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.echo-topic-alias {
  margin-left: auto;
  color: var(--echo-soft);
  font-size: 10px;
}
.echo-topic h1 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.38;
  letter-spacing: -.025em;
}
.echo-topic-content {
  margin-top: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.9;
}
.echo-topic-meta {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  color: var(--echo-soft);
  font-size: 10px;
}
.echo-reply {
  margin-top: 18px;
  padding: 14px 15px;
  border-left: 3px solid var(--echo-accent);
  border-radius: 0 13px 13px 0;
  background: rgba(185, 103, 82, .08);
}
.echo-reply-label {
  color: var(--echo-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.echo-reply p {
  margin-top: 8px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.8;
}
.echo-reply-time {
  display: block;
  margin-top: 7px;
  color: var(--echo-soft);
  font-size: 9px;
}
.echo-action-bar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.echo-spacer { flex: 1; }
.echo-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--echo-line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.echo-action svg { width: 16px; height: 16px; }
.echo-action.active {
  border-color: rgba(185, 103, 82, .35);
  background: rgba(185, 103, 82, .1);
  color: var(--echo-accent);
}
.echo-action:disabled { opacity: .45; cursor: default; }
.echo-action-static { cursor: default; }
.echo-action-quiet { width: 38px; padding: 0; justify-content: center; }
.echo-comment-section { padding: 22px 4px 8px; }
.echo-comment-section h2 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 17px;
}
.echo-comments { display: flex; flex-direction: column; gap: 10px; }
.echo-comment {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--echo-line);
  border-radius: 15px;
  background: var(--echo-card);
}
.echo-comment-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--echo-soft);
  font-size: 9px;
}
.echo-comment-meta strong { color: var(--echo-ink); font-size: 11px; }
.echo-comment p {
  margin-top: 7px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.75;
}
.echo-comment-del {
  position: absolute;
  right: 10px;
  bottom: 9px;
  border: 0;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}
.echo-comment-empty {
  padding: 18px 0;
  color: var(--echo-soft);
  text-align: center;
  font-size: 12px;
}
.echo-comment-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 0 12px;
}
.echo-comment-input,
.echo-field {
  width: 100%;
  border: 1px solid var(--echo-line);
  border-radius: 13px;
  background: var(--echo-card);
  color: var(--echo-ink);
  font: inherit;
  outline: none;
}
.echo-comment-input {
  min-height: 46px;
  max-height: 120px;
  padding: 10px 12px;
  resize: none;
  font-size: 12px;
  line-height: 1.6;
}
.echo-comment-input:disabled { opacity: .58; }
.echo-comment-send {
  flex-shrink: 0;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--echo-ink);
  color: var(--echo-paper);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.echo-comment-send:disabled { opacity: .45; cursor: default; }
.echo-composer {
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.echo-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 13px;
  scrollbar-width: none;
}
.echo-form::-webkit-scrollbar { display: none; }
.echo-form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.echo-form-label,
.echo-form-section-title {
  color: var(--echo-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.echo-form-section-title { margin: 5px 2px -4px; }
.echo-form-note,
.echo-form-hint {
  color: var(--echo-soft);
  font-size: 10px;
  line-height: 1.7;
}
.echo-form-hint {
  padding: 12px 14px;
  border: 1px dashed var(--echo-line);
  border-radius: 13px;
}
.echo-form-bug-fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.echo-form-bug-fields[hidden] { display: none; }
.echo-publish {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--echo-line);
  border-radius: 14px;
  background: var(--echo-card);
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}
.echo-publish-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--echo-accent);
}
.echo-publish strong { display: block; margin-bottom: 3px; }
.echo-publish-copy {
  margin: 0;
  color: var(--echo-soft);
  font-size: 10px;
  line-height: 1.65;
}
.echo-submit-result {
  padding: 13px 14px;
  border: 1px solid rgba(63, 143, 131, .28);
  border-radius: 14px;
  background: rgba(63, 143, 131, .08);
  color: var(--echo-ink);
  font-size: 11px;
  line-height: 1.7;
}
.echo-submit-result[hidden] { display: none; }
.echo-submit-result > strong { font-size: 13px; }
.echo-submit-result > p { margin-top: 3px; color: var(--echo-soft); }
.echo-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.echo-result-link {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(63, 143, 131, .34);
  border-radius: 999px;
  background: transparent;
  color: var(--echo-teal);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.echo-result-link.quiet {
  border-color: var(--echo-line);
  color: var(--echo-soft);
}
.echo-mine-tabs { padding-left: 0; padding-right: 0; }
.mf-empty-cta {
  margin: 12px auto 4px;
  display: block;
}
.echo-privacy-note {
  padding: 12px 14px;
  border: 1px dashed rgba(63, 143, 131, .35);
  border-radius: 13px;
  background: rgba(63, 143, 131, .07);
  color: var(--echo-teal);
  font-size: 11px;
  line-height: 1.7;
}
.echo-kind-row { display: flex; gap: 8px; }
.echo-kind {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--echo-line);
  border-radius: 999px;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.echo-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.echo-category-choice {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--echo-line);
  border-radius: 999px;
  background: transparent;
  color: var(--echo-soft);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.echo-category-choice.active {
  border-color: transparent;
  background: var(--echo-teal);
  color: #fff;
  font-weight: 650;
}
.echo-kind.active {
  border-color: transparent;
  background: var(--echo-ink);
  color: var(--echo-paper);
}
.echo-field {
  padding: 13px 14px;
  font-size: 14px;
}
.echo-field:focus { border-color: rgba(185, 103, 82, .55); }
.echo-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.75;
}
.echo-compose-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.echo-counter {
  color: var(--echo-soft);
  font-size: 10px;
}
.echo-submit { margin-left: auto; }
.echo-submit:disabled { opacity: .45; }

@media (max-width: 360px) {
  .echo-intro { padding-left: 18px; padding-right: 18px; }
  .echo-tabs { padding-left: 14px; padding-right: 14px; }
  .echo-list,
  .echo-detail { padding-left: 14px; padding-right: 14px; }
  .echo-member-rail { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .echo-card { padding: 13px 14px; }
  .echo-card-stats { gap: 6px; }
  .echo-board-hero { padding: 17px 15px; }
  .echo-board-hero-main { gap: 10px; }
  .echo-board-hero-score { min-width: 64px; padding: 8px 9px; }
  .echo-board-hero-score b { font-size: 25px; }
  .echo-board-section { padding: 15px 12px; }
  .echo-board-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .echo-board-section-head span { text-align: left; }
  .echo-board-stat { padding: 9px 7px; }
  .echo-board-stat b { font-size: 17px; }
  .echo-board-row { grid-template-columns: 28px minmax(0, 1fr) minmax(48px, auto); gap: 8px; padding: 8px; }
  .echo-board-rank { width: 28px; height: 28px; }
  .echo-board-score { min-width: 48px; }
  .echo-board-score b { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .echo-card { transition: none; }
}


/* ---------- 半梦入门手册（可搜索 · 分章） ---------- */
.handbook-overlay { padding: 18px; }
.handbook-card {
  width: 100%;
  max-width: 760px;
  height: 90vh;
  height: min(90dvh, 760px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  padding: 0;
  overflow: hidden;
  display: flex;
  outline: none;
}
.handbook-main {
  height: 100%;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.handbook-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 12px;
  flex-shrink: 0;
}
.handbook-head-text { flex: 1; min-width: 0; }
.handbook-eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 5px;
}
.handbook-title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--on-bg);
  letter-spacing: .01em;
}
.handbook-sub {
  margin-top: 7px;
  color: var(--on-surface-variant);
  font-size: 12.5px;
  line-height: 1.6;
}
.handbook-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.handbook-close:active { background: var(--surface-variant); }
.handbook-search {
  margin: 0 22px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface-variant);
  color: var(--on-surface-variant);
  flex-shrink: 0;
}
.handbook-search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 10px 0;
}
.handbook-search-input::placeholder { color: var(--on-surface-variant); opacity: .8; }
.handbook-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 11px 22px 9px;
  flex-shrink: 0;
}
.handbook-tabs::-webkit-scrollbar { display: none; }
.handbook-tab {
  flex: 0 0 auto;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.handbook-tab.on {
  color: var(--on-primary);
  border-color: var(--primary-fill);
  background: var(--primary-fill);
}
.handbook-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 8px 22px 26px;
  text-align: left;
}
.handbook-chapter-head { padding: 8px 2px 18px; }
.handbook-chapter-kicker {
  font-size: 10px;
  color: var(--primary);
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: 6px;
}
.handbook-chapter-title {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.35;
  color: var(--on-bg);
  font-weight: 700;
}
.handbook-chapter-lead {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.75;
}
.handbook-items { display: flex; flex-direction: column; gap: 10px; }
.handbook-item {
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 15px 15px;
  scroll-margin: 24px;
}
.handbook-item.is-tip {
  border-left: 3px solid var(--primary);
  background: var(--surface-variant);
}
.handbook-item.is-warn { border-left: 3px solid #B7791F; }
.handbook-item.is-focus { animation: handbook-focus 1.3s ease-out; }
.handbook-item-head { display: flex; align-items: center; gap: 9px; }
.handbook-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  background: var(--surface-variant);
}
.handbook-item-title {
  margin: 0;
  color: var(--on-surface);
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 650;
}
.handbook-item-text {
  margin-top: 9px;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.82;
}
.handbook-item-text > div:empty { min-height: .55em; }
.handbook-action {
  margin-top: 11px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.handbook-results { display: flex; flex-direction: column; gap: 9px; }
.handbook-result {
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 13px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.handbook-result > svg { grid-row: 1 / span 3; grid-column: 2; align-self: center; color: var(--on-surface-variant); }
.handbook-result-kicker { font-size: 10px; color: var(--primary); font-weight: 700; }
.handbook-result-title { font-size: 13.5px; font-weight: 650; color: var(--on-surface); }
.handbook-result-body {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.handbook-empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 13px;
  line-height: 1.7;
}
.handbook-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline);
  background: var(--surface);
}
.handbook-foot-note { flex: 1; font-size: 11px; color: var(--on-surface-variant); }
.handbook-help-link { text-decoration: none; }
.handbook-help-link:active { color: var(--primary); }
.handbook-done {
  flex: 0 0 108px;
  padding: 9px 0;
  border-radius: 9px;
}
@keyframes handbook-focus {
  0% { box-shadow: 0 0 0 0 var(--primary); }
  30% { box-shadow: 0 0 0 3px var(--primary); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (max-width: 520px) {
  .handbook-overlay { padding: 0; align-items: stretch; }
  .handbook-card {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .handbook-head { padding: calc(16px + env(safe-area-inset-top)) 16px 10px; }
  .handbook-title { font-size: 22px; }
  .handbook-search { margin: 0 16px; }
  .handbook-tabs { padding: 10px 16px 8px; }
  .handbook-body { padding: 7px 16px 22px; }
  .handbook-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .handbook-foot-note { font-size: 10px; }
}
@media (max-width: 340px) {
  .handbook-sub { display: none; }
  .handbook-foot-note { display: none; }
  .handbook-done { flex-basis: 100%; }
}

/* ---------- 角色声音 · 内部实验室（2026-11-03） ---------- */
.voice-lab-sheet .ui-sheet-body {
  padding: 0 14px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 4%, rgba(198, 126, 86, .13), transparent 32%),
    var(--surface);
}
.voice-lab {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.voice-hero {
  position: relative;
  overflow: hidden;
  margin: 2px -14px 0;
  padding: 22px 18px 18px;
  color: #f8efe2;
  background:
    radial-gradient(circle at 84% 0%, rgba(241, 175, 105, .55), transparent 34%),
    linear-gradient(138deg, #2b1e1a 0%, #55342a 48%, #9a5b3f 100%);
  isolation: isolate;
}
.voice-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.voice-hero-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  opacity: .72;
}
.voice-hero-title {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .03em;
}
.voice-hero-copy {
  max-width: 420px;
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(255, 248, 238, .78);
}
.voice-hero-wave {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 13px;
  opacity: .85;
}
.voice-hero-wave i {
  width: 3px;
  height: 10px;
  border-radius: 9px;
  background: rgba(255, 240, 218, .86);
}
.voice-hero-wave i:nth-child(3n) { height: 22px; }
.voice-hero-wave i:nth-child(4n) { height: 15px; }
.voice-hero-wave i:nth-child(5n) { height: 29px; opacity: .55; }
@keyframes voiceWave {
  0%, 100% { transform: scaleY(.7); }
  50% { transform: scaleY(1.15); }
}
.voice-hero-wave i {
  transform-origin: center;
  animation: voiceWave 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -73ms);
}
.voice-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 10.5px;
  color: rgba(255, 248, 238, .65);
}
.voice-usage span {
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(0,0,0,.08);
}
.voice-soon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.voice-soon-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 11px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-variant));
}
.voice-soon-card svg { color: var(--primary-text); }
.voice-soon-card b { font-size: 12px; font-weight: 600; }
.voice-soon-card span { font-size: 10.5px; line-height: 1.55; color: var(--on-surface-variant); }
.voice-soon-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px 4px;
  font-size: 11.5px;
  color: var(--on-surface-variant);
}
.voice-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-text);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-text) 14%, transparent);
}
.voice-editor {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.voice-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.voice-section-head-list { margin-top: 8px; }
.voice-section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--primary-text);
}
.voice-section-head h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.voice-section-note {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--on-surface-variant);
}
.voice-select {
  width: 100%;
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--outline);
  border-radius: 11px;
  background: var(--surface);
  color: var(--on-surface);
  font: inherit;
}
.voice-mode-label {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 11px;
  border-left: 2px solid var(--primary-text);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--on-surface);
  font-size: 11.5px;
}
.voice-tool-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.voice-filter-row { display: flex; }
.voice-search {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--surface);
  color: var(--on-surface);
  font: inherit;
  font-size: 12px;
}
.voice-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.voice-chips::-webkit-scrollbar { display: none; }
.voice-chip {
  flex: none;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 11px;
}
.voice-chip.active {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}
.voice-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--outline);
  border-radius: 13px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-variant));
}
.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 10px 10px 12px;
  background: transparent;
}
.voice-row + .voice-row { border-top: 1px solid var(--outline); }
.voice-row.is-active {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  box-shadow: inset 2px 0 var(--primary-text);
}
.voice-row-main { flex: 1; min-width: 0; }
.voice-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.voice-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}
.voice-gender, .voice-current {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  font-size: 9px;
  color: var(--on-surface-variant);
}
.voice-current {
  border-color: color-mix(in srgb, var(--primary-text) 38%, var(--outline));
  color: var(--primary-text);
}
.voice-id {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--on-surface-variant);
  opacity: .72;
}
.voice-row-actions { display: flex; gap: 5px; flex: none; }
.voice-mini-btn {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 10.5px;
}
.voice-mini-btn.primary {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--outline));
  color: var(--primary-text);
}
.voice-mini-btn:disabled { opacity: .45; }
.voice-load-more {
  min-height: 38px;
  border: 1px dashed var(--outline);
  border-radius: 10px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 11px;
}
.voice-empty, .voice-lab-loading, .voice-lab-error {
  padding: 24px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--on-surface-variant);
}
.voice-lab-error b { color: var(--on-surface); }
.voice-lab-error p { margin: 6px 0 14px; }
.voice-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface);
}
.voice-settings-copy { display: flex; flex-direction: column; gap: 2px; }
.voice-settings-copy b { font-size: 12px; }
.voice-settings-copy span { font-size: 10.5px; color: var(--on-surface-variant); }
.voice-read-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 160px);
}
.voice-read-settings .voice-settings-copy { min-width: 0; }
.voice-read-settings .voice-settings-copy b,
.voice-read-settings .voice-settings-copy span { font-size: 14px; line-height: 1.5; }
@media (max-width: 430px) {
  .voice-read-settings { grid-template-columns: minmax(0, 1fr); }
}
.voice-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 7px 4px 4px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  /* 2026-11-07：9.5px 低于设计契约的辅助字号下限（11-12px），手机上再加上一行字被隐藏，
     实际只剩一个无标注圆点。抬到 11px 与契约对齐。 */
  font-size: 11px;
}
.voice-switch-dot {
  width: 24px;
  height: 16px;
  border-radius: 99px;
  background: var(--outline);
  position: relative;
}
.voice-switch-dot::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .18s ease;
}
.voice-switch.on {
  color: var(--primary-text);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--outline));
}
.voice-switch.on .voice-switch-dot { background: var(--primary); }
.voice-switch.on .voice-switch-dot::after { transform: translateX(8px); }
.voice-save-wrap {
  width: 100%;
  padding: 2px 0;
}
.voice-save-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
}
.voice-read-btn.is-loading svg,
.voice-read-btn.is-playing svg { animation: voiceReadPulse 1s ease-in-out infinite; }
.voice-read-btn.is-playing { color: var(--primary-text); }
@keyframes voiceReadPulse {
  0%, 100% { opacity: .45; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.08); }
}
@media (max-width: 430px) {
  .voice-hero { padding: 19px 15px 15px; }
  .voice-hero-title { font-size: 24px; }
  .voice-soon-grid { grid-template-columns: 1fr; }
  .voice-soon-card { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .voice-soon-card span { flex-basis: 100%; padding-left: 25px; }
  .voice-row { align-items: flex-start; }
  .voice-row-actions { flex-direction: column; }
  /* 2026-11-07：窄屏原来把「自动朗读新回复」这行字 display:none 掉了，手机上只剩一个
     没有标注的圆点——会员反馈「找不到关闭自动朗读的选项」正是撞在这里。
     现在文字始终显示：允许折行，把开关让到右侧、文字占满剩余宽度。 */
  .voice-settings {
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .voice-settings-copy { flex: 1 1 auto; min-width: 0; }
  .voice-settings .voice-switch {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .voice-hero-wave i,
  .voice-read-btn.is-loading svg,
  .voice-read-btn.is-playing svg { animation: none; }
}

/* 会员预付月数与支付窗口 */
.mx-months-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mx-months-label { font-size: 13px; color: var(--on-surface-variant); }
.mx-months-select { width: 128px; min-height: 38px; margin: 0; padding: 6px 30px 6px 10px; }
/* ---- 扫码付款（北京时间夜间人工审核时段，pay-page.js 的面板用） ---- */
/* ---------- 通用生图（2026-11-05） ---------- */
.imgstudio-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.imgstudio-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -36px;
  right: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(204, 120, 92, .13) 0%, rgba(204, 120, 92, 0) 68%);
}
.imgstudio-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 2px 4px;
}
.imgstudio-back {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: var(--surface);
  color: var(--on-bg);
  font-size: 20px;
  line-height: 1;
}
.imgstudio-back:active { background: var(--surface-variant); }
.imgstudio-head-copy { min-width: 0; }
.imgstudio-kicker {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .13em;
  color: var(--primary-text);
}
.imgstudio-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.imgstudio-head p {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--on-surface-variant);
}
.imgstudio-wallet {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  padding: 18px 18px 17px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  color: #f7f1e9;
  background:
    radial-gradient(circle at 86% 12%, rgba(221, 166, 116, .3) 0%, rgba(221, 166, 116, 0) 45%),
    linear-gradient(145deg, #21191b 0%, #11131a 58%, #0b0c11 100%);
  box-shadow: 0 12px 30px rgba(10, 8, 8, .12);
}
.imgstudio-wallet::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  opacity: .38;
  background-image:
    radial-gradient(1px 1px at 18% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 16%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 82% 68%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 78%, #fff 50%, transparent 51%);
}
.imgstudio-wallet-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.imgstudio-wallet-label {
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .64);
}
.imgstudio-balance {
  margin: 2px 0 1px;
  font-family: var(--font-display);
  font-size: 35px;
  line-height: 1.15;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.imgstudio-balance-sub {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .6);
}
.imgstudio-wallet-mark {
  margin-left: auto;
  color: rgba(235, 189, 146, .85);
  font-size: 34px;
  text-shadow: 0 0 22px rgba(235, 189, 146, .45);
}
.imgstudio-wallet-go {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: 11.5px;
}
.imgstudio-card {
  border: 1px solid var(--outline);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(21, 16, 13, .035);
}
.imgstudio-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
}
.imgstudio-sec-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.imgstudio-sec-head > div { min-width: 0; }
.imgstudio-sec-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.35;
}
.imgstudio-sec-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--on-surface-variant);
}
.imgstudio-step {
  flex: 0 0 auto;
  min-width: 28px;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--primary-text);
}
.imgstudio-prompt {
  display: block;
  width: 100%;
  min-height: 128px;
  resize: vertical;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  outline: none;
  background: var(--bg);
  color: var(--on-bg);
  font-size: 14px;
  line-height: 1.75;
  -webkit-user-select: text;
  user-select: text;
}
.imgstudio-prompt:focus { border-color: var(--primary); }
.imgstudio-prompt::placeholder { color: var(--on-surface-variant); opacity: .8; }
.imgstudio-prompt-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: -6px;
  font-size: 10.5px;
  color: var(--on-surface-variant);
}
.imgstudio-count { font-family: var(--font-mono); }
.imgstudio-count.is-near { color: var(--primary-text); }
.imgstudio-ref { min-width: 0; }
.imgstudio-ref[hidden], .imgstudio-ref [hidden], .imgstudio-ref-hint:empty { display: none; }
.imgstudio-ref-add,
.imgstudio-ref-actions button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-text);
  font: inherit;
  font-size: 13px;
}
.imgstudio-ref-add { display: inline-flex; align-items: center; gap: 5px; padding-left: 0; }
.imgstudio-ref button:hover:enabled { background: var(--surface-variant); }
.imgstudio-ref button:disabled { opacity: .6; }
.imgstudio-ref-row { display: flex; align-items: center; gap: 11px; }
.imgstudio-ref-thumb {
  flex: 0 0 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--bg);
}
.imgstudio-ref-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.imgstudio-ref-summary { display: flex; min-width: 0; flex-direction: column; }
.imgstudio-ref-title { font-size: 13px; }
.imgstudio-ref-actions { display: flex; gap: 4px; margin-left: -8px; }
.imgstudio-ref-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  max-width: 380px;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
}
.imgstudio-ref-choices legend { margin-bottom: 6px; padding: 0; font-size: 12px; color: var(--on-surface-variant); }
.imgstudio-ref-choices label { position: relative; min-width: 0; }
.imgstudio-ref-choices input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.imgstudio-ref-choices label span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 4px 2px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  color: var(--on-bg);
  background: var(--bg);
  text-align: center;
  font-size: 12px;
  cursor: pointer;
}
.imgstudio-ref-choices input:checked + span {
  border-color: var(--primary);
  background: var(--surface-variant);
  color: var(--primary-text);
  font-weight: 700;
}
.imgstudio-ref-choices input:focus + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.imgstudio-ref-choices input:disabled + span { opacity: .6; cursor: default; }
.imgstudio-ref-hint { margin: 6px 0 0; color: var(--on-surface-variant); font-size: 12px; line-height: 1.5; }
.imgstudio-ref-hint.is-error { color: var(--primary-text); }
.imgstudio-divider { height: 1px; background: var(--outline); }
.imgstudio-models {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 8px;
}
.imgstudio-model {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--bg);
  color: var(--on-bg);
  text-align: left;
  font: inherit;
}
.imgstudio-model::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: transparent;
}
.imgstudio-model.is-active {
  border-color: var(--primary);
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.imgstudio-model.is-active::after {
  border-color: var(--primary);
  background: var(--primary);
}
.imgstudio-model-name { font-size: 13px; font-weight: 700; line-height: 1.35; padding-right: 13px; }
.imgstudio-model-note { font-size: 10.5px; line-height: 1.45; color: var(--on-surface-variant); }
.imgstudio-model-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: auto;
  padding-top: 3px;
}
.imgstudio-model-price strong { font-family: var(--font-mono); font-size: 12px; color: var(--primary-text); }
.imgstudio-model-price small { font-size: 9.5px; color: var(--on-surface-variant); }
.imgstudio-ratios { display: flex; flex-wrap: wrap; gap: 7px; }
.imgstudio-ratio {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 11.5px;
}
.imgstudio-ratio.is-active {
  border-color: var(--primary);
  background: var(--primary-fill);
  color: var(--on-primary);
}
.imgstudio-rule {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  border: 1px dashed var(--outline);
  border-radius: 10px;
  color: var(--on-surface-variant);
  font-size: 10.5px;
  line-height: 1.6;
}
.imgstudio-rule svg { flex: 0 0 auto; margin-top: 1px; color: var(--primary-text); }
.imgstudio-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}
.imgstudio-cost {
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--on-surface-variant);
}
.imgstudio-generate {
  flex: 0 0 auto;
  min-width: 132px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: var(--primary-fill);
  color: var(--on-primary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
}
.imgstudio-generate:active { transform: scale(.98); }
.imgstudio-generate:disabled { opacity: .45; }
.imgstudio-result-card { padding: 18px; }
.imgstudio-result {
  margin-top: 13px;
  min-height: 190px;
}
.imgstudio-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 22px 18px;
  border: 1px dashed var(--outline);
  border-radius: 13px;
  background: var(--bg);
  text-align: center;
}
.imgstudio-result-empty strong { margin-top: 8px; font-family: var(--font-display); font-size: 16px; }
.imgstudio-result-empty p {
  max-width: 360px;
  margin: 6px 0 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--on-surface-variant);
}
.imgstudio-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  color: var(--primary-text);
  font-family: var(--font-display);
  font-size: 19px;
}
.imgstudio-result-empty.is-error .imgstudio-result-icon {
  border-color: var(--error);
  color: var(--error);
}
.imgstudio-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--outline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: imgstudio-spin .9s linear infinite;
}
@keyframes imgstudio-spin { to { transform: rotate(360deg); } }
.imgstudio-result-image { animation: imgstudio-rise .3s ease-out backwards; }
@keyframes imgstudio-rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.imgstudio-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 220px;
  max-height: 68vh;
  border-radius: 13px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .035) 75%),
    #0b0d12;
  background-size: 18px 18px;
}
.imgstudio-image {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}
/* 点图看大图（2026-11-13）：给个「能放大」的指针语义，和在别处的图一致 */
.imgstudio-image-frame.is-zoomable { cursor: zoom-in; }
.imgstudio-image-frame.is-zoomable:focus-visible { outline: 2px solid var(--primary, #cc785c); outline-offset: -2px; }
.imgstudio-image { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.imgstudio-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}
.imgstudio-result-meta > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imgstudio-result-meta strong { font-size: 13px; }
.imgstudio-result-meta span { font-size: 10.5px; color: var(--on-surface-variant); }
.imgstudio-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.imgstudio-result-actions .btn { min-height: 38px; padding: 0 13px; font-size: 12px; text-decoration: none; }
@media (max-width: 430px) {
  .imgstudio-head h1 { font-size: 24px; }
  .imgstudio-wallet { min-height: 108px; padding: 16px; }
  .imgstudio-balance { font-size: 31px; }
  .imgstudio-wallet-mark { font-size: 27px; }
  .imgstudio-form, .imgstudio-result-card { padding: 15px; }
  .imgstudio-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .imgstudio-model { min-height: 104px; padding: 11px 10px; }
  .imgstudio-model-name { font-size: 12px; }
  .imgstudio-result-meta { align-items: flex-start; flex-direction: column; }
  .imgstudio-result-actions { width: 100%; justify-content: flex-start; }
  .imgstudio-submit { align-items: stretch; flex-direction: column; }
  .imgstudio-generate { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .imgstudio-spinner { animation-duration: 2.4s; }
  .imgstudio-result-image { animation: none; }
}

/* ---------- 角色电话 · 通话页（2026-11-07 第一刀） ---------- */
/* 全屏覆盖：电话是一个独占的场景，不做成弹层 —— 半透明的壳会让用户以为还能滑走。 */
.call-page {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column;
  color: #f6efe4;
  background:
    radial-gradient(circle at 50% 12%, rgba(198, 126, 86, .38), transparent 46%),
    linear-gradient(170deg, #241a16 0%, #120e0c 58%, #0b0807 100%);
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  animation: callIn .22s ease-out;
}
@keyframes callIn { from { opacity: 0; transform: scale(.985); } }
@media (prefers-reduced-motion: reduce) { .call-page { animation: none; } }

.call-top { flex: none; text-align: center; padding-top: 8px; }
.call-peer {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: .04em;
}
.call-peer-sub { margin-top: 5px; font-size: 11px; letter-spacing: .12em; opacity: .55; }

/* 中段布局（2026-11-07 截图两轮迭代）：
   第一版 justify-content:center 把内容钉在正中，底部按钮是独立区域 ⇒ 空对话时
   计时器下方空出 400px；第二版改成 flex-start 又把内容全挤到顶部，空对话时
   下面还是一片空白。
   最终做法：**用两条弹性留白把内容夹在偏上位置**。
   电话的视觉重心该在球和状态上（视线中心偏上），既不能贴顶也不能居中。
   · .call-spacer-top / .call-spacer-bot 由 CSS 生成，比例 3:4，
     内容自然落在约 43% 高度处，且对话流变长时会先吃掉下方留白。 */
.call-mid {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
}
/* 顶部固定呼吸 + 底部固定收尾，中间全给对话流。
   2026-11-07 第三轮：头像换成人物照片后视觉重心被拉高，「下面一大片空」更刺眼。
   所以把弹性留白从「上下各一份」改成「全部交给对话流」——
   有内容时它填满，没内容时它自己 display:none，剩下的空间由 flex 自然分配，
   看起来是安静的留白而不是断裂的空白。 */
/* 空态（还没说第一句话）：头像+状态整体居中偏上，下方那片空由上下两份留白均分，
   看起来是「电话接通了在等你开口」的安静，而不是「内容没加载出来」的断裂。
   说第一句之后 JS 摘掉 is-idle，切回紧凑布局（见 call.js pushLine）。 */
/* 居中会显得偏低（底部按钮占了视觉重量，内容得往上抬一点才「看着居中」）。
   用 padding-bottom 顶上来，而不是再动 justify —— 保持简单可预测。 */
.call-mid.is-idle {
  justify-content: center;
  padding-bottom: max(10vh, 64px);
}
.call-mid.is-idle::before { display: none; }
.call-mid.is-idle .call-transcript { flex: 0; display: none; }
/* 有对话时：顶部固定一点呼吸，其余全给对话流 */
.call-mid:not(.is-idle)::before { content: ''; flex: 0 0 auto; height: max(4vh, 20px); }

/* 中间的头像位（2026-11-07 用户建议：把声波球换成人物的头像）。
   结构 = 圆形壳（.call-orb）+ 头像（.cavatar.call-avatar）+ 脉冲环（::before）。
   脉冲环单独画在壳外面，不压头像 —— 头像要看清脸，不能被光环糊住。
   用 ::before 而不是 box-shadow 扩散，是为了让环和头像各自独立动画。 */
.call-orb {
  position: relative;
  width: 132px; height: 132px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #f8e7d2;
  flex: none;
  /* 壳本体只留一点点底光，主要靠头像自己 */
  background: radial-gradient(circle at 50% 20%, rgba(241, 175, 105, .16), transparent 70%);
}
/* 头像：盖满壳内圈，留 3px 边让环透出来 */
.call-orb .cavatar.call-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background-size: cover; background-position: center 20%;
  border: 2px solid rgba(255, 232, 204, .22);
  font-size: 44px;
  display: flex; align-items: center; justify-content: center;
  color: #f8e7d2;
  overflow: hidden;
}
/* 回退（没有立绘/头像，只有名字首字）：给一层暖色底，不至于像一个空洞 */
.call-orb .cavatar.call-avatar.fallback {
  background: radial-gradient(circle at 34% 30%, rgba(241, 175, 105, .5), rgba(122, 66, 45, .34) 70%);
}
.call-avatar--icon { display: flex; align-items: center; justify-content: center; }
/* 脉冲环：贴在头像外沿向外扩散 */
.call-orb::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(241, 175, 105, .42);
  animation: callRing 3.1s ease-out infinite;
  pointer-events: none;
}
@keyframes callRing {
  0%   { transform: scale(1);    opacity: .55; }
  70%  { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .call-orb::before { animation: none; opacity: .3; } }
/* 正在听：环变快变亮，让「在录」这件事余光里也看得见；头像本身不动 */
.call-orb.is-listening::before {
  border-color: rgba(255, 138, 96, .85);
  animation-duration: 1.05s;
}
.call-orb.is-listening { box-shadow: 0 0 0 3px rgba(255, 138, 96, .18); border-radius: 50%; }
/* 断线 / 警告：环停掉、头像压暗，一眼看出不是活的了 */
.call-orb.is-warn::before { animation: none; border-color: rgba(150, 140, 130, .3); }
.call-orb.is-warn .cavatar.call-avatar { filter: grayscale(.55) brightness(.72); }
.call-orb.is-warn { background: none; }

.call-status-title { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
/* 副标题（2026-11-07 截图中改）：30ch 太窄，「……没送出去」被拆成「没送出 / 去」，
   末行只有一个字很难看。放宽到 24em 并允许平衡断行。
   text-wrap: balance 老内核不认，会退化成普通换行 —— 不影响正确性。 */
.call-status-sub {
  font-size: 12px; line-height: 1.65; opacity: .62; text-align: center;
  max-width: 24em; text-wrap: balance;
}
.call-timer {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: .12em; opacity: .48;
}

/* 对话流（2026-11-07 截图中改）：原来「我」只有文字右对齐、名字标签还留在左边，
   四行看下来分不清谁在说话。改成**按人整体左右分栏**：
   我说的整行靠右对齐（名字在文字上方、同样靠右），Ta 说的整行靠左。
   这样扫一眼就知道轮到谁，不必去读那个小标签。 */
.call-transcript {
  flex: 1;
  width: 100%; max-width: 420px;
  min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 7px;
  /* 顶部留一点，避免第一行贴着计时器 */
  padding: 6px 2px 8px;
  font-size: 12.5px; line-height: 1.6;
}
/* 每一行是一个「发言块」：上面名字、下面正文，整体靠边 */
.call-line {
  display: flex; flex-direction: column; gap: 2px;
  max-width: 88%;
}
.call-line--ta { align-self: flex-start; align-items: flex-start; }
.call-line--me { align-self: flex-end; align-items: flex-end; }
.call-line-who { font-size: 10.5px; opacity: .48; letter-spacing: .02em; }
.call-line-text { min-width: 0; word-break: break-word; }
.call-line--me .call-line-text { text-align: right; opacity: .95; }
.call-line--ta .call-line-text { opacity: .86; }

.call-bottom {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 34px;
  padding-top: 10px;
}
.call-hold {
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid rgba(255, 232, 204, .26);
  background: rgba(255, 240, 222, .10);
  color: #f8e7d2; font: inherit;
  touch-action: none; /* 按住说话时别让浏览器把手指位移当成滚动 */
  -webkit-user-select: none; user-select: none;
  transition: transform .1s ease, background .15s ease;
}
.call-hold:active { transform: scale(.97); }
.call-hold.is-recording {
  background: rgba(255, 122, 88, .30);
  border-color: rgba(255, 160, 120, .60);
}
.call-hold:disabled { opacity: .5; }
.call-hold-label { font-size: 10px; letter-spacing: .06em; }
.call-hang {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: #c8452f; color: #fff;
  font: inherit;
}
.call-hang svg { transform: rotate(135deg); } /* 电话图标转 135° 就是「挂断」 */
.call-hang:active { transform: scale(.96); }

/* 电话断线 / 服务重启后的收口态（2026-11-07 自查补）：
   此时按住键已经没有意义，必须看起来就是「死的」—— 否则用户会一直按。 */
.call-hold.is-dead {
  opacity: .34;
  border-style: dashed;
  background: rgba(255, 240, 222, .04);
}
.call-hold.is-dead .call-hold-label { opacity: .6; }
/* 挂断键变成「退出 / 重拨」：给一个比红色更中性的收口色，
   红色在这里会像「再点一下就重连」，而实际行为是退出。 */
.call-hang.is-recall { background: #6b4a3a; }
.call-hang.is-retry-exit { background: #4a4038; }

/* 断线后计时器冻住（2026-11-07 截图中补）：时间停住 + 更暗，
   避免「计时器还跳着 = 还连着」的错觉。 */
.call-timer.is-frozen { opacity: .3; }

/* 对话流尾部渐隐（2026-11-07 第四轮）：头像成为视觉重心后，
   对话流下方那片空白显得「断裂」。在对话区底部加一层极淡的向下渐隐，
   让视线从文字自然过渡到按钮，而不是撞到一块死黑。
   全透明 → 背景色的线性渐变，不引入任何新颜色。 */
.call-transcript {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 10px), transparent 100%);
}

/* 世界记忆多选：分类隔离，复用现有记忆卡片与按钮。 */
.dmem-select-controls { display: flex; flex-wrap: wrap; align-items: center; margin: -4px; }
.dmem-select-controls > * { margin: 4px; }
.dmem-select-controls .btn { min-height: 44px; }
.dmem-select-count { flex: 1 0 100%; font-size: 13px; color: var(--on-bg); font-variant-numeric: tabular-nums; }
.dmem-selection-host > * + * { margin-top: 8px; }
.dmem-selection-message { margin: 0; font-size: 13px; line-height: 1.6; color: var(--on-bg); overflow-wrap: anywhere; }
.dmem-selection-message:empty { display: none; }
.dmem-choice { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.dmem-choice input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0 10px 0 0; accent-color: var(--primary); }
.dmem-choice-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dmem-item.is-selected { border-color: var(--primary); background: var(--surface-variant); }
.dmem-choice:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
/* 回复正文外侧的生图操作，独立于历史消息中隐藏的操作栏。 */
.illustration-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  padding: 0 4px;
  background: transparent;
}
.illustration-actions[hidden] { display: none; }
.illustration-entry {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  max-width: 100%;
  padding: 2px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font: 11px var(--font-mono, sans-serif);
  cursor: pointer;
}
.illustration-entry::after { content: ''; position: absolute; left: 0; right: 0; height: 44px; top: 50%; transform: translateY(-50%); }
.illustration-entry svg { width: 12px; height: 12px; margin-right: 4px; flex-shrink: 0; }
.illustration-entry:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.illustration-entry:hover:not(:disabled), .illustration-entry:active:not(:disabled) { color: var(--primary-text); }
.illustration-entry:disabled { opacity: .55; cursor: wait; }
.msg-tools-row { display: flex; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.msg-tools-row > .illustration-actions { padding: 0; }
.th-stream .msg-group .msg-tools-row .msg-actions { margin: 0; }
.msg-group:not(.is-latest) .msg-tools-row > .msg-actions { display: none; }
.msg-group:not(.is-latest):hover .msg-tools-row > .msg-actions,
.msg-group:not(.is-latest):focus-within .msg-tools-row > .msg-actions { display: inline-flex; }
.dream-line.narrator > .illustration-actions { white-space: normal; }
.vn-stage > .illustration-actions { position: relative; z-index: 2; margin: -8px 12px 12px; padding: 0; }
.vn-wrap .illustration-entry { color: #F0EFEA; background: transparent; border-color: rgba(255,255,255,.18); }

/* ---------- 卷宗生图：保留期取后端响应，带倒计时与下载 ---------- */
.msg-illustrate {
  margin: 10px 0; padding: 10px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--outline);
  font-size: 13px; color: var(--on-surface-variant);
  max-width: 320px;
}
.msg-illustrate-loading { opacity: .75; }
.msg-illustrate-error { color: var(--error); }
.msg-illustrate-body { display: block; }
.msg-illustrate-img {
  display: block; width: 100%; max-height: 240px; object-fit: cover;
  border-radius: 10px; cursor: zoom-in;
}
/* 过期占位：不要留空 <img>（浏览器会画破图图标 + alt 文字，看着像故障） */
.msg-illustrate-expired {
  display: flex; align-items: center; justify-content: center;
  height: 120px; border-radius: 10px;
  background: var(--surface-variant, rgba(127, 127, 127, .12));
  color: var(--on-surface-variant); font-size: 13px;
}
.msg-illustrate-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 8px;
}
.msg-illustrate-note { font-size: 12px; opacity: .8; }
.msg-illustrate-dl {
  flex-shrink: 0; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--outline); background: var(--surface); color: var(--on-bg);
  font-size: 12px;
}
.msg-illustrate-dl:disabled { opacity: .5; cursor: default; }

/* 图片结果独立于聊天消息重绘；状态入口始终留在输入区附近。
   2026-11-18（工单：生成图片之后提示一直在、刷新也不掉）：整条不再是一个按钮——
   左边「查看进度 / 查看图片」，右边「×」关掉这次的结果；生成中不出现 ×。 */
.illustration-notice {
  display: flex; align-items: stretch; flex-shrink: 0; width: 100%;
  border-top: 1px solid var(--outline); background: var(--surface);
  color: var(--primary-text); font-size: 12px; line-height: 1.6;
}
.illustration-notice-main {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
.illustration-notice-undo {
  flex: none; min-width: 64px; min-height: 44px; padding: 0 12px;
  border: 0; background: none; color: inherit; font: inherit; font-weight: 600;
  cursor: pointer;
}
.illustration-notice-x {
  flex: none; width: 44px; min-height: 44px; border: 0; background: none;
  color: inherit; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: .65;
}
.illustration-notice-x:hover, .illustration-notice-x:focus-visible { opacity: 1; }
.illustration-notice-main:focus-visible,
.illustration-notice-undo:focus-visible,
.illustration-notice-x:focus-visible {
  outline: 2px solid var(--primary-text); outline-offset: -2px;
}
.illustration-notice-x[hidden], .illustration-notice-undo[hidden] { display: none; }
.illustration-results { padding: 10px 12px; flex-shrink: 0; }
.illustration-notice[hidden], .illustration-results[hidden] { display: none; }
.illustration-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--on-bg); }
.illustration-lookup-message { margin: 8px 0; color: var(--on-bg); font-size: 12px; line-height: 1.7; }
.illustration-results .msg-illustrate { max-width: 100%; margin: 8px 0; }
.illustration-results .msg-illustrate-img { max-height: 240px; object-fit: contain; }
.illustration-results .msg-illustrate-note { opacity: 1; }
.illustration-results .msg-illustrate-expired { height: auto; min-height: 0; display: block; padding: 10px 12px; }
.vn-stage > .illustration-results { position: relative; z-index: 2; max-height: 30%; overflow-y: auto; margin: 0 12px 8px; background: #14161e; color: #f3efe8; border-radius: 8px; }
.vn-wrap .illustration-results-head { color: #f3efe8; }
.vn-wrap .illustration-results .msg-illustrate { background: #1c1f28; color: #f3efe8; border-color: rgba(255,255,255,.18); }
.vn-wrap .illustration-results .msg-illustrate-dl { color: #f0a88c; background: transparent; border-color: rgba(255,255,255,.18); }
.vn-wrap .illustration-notice { color: #f0a88c; background: #14161e; border-color: rgba(255,255,255,.12); }
.wx-light .illustration-notice { background: var(--wx-bar); color: var(--wx-text); border-color: var(--wx-sep); }

/* ---------- 角色卡：生图锁脸开关（2026-11-12） ---------- */
.cf-toggle-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; font-size: 13px; color: var(--on-surface-variant); cursor: pointer;
}
.cf-toggle-row .cf-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }

/* ---------- 生图比例选择（2026-11-12） ---------- */
.ill-sheet { padding-top: 14px; }
.ill-title { font-size: 15px; font-weight: 600; color: var(--on-bg); padding: 0 4px; }
.ill-sub { font-size: 12px; opacity: .6; padding: 4px 4px 10px; color: var(--on-bg); }
.ill-ratio-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 2px 8px;
}
.ill-ratio {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--outline); background: var(--surface); color: var(--on-bg);
  font-family: inherit; text-align: left;
}
.ill-ratio.is-default { border-color: var(--primary); }
.ill-ratio:active { transform: scale(.985); }
.ill-ratio-label { font-size: 14px; font-weight: 600; }
.ill-ratio-id { font-size: 12px; opacity: .75; }
.ill-ratio-note { font-size: 11px; opacity: .5; }
.ill-options-sheet { max-height: calc(100% - 12px); overflow-y: auto; }
.ill-model-label { display: block; margin: 6px 4px 4px; font-size: var(--fs-meta); color: var(--on-surface); }
.ill-model-select {
  display: block; width: 100%; min-height: var(--tap); padding: 9px 12px;
  border: 1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--on-bg); font: 16px var(--font-sans);
}
.ill-model-select:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.ill-model-note { margin: 4px 4px 2px; font-size: var(--fs-meta); color: var(--on-surface); min-height: 18px; }
.ill-options-sheet .ill-ratio-note { opacity: 1; color: var(--on-surface); }
.ill-status { padding: 4px; font-size: var(--fs-meta); line-height: 1.6; color: var(--on-surface); }
.ill-status.is-error { color: var(--error); }
.ill-options-sheet .ill-confirm { min-height: var(--tap); text-align: center; background: var(--primary-fill); color: var(--on-primary); border-radius: var(--r-ctl); }
.ill-confirm:disabled { opacity: .55; cursor: not-allowed; }
.ill-confirm:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }

/* ---------- 梦信深色弹层（2026-11-13）----------
   梦信能单独切深色（html[data-wx-theme]，utils.js 的 setWxTheme），但那套深色只换 --wx-* 变量，
   只作用在 .ta-wechat 容器里。而弹层（底部 sheet、确认框）都挂在 document.body 上、用的是 App 全局色板
   ⇒ 页面是黑的、点「让他拍个照」或「删除聊天」弹出来是白的。
   这里把「沉浸态里弹出的弹层」的 token 换一份深色：
     · body[data-ta-mode='1'] —— 梦信/Ta 进入沉浸态时打的标（utils.js setTaMode），离开即 '0'
     · .sheet.is-wx —— 生图确认弹窗显式带的类（双保险，也方便单独排查）
   覆盖 .sheet（底部弹层，含 openSheet 与各页自搭的）与 .modal-card（确认/提示框）。
   ⛔ 不碰 .wx-action-sheet：它本来就用 --wx-bar，已经跟着梦信深色走了。 */
html[data-wx-theme='dark'] body[data-ta-mode='1'] .sheet,
html[data-wx-theme='dark'] body[data-ta-mode='1'] .modal-card,
html[data-wx-theme='dark'] .sheet.is-wx {
  --bg: #14161B; --on-bg: #F0EFEA;
  --surface: rgba(38, 43, 55, .86); --surface-variant: rgba(50, 56, 70, .9);
  --on-surface: #B7BAC2; --on-surface-variant: #8D919B;
  --outline: rgba(255, 255, 255, .12);
  --primary: #D98A72; --primary-fill: #D98A72; --primary-text: #E7A48D; --on-primary: #17181C;
  --error: #E08772;
  /* 必须显式写 color：颜色是**继承**来的，只在容器上换 token 改不了已经被 body 算好的颜色，
     .modal-title 这种自己不写 color 的元素会继续用深色字压深色底（2026-11-13 截图抓到）。 */
  color: var(--on-bg);
  color-scheme: dark; /* 原生 <select> 的下拉也跟着深色 */
}
@media (prefers-color-scheme: dark) {
  html:not([data-wx-theme='light']) body[data-ta-mode='1'] .sheet,
  html:not([data-wx-theme='light']) body[data-ta-mode='1'] .modal-card,
  html:not([data-wx-theme='light']) .sheet.is-wx {
    --bg: #14161B; --on-bg: #F0EFEA;
    --surface: rgba(38, 43, 55, .86); --surface-variant: rgba(50, 56, 70, .9);
    --on-surface: #B7BAC2; --on-surface-variant: #8D919B;
    --outline: rgba(255, 255, 255, .12);
    --primary: #D98A72; --primary-fill: #D98A72; --primary-text: #E7A48D; --on-primary: #17181C;
    --error: #E08772;
    color: var(--on-bg);
    color-scheme: dark;
  }
}

/* 立绘取景面板（2026-11-18，工单 8499f70b「要图片裁剪功能」）
   两个取景框上下排（横幅 / 方形头像），框本身复用 .cr-crop-frame，比例由 JS 内联 padding-top 给
   —— 壳是 Chrome 83，不认 aspect-ratio，所以这里不写比例。 */
.cs-body { gap: 18px; }
.cs-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cs-field-t { font-size: var(--fs-meta); font-weight: 600; color: var(--on-surface); letter-spacing: .02em; }
.cs-frame-wrap { width: 100%; }

/* 系统处置通知（2026-11-18，作品被隐藏 / 下架 / 恢复时给作者的那条）
   不是某个用户干的 ⇒ 头像位画成小标记、不可点（作品已下架，详情 404），原因单独一行且允许换行
   （普通通知的摘句是一行省略，那条规则对「原因」不适用）。 */
.cm-nt-item.is-sys { cursor: default; }
.cm-nt-sysmark { font-style: normal; font-weight: 800; background: var(--surface-variant); color: var(--primary); box-shadow: inset 0 0 0 1px var(--outline); }
.cm-nt-item.is-sys .cm-nt-snip { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }

/* 站内社区管理面板（2026-11-18，只有 communityRole==='moderator' 的账号看得到入口）
   入口是工具条搜索行里的「管理」chip（跟「筛选」同款），不再放顶行 —— 顶行 360px 放不下第四个按钮，
   会把「官方精选 | 社区」挤到文字溢出（实测 seg 只剩 99px、溢出 45px）。
   一行一条：标题 + 标签 + 举报理由 + 操作按钮；原因输入框折叠在按钮下面。 */
.cm-catbtn.cm-mod { color: var(--primary); }
/* .cm-catbtn 是 inline-flex，hidden 属性本身挡不住它 ⇒ 必须显式关掉（同 .chip 那次踩过的坑） */
.cm-catbtn[hidden] { display: none; }
.cm-catbtn.cm-mod .cm-catbtn-ic { opacity: 1; display: inline-flex; align-items: center; }
.cm-mod-hint { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; }
.cm-mod-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--outline); border-radius: 12px; background: var(--surface-variant); min-width: 0; }
.cm-mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.cm-mod-head b { font-size: 14px; font-weight: 700; color: var(--on-bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cm-mod-tag { font-size: 11px; line-height: 1.5; padding: 1px 6px; border-radius: 999px; background: var(--surface); color: var(--on-surface-variant); box-shadow: inset 0 0 0 1px var(--outline); }
.cm-mod-tag.is-off { color: var(--error, #c0392b); }
.cm-mod-why { font-size: 13px; line-height: 1.5; color: var(--on-bg); word-break: break-word; }
.cm-mod-meta { font-size: 12px; color: var(--on-surface-variant); }
.cm-mod-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cm-mod-acts .chip.is-danger { color: var(--error, #c0392b); }
.cm-mod-reason { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cm-mod-reason[hidden] { display: none; }
.cm-mod-reason-btns { display: flex; gap: 6px; }

.card-import-opening {
  margin-block: 12px;
  max-height: min(44vh, 390px);
  overflow: auto;
  overflow-wrap: anywhere;
  border: 1px solid var(--outline-soft, var(--outline));
  border-radius: 12px;
  background: var(--surface);
}
.card-import-plain { padding: 14px; white-space: pre-wrap; line-height: 1.75; }
.card-import-details, .lore-hit-empty { margin-block: 8px; color: var(--on-surface-variant); font-size: 13px; }
.card-import-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.card-import-actions button, .truncation-continue { min-height: 44px; }
.lore-hit-list { margin-block: 10px; font-size: 13px; overflow-wrap: anywhere; }
.lore-hit-list summary { cursor: pointer; padding-block: 10px; }
.lore-hit-list ul { margin: 0; padding-inline-start: 20px; }
.lore-hit-list li { margin-bottom: 8px; }
.lore-hit-list li span { display: block; color: var(--on-surface-variant); }
.auth-captcha-row, .auth-email-code-row { display: flex; align-items: stretch; gap: 8px; }
.auth-captcha-input, .auth-code-input { flex: 1; min-width: 0; }
.auth-captcha-input { text-transform: uppercase; letter-spacing: 0.12em; }
.auth-captcha-btn {
  flex: none; padding: 0; border: 1px solid var(--outline); border-radius: var(--r-ctl);
  background: var(--surface); cursor: pointer; overflow: hidden; display: flex; align-items: center; min-height: 44px;
}
.auth-captcha-btn:hover { border-color: var(--primary); }
.auth-captcha-img { display: block; width: 128px; height: 44px; }
.auth-code-btn { flex: none; min-width: 112px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.auth-info-hint { font-size: 12.5px; color: var(--tertiary); min-height: 0; }
.auth-info-hint:empty { display: none; }

/* ===== 彼岸灵境 · 梦女氛围组件（主题切换 / 广场关系钩子 / 羁绊仪式条 / 梦设卡 / 火漆印来信） ===== */
.header-theme-pill {
  flex: none;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
  min-height: 32px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.header-theme-pill:hover { border-color: var(--primary); color: var(--primary-text); }

.plaza-card-hook {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  max-width: calc(100% - 82px);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(24, 16, 10, 0.68);
  color: #FDF7EE;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 240, 215, 0.24);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.bond-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--outline);
  font-size: 12px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}
.bond-ribbon-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.bond-ribbon-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.bond-pill-btn {
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  min-height: 28px;
  cursor: pointer;
  white-space: nowrap;
}
.bond-pill-btn:hover { border-color: var(--primary); color: var(--primary-text); }
.bond-pill-btn.is-accent {
  border-color: var(--primary);
  color: var(--primary-text);
  background: var(--surface-variant);
}
.th-stream .bond-ribbon { margin: 4px 12px 2px; }
.vn-wrap .bond-ribbon {
  margin: 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 15, 20, 0.92);
  color: rgba(243, 239, 232, 0.84);
}
.vn-wrap .bond-pill-btn {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(243, 239, 232, 0.92);
}
.vn-wrap .bond-pill-btn.is-accent {
  background: rgba(240, 168, 140, 0.14);
  border-color: rgba(240, 168, 140, 0.45);
  color: #f0a88c;
}

.dream-card-sheet { display: flex; flex-direction: column; gap: 12px; }
.dream-card-lead { font-size: 13px; line-height: 1.7; color: var(--on-surface-variant); margin: 0; }
.dream-card-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--on-surface); }
.dream-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.dream-card-chip {
  border: 1px solid var(--outline);
  background: var(--surface-variant);
  color: var(--on-surface);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  cursor: pointer;
}
.dream-card-chip:hover { border-color: var(--primary); color: var(--primary-text); }
.dream-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.letter-sheet { display: flex; flex-direction: column; gap: 12px; }
.letter-bond-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-variant);
  font-size: 12px;
  color: var(--on-surface-variant);
  font-family: var(--font-display);
}
.letter-bond-dot { opacity: 0.5; }
.letter-envelope {
  position: relative;
  width: 100%;
  padding: 28px 18px 22px;
  border-radius: 14px;
  border: 1px solid var(--outline);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-variant) 100%);
  color: var(--on-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(48, 28, 12, 0.14);
}
.letter-envelope.is-empty { cursor: default; box-shadow: none; }
.letter-env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(143, 63, 40, 0.08), transparent);
  border-bottom: 1px dashed var(--outline);
  pointer-events: none;
}
.letter-wax-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C85242 0%, #8E2C22 72%, #681D16 100%);
  color: #FDF3E3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(110, 28, 20, 0.38), inset 0 1px 2px rgba(255, 224, 198, 0.45);
  z-index: 1;
}
.letter-env-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--on-bg); }
.letter-env-sub { font-size: 12.5px; color: var(--on-surface-variant); margin: 0; line-height: 1.6; }
.letter-paper {
  padding: 18px 18px 16px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(48, 28, 12, 0.10);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.letter-paper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--on-surface-variant);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--outline);
}
.letter-paper-stamp { color: var(--primary-text); font-family: var(--font-display); letter-spacing: 0.08em; }
.letter-paper-body {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.9;
  color: var(--on-bg);
  white-space: pre-wrap;
}
.letter-paper-sign {
  text-align: right;
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--primary-text);
}
.letter-summon-btn { width: 100%; min-height: 44px; }
.letter-archive { font-size: 13px; color: var(--on-surface-variant); }
.letter-archive summary { cursor: pointer; padding: 6px 0; }
.letter-archive-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.letter-archive-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
}
.letter-archive-date { font-size: 11px; color: var(--on-surface-variant); margin-bottom: 4px; }
.letter-archive-text { font-family: var(--font-display); font-size: 13.5px; line-height: 1.75; color: var(--on-bg); white-space: pre-wrap; }


/* ==========================================================================
   类脑美学升级 · 快捷标点输入条 + 纸上访谈书刊版式 + 红线手缝信笺版式
   ========================================================================== */

/* 顶栏「阅读版式」小印章切换钮 */
.th-style-pill {
  flex: none;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--outline);
  border-radius: 3px;
  background: var(--surface);
  color: var(--primary-text);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.th-style-pill:hover {
  border-color: var(--primary);
  background: var(--surface-variant);
}

/* 《草莓编辑部》风微型快捷标点条 */
.rp-punct-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 7px 12px 2px;
  background: var(--bg);
  border-top: 1px solid var(--outline);
}
.rp-punct-bar::-webkit-scrollbar { display: none; }
.rp-punct-bar + .composer {
  border-top: 0;
  padding-top: 7px;
}
.dream-input .rp-punct-bar {
  padding: 0 2px 2px;
  border-top: 0;
  background: transparent;
}
.rp-punct-btn {
  flex: none;
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.rp-punct-btn:hover,
.rp-punct-btn:active {
  border-color: var(--primary);
  color: var(--primary-text);
  background: var(--surface-variant);
}

/* 开篇扉页眉题与印刷页码（经典气泡模式下隐藏，书刊/红线模式下启用） */
.folio-opening-kicker {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--primary-text);
  padding-bottom: 5px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--outline);
  opacity: 0.88;
}
.folio-page-no {
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--on-surface-variant);
  opacity: 0.56;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

:root[data-reading-style="classic"] .folio-opening-kicker,
:root[data-reading-style="classic"] .folio-page-no {
  display: none;
}

/* ---------- 模式一：纸上访谈（默认 editorial · 杂志扉页 + 居中页码 + 文末小方符） ---------- */
:root:not([data-reading-style="classic"]):not([data-reading-style="redthread"]) .msg-group.assistant {
  max-width: 92%;
}
:root:not([data-reading-style="classic"]):not([data-reading-style="redthread"]) .msg-group.assistant .msg-bubble {
  border-radius: 4px;
  border: 1px solid var(--outline);
  background: var(--surface);
  font-family: var(--font-display);
  line-height: 1.88;
  letter-spacing: 0.02em;
  box-shadow: none;
}
:root:not([data-reading-style="classic"]):not([data-reading-style="redthread"]) .msg-group.assistant.is-opening-folio {
  max-width: 96%;
  padding-top: 4px;
}
:root:not([data-reading-style="classic"]):not([data-reading-style="redthread"]) .msg-group.assistant.is-plain-opening .msg-bubble:first-of-type::first-letter,
:root:not([data-reading-style="classic"]):not([data-reading-style="redthread"]) .dream-line.narrator.is-plain-opening .dream-line-body::first-letter {
  font-size: 1.75em;
  font-weight: 600;
  color: var(--primary-text);
  line-height: 1.1;
  margin-right: 3px;
}
/* 《尺素》式旁白摘录细线 */
:root:not([data-reading-style="classic"]) .msg-group.assistant .scene-block {
  margin: 4px 0;
  padding: 6px 16px;
  border-top: 1px dashed color-mix(in srgb, var(--outline) 65%, transparent);
  border-bottom: 1px dashed color-mix(in srgb, var(--outline) 65%, transparent);
}
/* 《纸上访谈》最新一条角色/旁白末尾落一枚克制的杂志文末符（流式打字中不显示） */
:root:not([data-reading-style="classic"]) .msg-group.assistant.is-latest:not(.is-opening-folio) .msg-bubble:last-of-type:not(.typing-dots)::after,
:root:not([data-reading-style="classic"]) .dream-line.narrator.is-latest:not(.is-opening-folio):not(.pending) .dream-line-body::after {
  content: " ▪";
  color: var(--primary-text);
  font-size: 0.72em;
  opacity: 0.72;
  vertical-align: 1px;
}

/* ---------- 模式二：红线信笺（《十二时辰·酉·红线》朱红十字针脚缝装） ---------- */
:root[data-reading-style="redthread"] {
  --stitch-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 16 18'%3E%3Cpath d='M5 6l6 6M11 6L5 12' stroke='%23b53847' stroke-width='1.15' stroke-linecap='round' opacity='0.62'/%3E%3C/svg%3E");
  --thread-wave-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M0 4 Q 30 0.5, 60 4 T 120 4' fill='none' stroke='%23b53847' stroke-width='0.95' opacity='0.52'/%3E%3C/svg%3E");
}
:root[data-reading-style="redthread"] .msg-group.assistant {
  max-width: 92%;
}
:root[data-reading-style="redthread"] .msg-group.assistant .msg-bubble,
:root[data-reading-style="redthread"] .dream-line.narrator:not(.is-opening-folio) .dream-line-body {
  position: relative;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, #b53847 26%, var(--outline));
  background-color: var(--surface);
  background-image: var(--stitch-svg);
  background-repeat: repeat-y;
  background-position: 6px 6px;
  padding: 13px 16px 15px 28px;
  font-family: var(--font-display);
  line-height: 1.9;
  box-shadow: 0 4px 16px rgba(96, 28, 38, 0.05);
}
:root[data-reading-style="redthread"] .msg-group.assistant.is-latest .msg-bubble:last-of-type::before,
:root[data-reading-style="redthread"] .dream-line.narrator.is-latest:not(.is-opening-folio) .dream-line-body::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 14px;
  bottom: 3px;
  height: 7px;
  background-image: var(--thread-wave-svg);
  background-repeat: repeat-x;
  background-size: 96px 7px;
  pointer-events: none;
}
:root[data-reading-style="redthread"] .folio-page-no {
  color: #b53847;
  opacity: 0.65;
}

/* ==========================================================================
   类脑/梦女深度升级六件套（IF 线剧本选择器 · 编者按思考抽屉 · 书签状态条 · 制卡体检 · 今夜命签 & 私藏画匣）
   ========================================================================== */

/* 1. 多开场白「IF 线剧本选择器」 */
.folio-opening-kicker.has-if {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
:root[data-reading-style="classic"] .folio-opening-kicker.has-if {
  display: flex;
  border-bottom: 0;
  padding-bottom: 2px;
}
:root[data-reading-style="classic"] .folio-opening-kicker.has-if .folio-kicker-label {
  display: none;
}
.folio-if-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--outline));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  padding: 1px 3px;
}
.vn-if-bar {
  margin-bottom: 6px;
}
.folio-if-arrow,
.folio-if-btn {
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 11.5px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
  border-radius: 999px;
  padding: 3px 8px;
  transition: background 0.16s ease;
}
.folio-if-arrow {
  padding: 2px 7px;
  font-size: 13px;
}
.folio-if-arrow:hover,
.folio-if-btn:hover {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}
.plaza-sec-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.plaza-if-btn {
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--outline));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  padding: 3px 10px;
}
.if-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.if-picker-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.if-picker-card:hover,
.if-picker-card.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.if-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.if-picker-tag {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-text);
  letter-spacing: 0.04em;
}
.if-picker-cur {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--on-primary);
}
.if-picker-excerpt {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--on-surface-variant);
}

/* 3. <think> 推理链可折叠「编者按 · 幕后推演」抽屉 */
.think-drawer {
  width: 100%;
  margin: 2px 0 6px;
  border: 1px dashed color-mix(in srgb, var(--primary) 32%, var(--outline));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  font-size: 12px;
  color: var(--on-surface-variant);
  overflow: hidden;
}
.think-drawer-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 11px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}
.think-drawer-sum::-webkit-details-marker {
  display: none;
}
.think-drawer-title {
  color: var(--primary-text);
  font-weight: 500;
}
.think-drawer-hint {
  font-size: 11px;
  opacity: 0.72;
}
.think-drawer[open] .think-drawer-hint {
  opacity: 0.9;
}
.think-drawer-body {
  padding: 8px 12px 10px;
  border-top: 1px dashed color-mix(in srgb, var(--outline) 70%, transparent);
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.vn-wrap .think-drawer {
  background: rgba(20, 22, 30, 0.78);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(243, 239, 232, 0.82);
}

/* 4. 书签式动态状态浮条（钉住场记 & 实时心绪摘取） */
.bond-ribbon.has-bookmark {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 6px 12px 7px;
}
.bond-ribbon-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.scene-bookmark-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px dashed color-mix(in srgb, var(--outline) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
  color: var(--on-surface-variant);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.scene-bookmark-btn:hover,
.scene-bookmark-btn.is-pinned {
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary) 45%, var(--outline));
  color: var(--primary-text);
}
.scene-bookmark-mark {
  flex: none;
  font-size: 11px;
  opacity: 0.85;
}
.scene-bookmark-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.vn-wrap .scene-bookmark-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(243, 239, 232, 0.85);
}

/* 5. 角色卡八股体检与一键瘦身盒 */
.card-doctor-box {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--outline));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-doctor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--primary-text);
}
.card-doctor-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-doctor-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-surface-variant);
  white-space: pre-line;
}

/* 6. 广场「私藏画匣」心标 +「抽一支今夜签」命签弹窗 */
.plaza-fav-btn {
  position: absolute;
  top: 50px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(18, 13, 10, 0.56);
  color: rgba(255, 248, 242, 0.92);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.plaza-fav-btn:hover {
  transform: scale(1.06);
}
.plaza-fav-btn.active {
  background: rgba(181, 56, 71, 0.9);
  border-color: rgba(255, 225, 228, 0.55);
  color: #fff;
}
.chip.plaza-favfilter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip.plaza-fortune-trigger {
  border-color: color-mix(in srgb, #b53847 45%, var(--outline));
  background: color-mix(in srgb, #b53847 10%, var(--surface));
  color: var(--primary-text);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.chip.plaza-fortune-trigger:hover {
  background: color-mix(in srgb, #b53847 18%, var(--surface));
}
.plaza-fortune-modal {
  position: relative;
  width: min(92vw, 420px);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, #b53847 36%, var(--outline));
  background: var(--surface);
  color: var(--on-surface);
  padding: 22px 20px 18px;
  box-shadow: 0 20px 48px rgba(15, 10, 8, 0.28);
}
.plaza-fortune-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface-variant);
  cursor: pointer;
}
.plaza-fortune-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plaza-fortune-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plaza-fortune-seal {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #9f2f3d;
  color: #fdf7ee;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.1em;
}
.plaza-fortune-grade {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-text);
  letter-spacing: 0.06em;
}
.plaza-fortune-verse {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--on-surface);
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--outline);
}
.plaza-fortune-char {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.plaza-fortune-char:hover {
  border-color: var(--primary);
}
.plaza-fortune-art,
.plaza-fortune-poster {
  width: 84px;
  height: 112px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
}
.plaza-fortune-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary-text);
  font-family: var(--font-display);
  font-size: 28px;
}
.plaza-fortune-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  justify-content: center;
}
.plaza-fortune-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--on-surface);
}
.plaza-fortune-hook {
  font-size: 11.5px;
  color: var(--primary-text);
}
.plaza-fortune-snippet {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plaza-fortune-detail-hint {
  font-size: 11px;
  color: var(--primary-text);
  opacity: 0.82;
  margin-top: 2px;
}
.plaza-fortune-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}


/* ==========================================================================
   类脑第二辑升级包（P0 + P1）：
   1. 零手打剧情选项胶囊（reply-options）
   2. 晦明护眼笺、纯文手稿模式、行距/列宽微调与全屏净读（reading-ergonomics）
   3. 角色卡「先排雷 · 后入戏」包装与开局组装器（card-packaging）
   4. 题材原生「媒介态状态副卡」三皮肤（scene-bookmark）
   5. 显式置顶、角色检视器与 Ctrl/⌘+K 全局速搜工作台（inspector & command-palette）
   ========================================================================== */

/* ---- 晦明护眼笺专属细节：零阴影、极细分隔、浓缩咖啡棕对话与引语 ---- */
:root[data-theme="huiming"] .msg-bubble,
:root[data-theme="huiming"] .scene-block,
:root[data-theme="huiming"] .char-card,
:root[data-theme="huiming"] .ui-group {
  box-shadow: none !important;
}
:root[data-theme="huiming"] .msg-group.assistant .msg-bubble {
  color: #39383C;
  border-color: rgba(77, 65, 55, 0.18);
  background: #FDFCFA;
}
:root[data-theme="huiming"] blockquote,
:root[data-theme="huiming"] .cp-contrast-quote {
  color: #6A3A1F;
  border-left-color: rgba(106, 58, 31, 0.45);
}

/* ---- 阅读行距（--chat-lh）与阅读列宽（--chat-measure）令牌 ---- */
html[data-chat-lh] .msg-bubble,
html[data-chat-lh] .scene-text,
html[data-chat-lh] .vn-line,
html[data-chat-lh] .vn-narr,
html[data-chat-lh] .plaza-detail-sec-body {
  line-height: var(--chat-lh, 1.85) !important;
}
@media (min-width: 680px) {
  html[data-chat-measure] .thread > .msg-group,
  html[data-chat-measure] .thread > .more-wrap,
  html[data-chat-measure] .thread > .char-banner {
    max-width: var(--chat-measure, 68ch);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

/* ---- 纯文手稿模式（Zero-Avatar Novel Mode，仿《Cupertino》） ---- */
html[data-zero-avatar="1"] .msg-av,
html[data-zero-avatar="1"] .msg-avatar,
html[data-zero-avatar="1"] .msg-name,
html[data-zero-avatar="1"] .vn-avatar {
  display: none !important;
}
html[data-zero-avatar="1"] .msg-group {
  padding-left: 4px;
  padding-right: 4px;
}

/* ---- 一键全屏净读（Zen Read）：零层级冲突隐藏顶栏与浮条 ---- */
html[data-zen-read="1"] .thread-wrap .th-top,
html[data-zen-read="1"] .thread-wrap .bond-ribbon,
html[data-zen-read="1"] .app-nav,
html[data-zen-read="1"] .tabbar {
  display: none !important;
}
.th-zen-btn.active {
  color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.bm-zen-exit-pill {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(6px);
  color: var(--on-surface-variant);
  font-size: 11.5px;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}
.bm-zen-exit-pill:hover {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary-text);
}

/* ---- P0-1：「零手打」剧情选项胶囊条 ---- */
.reply-options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  padding-top: 4px;
}
.reply-opt-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--outline));
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.reply-opt-chip:hover {
  border-color: var(--primary);
}
.reply-opt-fill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 10px 5px 11px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.reply-opt-dot {
  flex: none;
  font-size: 10px;
  color: var(--primary-text);
  opacity: 0.85;
}
.reply-opt-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.reply-opt-send {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--primary) 22%, var(--outline));
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.reply-opt-send:hover {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* ---- P1-3：广场多 IF 线徽标 &「先排雷 · 后入戏」详情包装卡 ---- */
.plaza-if-badge {
  position: absolute;
  top: 36px;
  left: 8px;
  z-index: 3;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 16, 13, 0.72);
  border: 1px solid rgba(255, 236, 208, 0.34);
  color: #f9ebd2;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.cp-pack-card {
  margin-bottom: 14px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--outline));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cp-pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.cp-pack-kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary-text);
}
.cp-pack-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cp-meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface-variant);
  font-size: 11px;
}
.cp-meta-badge.is-if {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--outline));
  color: var(--primary-text);
  font-weight: 600;
}
.cp-contrast-quote {
  margin: 0;
  padding: 6px 10px;
  border-left: 2.5px solid var(--primary);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.65;
  color: var(--on-surface);
}
.cp-warn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cp-warn-prefix {
  font-size: 11.5px;
  color: var(--on-surface-variant);
}
.cp-warn-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 12%, var(--bg));
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 500;
}
.cp-guide-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-surface-variant);
}
.cp-starter-details {
  border-top: 1px dashed var(--outline);
  padding-top: 8px;
}
.cp-starter-sum {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-text);
  cursor: pointer;
}
.cp-starter-sum::-webkit-details-marker {
  display: none;
}
.cp-starter-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--on-surface-variant);
}
.cp-starter-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-dim-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cp-dim-label {
  font-size: 11px;
  color: var(--on-surface-variant);
}
.cp-dim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cp-dim-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.cp-dim-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.cp-starter-preview {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--outline);
  font-size: 12px;
  line-height: 1.55;
  color: var(--on-surface);
}
.cp-starter-foot {
  display: flex;
  justify-content: flex-end;
}

/* ---- P1-4：题材原生「媒介态状态副卡」（风向小报 / 线索战术板 / 岁时花笺） ---- */
.mbk-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mbk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mbk-skin-tabs {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--outline);
  padding: 2px;
  background: var(--bg);
}
.mbk-skin-tab {
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  padding: 4px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.mbk-skin-tab.active {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.mbk-phone-jump {
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--outline));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary-text);
  padding: 4px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mbk-card-face {
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--outline);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
/* 报刊风《THE MOMENT》 */
.mbk-skin--gazette .mbk-card-face {
  border-top: 3px double var(--on-surface);
  background: color-mix(in srgb, var(--surface) 75%, #fff);
}
/* 悬疑暗金战术板 */
.mbk-skin--tactical .mbk-card-face {
  background: #171821;
  color: #e9e4d8;
  border-color: rgba(216, 174, 108, 0.38);
}
.mbk-skin--tactical .mbk-sec-label,
.mbk-skin--tactical .mbk-masthead-char {
  color: #b7b0a2;
}
.mbk-skin--tactical .mbk-masthead-title,
.mbk-skin--tactical .mbk-meter-val {
  color: #e6bc79;
}
/* 古风岁时花笺 */
.mbk-skin--scroll .mbk-card-face {
  border-left: 3px solid #9f353a;
}
.mbk-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--outline);
  font-family: var(--font-display);
}
.mbk-masthead-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-text);
}
.mbk-masthead-char {
  font-size: 11.5px;
  color: var(--on-surface-variant);
}
.mbk-headline {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}
.mbk-sec-label {
  font-size: 11.5px;
  color: var(--on-surface-variant);
}
.mbk-stage-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mbk-stage-chips,
.mbk-clue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mbk-stage-chip {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--outline);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.mbk-stage-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.mbk-meter-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mbk-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mbk-meter-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-text);
}
.mbk-meter-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(128, 120, 110, 0.22);
  overflow: hidden;
}
.mbk-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.15s ease;
}
.mbk-skin--tactical .mbk-meter-fill {
  background: linear-gradient(90deg, #d8a657, #c94a4a);
}
.mbk-range {
  width: 100%;
  accent-color: var(--primary);
}
.mbk-clues-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mbk-clue-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  font-size: 11.5px;
}
.mbk-clue-del {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  padding: 0 2px;
}
.mbk-clue-empty {
  font-size: 11.5px;
  opacity: 0.72;
}
.mbk-clue-add {
  display: flex;
  gap: 6px;
}
.mbk-clue-input {
  flex: 1;
  min-width: 0;
}
.mbk-edit-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mbk-foot-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- P1-5：显式置顶按钮、角色检视器与 Ctrl/⌘+K 全局速搜面板 ---- */
.cast-pin-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.36;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.cast-pin-btn:hover,
.cast-pin-btn.active {
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.th-top-who.is-clickable {
  cursor: pointer;
  border-radius: 10px;
  padding: 2px 6px 2px 2px;
  transition: background 0.15s ease;
}
.th-top-who.is-clickable:hover {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.ci-sheet {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ci-card {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ci-quote {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.6;
  color: var(--on-surface);
}
.ci-warn-tags,
.ci-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ci-pill-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.ci-pill-btn.active,
.ci-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}
.ci-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}
.ci-total-tok {
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-variant);
}
.ci-tok-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-variant);
  gap: 2px;
}
.ci-tok-seg.is-persona { background: var(--primary); }
.ci-tok-seg.is-lore { background: var(--tertiary); }
.ci-tok-seg.is-anchor { background: #c58b3c; }
.ci-tok-seg.is-history { background: #74829c; }
.ci-tok-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.ci-tok-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.ci-tok-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.ci-tok-dot.is-persona { background: var(--primary); }
.ci-tok-dot.is-lore { background: var(--tertiary); }
.ci-tok-dot.is-anchor { background: #c58b3c; }
.ci-tok-dot.is-history { background: #74829c; }
.ci-tok-name {
  color: var(--on-surface-variant);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-lore-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ci-lore-row {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  background: var(--surface);
}
.ci-lore-main {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ci-lore-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary-text);
  flex: none;
}
.ci-lore-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-lore-tok {
  font-size: 11px;
  color: var(--on-surface-variant);
}
.ci-lore-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--on-surface-variant);
}
.ci-standby-sum {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--primary-text);
  cursor: pointer;
}
.ci-link-btn {
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.ci-anchor-pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--on-surface-variant);
}
.ci-empty {
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-surface-variant);
}

/* ---- Ctrl / ⌘ + K 全局速搜面板 ---- */
.bm-cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(12, 10, 9, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(11vh, 76px) 14px 20px;
}
.bm-cmdk-modal {
  width: min(100%, 540px);
  max-height: min(76vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: 0 24px 60px rgba(10, 8, 6, 0.34);
  overflow: hidden;
}
.bm-cmdk-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--outline);
}
.bm-cmdk-icon {
  font-size: 17px;
  color: var(--primary-text);
}
.bm-cmdk-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 14.5px;
}
.bm-cmdk-esc {
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface-variant);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}
.bm-cmdk-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bm-cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.bm-cmdk-item.active {
  background: color-mix(in srgb, var(--primary) 13%, var(--bg));
}
.bm-cmdk-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--outline);
  color: var(--on-surface-variant);
  font-size: 10.5px;
  font-weight: 600;
}
.bm-cmdk-badge.is-character {
  color: var(--primary-text);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--outline));
}
.bm-cmdk-text {
  flex: 1;
  min-width: 0;
}
.bm-cmdk-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bm-cmdk-sub {
  font-size: 11px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bm-cmdk-alt {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--outline));
  background: var(--bg);
  color: var(--primary-text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.bm-cmdk-alt:hover {
  background: var(--primary);
  color: var(--on-primary);
}
.bm-cmdk-enter {
  font-size: 12px;
  color: var(--on-surface-variant);
  opacity: 0.7;
}
.bm-cmdk-empty {
  padding: 22px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--on-surface-variant);
}
.bm-cmdk-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  border-top: 1px solid var(--outline);
  background: var(--bg);
  font-size: 11px;
  color: var(--on-surface-variant);
}

/* ---- P2：卡片专属指令（creator_notes）+ 卷宗 <sum> 阶段签样式 ---- */
.qc-card-sec {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--outline);
}
.qc-card-head,
.ci-sub-kicker {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 6px;
}
.qc-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qc-card-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--outline));
  background: color-mix(in srgb, var(--primary) 10%, var(--bg));
  color: var(--primary-text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.qc-card-chip:hover {
  background: var(--primary);
  color: var(--on-primary);
}
.ci-creator-cmds {
  padding-top: 8px;
  border-top: 1px dashed var(--outline);
}
.ci-notes-body {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--on-surface-variant);
}
.conv-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.conv-stage-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--outline));
  color: var(--primary-text);
  font-size: 10.5px;
  font-weight: 600;
}
.conv-sum-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 裂变返图海报（share-poster）+ 窥探暗格（secret-drawer）+ 灵感制卡工坊（card-copilot） ---- */
.sp-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-mask-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--on-surface);
  cursor: pointer;
}
.sp-msg-picker {
  margin-top: 8px;
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sp-msg-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--bg);
  font-size: 11.5px;
  cursor: pointer;
}
.sp-msg-who {
  flex: none;
  font-weight: 600;
  color: var(--primary-text);
}
.sp-msg-snip {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-surface-variant);
}
.sp-preview-wrap {
  max-height: 46vh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: var(--bg);
  padding: 8px;
  display: flex;
  justify-content: center;
}
.sp-canvas-preview {
  width: 100%;
  max-width: 390px;
  height: auto;
  border-radius: 6px;
}

.secret-peek-host:empty {
  display: none;
}
.secret-peek-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--primary) 42%, var(--outline));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.secret-peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.secret-peek-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-text);
}
.secret-peek-tag {
  font-size: 10.5px;
  color: var(--on-surface-variant);
}
.secret-peek-body {
  font-family: var(--font-display);
  font-size: 12.8px;
  line-height: 1.72;
  color: var(--on-surface);
  white-space: pre-wrap;
}

.cc-bar-box {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--outline));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.cc-bar-sum {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-text);
  cursor: pointer;
}
.cc-bar-sum::-webkit-details-marker {
  display: none;
}
.cc-bar-body {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cc-input-row {
  display: flex;
  gap: 7px;
  align-items: stretch;
}
.cc-idea-input {
  flex: 1;
  min-width: 0;
}
.cc-run-btn {
  flex: none;
  white-space: nowrap;
}

/* ==========================================================================
   类脑二期六大升级样式包：
   1. 桌面宽屏「双栏书案工作台」(.wb-rail / .wb-main-col)
   2. 零外链窗景氛围层与楼层微角标 (.bm-ambient-canvas / .msg-floor-meta)
   3. 同层悬浮迷你小手机 (.mp-overlay-host / .mp-panel)
   4. 入梦勘舆节点地图与跨卡同行队友 (.dm-*)
   ========================================================================== */

/* ---------- 1. 桌面大屏双栏书案工作台 ---------- */
.wb-rail {
  display: none;
}
.th-wb-btn {
  display: none;
}
.wb-main-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  gap: 10px;
}
@media (min-width: 1024px) {
  .th-wb-btn {
    display: inline-flex;
  }
  html[data-workbench='split']:not([data-zen-read='1']) .app-shell.thread-mode {
    max-width: 1260px;
  }
  html[data-workbench='split']:not([data-zen-read='1']) .app-body.body-thread .thread-wrap.has-wb-rail {
    flex-direction: row;
    max-width: none;
    padding: 0;
    gap: 0;
  }
  html[data-workbench='split']:not([data-zen-read='1']) .thread-wrap.has-wb-rail .wb-rail {
    display: flex;
    flex-direction: column;
    width: 266px;
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid var(--outline);
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  }
  html[data-workbench='split']:not([data-zen-read='1']) .thread-wrap.has-wb-rail .wb-main-col {
    padding: 12px 18px 0;
    height: 100%;
  }
}
.wb-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--outline);
}
.wb-rail-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-rail-kicker {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--primary-text);
}
.wb-rail-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--on-bg);
}
.wb-cmdk-pill {
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface-variant);
  border-radius: 7px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.wb-cmdk-pill:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}
.wb-rail-search-wrap {
  padding: 8px 12px 6px;
}
.wb-rail-search {
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-bg);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.wb-rail-search:focus {
  border-color: var(--primary);
}
.wb-rail-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}
.wb-rail-empty {
  padding: 20px 12px;
  font-size: 12px;
  color: var(--on-surface-variant);
  text-align: center;
}
.wb-char-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-char-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--on-bg);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s, border-color 0.14s;
}
.wb-char-row:hover {
  background: var(--surface-variant);
}
.wb-char-row.is-active {
  background: color-mix(in srgb, var(--primary) 11%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 38%, var(--outline));
}
.wb-char-av {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.wb-char-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-char-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
}
.wb-char-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-pin-dot {
  font-size: 10px;
  flex: none;
}
.wb-vol-count {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--on-surface-variant);
  flex: none;
}
.wb-char-sub {
  font-size: 11px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-vol-list {
  margin: 2px 0 4px 22px;
  padding-left: 8px;
  border-left: 1px solid var(--outline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-vol-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.wb-vol-item:hover {
  background: var(--surface-variant);
  color: var(--on-bg);
}
.wb-vol-item.is-current {
  color: var(--primary-text);
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.wb-vol-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.8;
}
.wb-vol-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-vol-stage {
  flex: none;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--surface-variant);
  color: var(--primary-text);
}
.wb-vol-all {
  font-size: 11px;
  opacity: 0.8;
}
.wb-rail-foot {
  display: flex;
  gap: 6px;
  padding: 9px 10px;
  border-top: 1px solid var(--outline);
}
.wb-foot-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.wb-foot-btn:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}
.wb-foot-btn.is-accent {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--outline));
  color: var(--primary-text);
}

/* ---------- 2. 窗景氛围层与楼层微元数据 ---------- */
.bm-ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  display: none;
}
html[data-theme='huiming'] .bm-ambient-canvas {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .bm-ambient-canvas {
    display: none !important;
  }
}
html[data-ambient]:not([data-ambient='off']):not([data-theme='huiming']) .msg-bubble blockquote {
  border-left: 2.5px solid color-mix(in srgb, var(--primary) 55%, var(--outline));
  padding-left: 10px;
  margin: 6px 0;
  color: var(--on-surface-variant);
}
.msg-floor-meta {
  display: none;
  align-items: center;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--on-surface-variant);
  opacity: 0.68;
  background: color-mix(in srgb, var(--surface-variant) 55%, transparent);
}
html[data-floor-meta='1'] .msg-floor-meta {
  display: inline-flex;
}

/* ---------- 3. 同层悬浮迷你小手机 ---------- */
.mp-overlay-host {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.mp-panel,
.mp-minimized-pill {
  pointer-events: auto;
}
.mp-panel[hidden],
.mp-minimized-pill[hidden],
.mp-typing[hidden],
.mp-pill-dot[hidden] {
  display: none !important;
}
.mp-panel {
  width: min(352px, calc(100vw - 24px));
  height: min(510px, 68dvh);
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--outline));
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(18, 12, 8, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--outline);
  background: color-mix(in srgb, var(--surface-variant) 65%, var(--surface));
}
.mp-head-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mp-head-av {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.mp-head-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mp-head-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-bg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-head-sub,
.mp-typing {
  font-size: 10.5px;
  color: var(--primary-text);
}
.mp-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mp-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}
.mp-sync-bar {
  padding: 5px 12px;
  font-size: 11px;
  color: var(--on-surface-variant);
  background: color-mix(in srgb, var(--primary) 7%, var(--bg));
  border-bottom: 1px dashed var(--outline);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-msg-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}
.mp-empty {
  margin: auto 0;
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.mp-narr {
  align-self: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--on-surface-variant);
  background: var(--surface-variant);
}
.mp-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 88%;
}
.mp-row.is-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.mp-av {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.mp-bubble {
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  background: var(--surface);
  color: var(--on-bg);
  border: 1px solid var(--outline);
}
.mp-row.is-me .mp-bubble {
  background: var(--primary-fill);
  color: var(--on-primary);
  border-color: transparent;
}
.mp-foot {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--outline);
  background: var(--surface);
}
.mp-input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 99px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-bg);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.mp-input:focus {
  border-color: var(--primary);
}
.mp-send-btn {
  flex: none;
  padding: 0 13px;
  border-radius: 99px;
  border: 0;
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.mp-send-btn:disabled {
  opacity: 0.5;
}
.mp-minimized-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--outline));
  background: var(--surface);
  color: var(--primary-text);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.mp-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9483b;
}

/* ---------- 4. 入梦勘舆节点探索地图 & 跨卡同行固定队友 ---------- */
.dream-atlas-btn.has-companion {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--outline));
  color: var(--primary-text);
}
.dm-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--outline);
  background: var(--surface);
}
.dm-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.dm-sec-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--on-bg);
}
.dm-sec-sub,
.dm-explore-badge {
  font-size: 11.5px;
  color: var(--primary-text);
}
.dm-empty-note {
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.dm-companion-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}
.dm-comp-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--outline);
  background: var(--bg);
  color: var(--on-surface);
  font-size: 12px;
  cursor: pointer;
}
.dm-comp-chip.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary-text);
  font-weight: 600;
}
.dm-comp-av {
  width: 20px;
  height: 20px;
}
.dm-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-variant);
  overflow: hidden;
}
.dm-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary-fill);
  transition: width 0.25s ease;
}
.dm-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.dm-node-card {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--outline);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dm-node-card.is-current {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}
.dm-node-card.is-fog {
  border-style: dashed;
  opacity: 0.86;
}
.dm-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.dm-node-pin {
  font-size: 10.5px;
  color: var(--on-surface-variant);
}
.dm-node-card.is-current .dm-node-pin {
  color: var(--primary-text);
  font-weight: 600;
}
.dm-travel-btn {
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.dm-node-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-bg);
}
.dm-node-desc {
  font-size: 11px;
  color: var(--on-surface-variant);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dm-custom-row {
  display: flex;
  gap: 7px;
  margin-top: 4px;
}
.dm-custom-input {
  flex: 1;
  min-width: 0;
}

/* ---------- 5. 全站真机巡检修复补丁（验证码零破图 / 顶部公告轨道轮播 / 窄屏广场角标防撞 / 梦设卡底栏） ---------- */
.auth-captcha-img[hidden],
.auth-captcha-loading[hidden] {
  display: none !important;
}

.dream-card-sheet {
  padding-bottom: 8px;
}
.ui-sheet-foot .dream-card-actions {
  margin-top: 0;
  width: 100%;
}

/* 广场横滑条彻底隐藏各内核滚动槽 + 窄屏双列卡片左右角标防重叠 */
.plaza-category-bar::-webkit-scrollbar,
.plaza-tags::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.plaza-card-hook {
  max-width: calc(100% - 114px);
}
@media (max-width: 520px) {
  .plaza-card-hook {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 102px);
    padding: 3px 7px;
    font-size: 10.5px;
  }
  .chip.plaza-take {
    top: 8px;
    right: 8px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }
}

/* 顶部公告与分享活动轮播轨道（.top-rail / .activity-slide） */
.top-rail {
  margin: 0 0 10px;
}
.app-notice .top-rail {
  margin: 0;
}
.top-rail-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-card, 12px);
}
.top-rail-track {
  display: flex;
  width: 100%;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .top-rail-track {
    transition: none;
  }
}
.top-rail-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 !important;
}
.activity-slide {
  display: flex;
  align-items: center;
  border-radius: var(--r-card, 12px);
  border: 1px solid var(--outline);
  border-left: 3px solid var(--primary);
  background: var(--surface);
  overflow: hidden;
}
.activity-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 8px 9px 12px;
  border: 0;
  background: transparent;
  color: var(--on-bg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.activity-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-copy b {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-bg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-copy span {
  font-size: 11.5px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-cta {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.activity-cta.activity-cta-ghost {
  background: var(--surface-variant);
  color: var(--primary-text);
  border: 1px solid var(--outline);
}
.activity-close {
  flex: none;
  width: 34px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.activity-close:hover {
  color: var(--on-bg);
}
.top-rail-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.activity-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--outline);
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}
.activity-dot.on {
  width: 16px;
  background: var(--primary);
}


