/* 《海液》 —— anemoia.ink
   夜海（默认）/ 纸白 双主题；通道呈现：内心＝默认（凡非他人发言/外界信息/回忆皆是）/
   海声 / 他人发言 / 主角发言 / 回忆话语 / 手机信息 / 信息流 / 场景旁白（贴说话方一侧）；
   「显影」为无楷体系统的可读性回退（三下划线，不波及气泡）。 */

:root {
  color-scheme: dark;
  --bg: #0a0f14;
  --bg-hi: #0c1219;   /* 海水纵深：顶部微亮、底部更沉，渐变铺在固定层 body::before */
  --bg-lo: #080d12;
  --text: #d8dee6;
  --sea: #9fc4d8;
  --sea-strong: #c6e2f2;
  --inner: #dcbf9d;   /* 内心荧光笔：仅 .lit 高亮联动底色；内心戏正文本身不上色 */
  --msg: #8fa0ad;
  --dim: #5f7181;        /* 暗石板色：供设置行 */
  --aside: #aab5c0;      /* 场景旁白：比正文暗一档，仍高于屏灰 */
  --rule: #22303b;
  /* 气泡 */
  --bubble-say-bg: #141d26;
  --bubble-say-border: #26333f;
  --bubble-own-bg: #262019;
  --bubble-recall-bg: rgba(20, 29, 38, .55);
  --im-thread-bg: #0d141b;
  --im-in-bg: #182330;
  --im-out-bg: #251f18;
  --bubble-shadow: 0 1px 8px rgba(0, 0, 0, .25);  /* 极轻统一光源 */
  --note-shadow: 0 6px 18px rgba(0, 0, 0, .35);   /* 浮现卡片：浮出层用更重的投影 */
  /* 说话人配色（他人发言气泡按人着色） */
  --sp-man-bg: #2a2118;     --sp-man-border: #4a3a26;
  --sp-girl-bg: #201f2c;    --sp-girl-border: #3f3a58;
  --sp-sis-bg: #122627;     --sp-sis-border: #24504f;
  --sp-machine-bg: #1a2026; --sp-machine-border: #333d46;
  --sp-mom-bg: #2b1d1c;     --sp-mom-border: #4e332f;
  --sp-doubao-bg: #291b25;  --sp-doubao-border: #55344a;
  /* 可点词条：暗示强度旋钮（作者可拨；0 = 纯阈下模式） */
  --term-hint-opacity: .25;
  /* 视觉旋钮（作者可拨） */
  --grain: .025;        /* 纸纹强度，0 = 无纹理 */
  --tail-size: 9px;     /* 气泡尾巴尺寸，0 = 关闭 */
  --sea-drift: 14s;     /* 海声字距呼吸周期 */
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f5f2ea;
  --bg-hi: #f8f5ee;
  --bg-lo: #f0ebdd;
  --text: #1c1c1c;
  --sea: #1d4e79;
  --sea-strong: #0e3a63;
  --inner: #7a5230;
  --msg: #70747c;
  --dim: #8f8877;
  --aside: #5f5a50;
  --rule: #d9d2c0;
  --bubble-say-bg: #ece7da;
  --bubble-say-border: #d8d2c2;
  --bubble-own-bg: #efe6d4;
  --bubble-recall-bg: rgba(236, 231, 218, .5);
  --im-thread-bg: #f0ece1;
  --im-in-bg: #e4ddcc;
  --im-out-bg: #f8f0dd;
  --bubble-shadow: 0 1px 8px rgba(96, 80, 50, .12);
  --note-shadow: 0 6px 18px rgba(96, 80, 50, .18);
  /* 说话人配色（纸白） */
  --sp-man-bg: #ede3cf;     --sp-man-border: #d9c7a4;
  --sp-girl-bg: #e7e3f0;    --sp-girl-border: #cfc8e2;
  --sp-sis-bg: #dbebe8;     --sp-sis-border: #b5d3cc;
  --sp-machine-bg: #e8e6df; --sp-machine-border: #cfccbe;
  --sp-mom-bg: #f1ddd6;     --sp-mom-border: #dfc0b6;
  --sp-doubao-bg: #f4e4ee;  --sp-doubao-border: #dbb8cd;
  --grain: .035;
}

/* 字号三档：小 / 中 / 大 */
html.fs-0 { --fs: 16px; }
html.fs-1 { --fs: 19px; }
html.fs-2 { --fs: 22px; }

@media (max-width: 640px) {
  html.fs-0 { --fs: 15px; }
  html.fs-1 { --fs: 18px; }
  html.fs-2 { --fs: 21px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  font-size: var(--fs);
  transition: background-color .35s ease, color .35s ease;
  /* 整页禁选：快速连点推进时防止误划选正文（作者指令，防误触、非版权保护）；错误卡仍可复制 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#error, #error * {
  -webkit-user-select: text;
  user-select: text;
}

/* 海水纵深：极淡的垂直渐变铺在固定层，正文浮于其上 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--bg-hi), var(--bg-lo));
}

/* 纸纹：固定层，极轻；--grain 拨到 0 即关闭 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='.9'/></svg>");
  background-size: 180px 180px;
}

/* 细滚动条与选区（整页禁选下实际只有错误卡可选中） */
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--sea) 45%, var(--rule)) transparent;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, color-mix(in srgb, var(--sea) 55%, var(--rule)), var(--rule));
  border-radius: 4px;
}
::-webkit-scrollbar-track { background: transparent; }

::selection { background: color-mix(in srgb, var(--sea) 28%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 固定件：设置行（左上）与时钟（右上） ---------- */

#settings {
  position: fixed;
  top: 1em;
  left: 1.2em;
  z-index: 20;
  display: flex;
  gap: 1.2em;
  font-size: 12px;
  letter-spacing: .1em;
}

#clock {
  position: fixed;
  top: 1em;
  right: 1.2em;
  z-index: 20;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 7.2em;
  text-align: right;
}

#settings button {
  appearance: none;
  background: none;
  border: 0;
  padding: .2em 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--dim);
  cursor: pointer;
  transition: color .2s ease;
}

#settings button:hover,
#settings button:focus-visible { color: var(--text); }

#settings button[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .35em;
}

button.choice:focus-visible,
.title-actions button:focus-visible,
#settings button:focus-visible {
  outline: 1px dashed var(--dim);
  outline-offset: 3px;
}

/* ---------- 标题屏 ---------- */

#title {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3em 1.5em;
}

#title h1 {
  margin: 0 0 1.1em;
  font-size: clamp(3em, 12vw, 5em);
  font-weight: 600;
  letter-spacing: .38em;
  text-indent: .38em; /* 抵消末字字距，保持视觉居中 */
}

#title .rule {
  width: 5.5em;
  height: 1px;
  border: 0;
  margin: 0 0 1.6em;
  background: var(--rule);
}

#title .tagline {
  margin: 0 0 3.5em;
  color: var(--dim);
  font-size: .95em;
  letter-spacing: .18em;
}

.title-actions { display: flex; flex-direction: column; gap: 1em; }

/* 入场渐次显影：题名收字距、分隔线展开、标语与动作延迟淡入（一次性；reduced-motion 直接落定终态） */
#title h1 { animation: title-in 1.1s ease-out both; }

#title .rule {
  transform-origin: center;
  animation: rule-in .8s ease .35s both;
}

#title .tagline { animation: fade-in .9s ease .6s both; }
#title .title-actions { animation: fade-in .9s ease .8s both; }

@keyframes title-in {
  from { opacity: 0; letter-spacing: .5em; text-indent: .5em; }
}

@keyframes rule-in {
  from { transform: scaleX(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* ---------- 选项与标题动作（当前全文零选项，机制为未来预留） ---------- */

.title-actions button,
button.choice {
  appearance: none;
  background: none;
  border: 0;
  padding: .1em 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  opacity: .42;
  transition: opacity .25s ease;
}

.title-actions button { letter-spacing: .22em; }

.title-actions button:hover,
.title-actions button:focus-visible,
button.choice:hover,
button.choice:focus-visible { opacity: 1; }

/* 选项只活在内心声部：与内心戏同款呈现（默认色，不加 tint） */

/* ---------- 阅读流：只涨不退的潮 ---------- */

#reading { min-height: 100vh; }

#flow {
  max-width: 36em;
  margin: 0 auto;
  padding: 4em 1.5em 45vh; /* 底部留白，让新段落永远有落潮的空气 */
}

#flow p {
  margin: 0 0 1.9em;
  line-height: 1.9;
  text-align: justify;
  line-break: strict;
  hanging-punctuation: first;
  overflow-wrap: break-word;
  /* 中文标点挤压与比例字宽：不支持的浏览器自动退化为原样 */
  text-spacing-trim: trim-start;
  font-variant-east-asian: proportional-width;
}

/* 内心戏＝默认通道：不加色、不改字体字号，整行居中（通道类由渲染层挂段落）。海声同归居中 */
#flow p.inner,
#flow p.sea { text-align: center; }

/* 落潮：段落/章头/线程浮现即入潮。只写 from，落定值交还元素本身（recall 的 .8 半透明不会被顶回 1） */
#flow > *,
#flow p {
  animation: tide-in .7s cubic-bezier(.25, .6, .3, 1) both;
}

/* 存档批量恢复时禁用入场动画，避免整卷重播 */
#flow.no-anim * { animation: none !important; }
#flow.no-anim *::before,
#flow.no-anim *::after { animation: none !important; }

@keyframes tide-in {
  from { opacity: 0; transform: translateY(.7em); }
}

/* 海声：楷体 + 色温偏移 */
.sea {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "DFKai-SB", serif;
  color: var(--sea);
}

/* 海声＝信号，不是风景：极淡光池 + 极慢字距呼吸（reduced-motion 下由全局规则禁用） */
#flow p.sea {
  background: radial-gradient(ellipse 65% 130% at 50% 118%,
    color-mix(in srgb, var(--sea) 8%, transparent), transparent 70%);
  animation: tide-in .7s cubic-bezier(.25, .6, .3, 1) both,
             sea-drift var(--sea-drift) ease-in-out 1.2s infinite alternate;
}

@keyframes sea-drift {
  from { letter-spacing: .004em; }
  to { letter-spacing: .02em; }
}

/* 外部信息／屏幕文本：屏灰，宋体不变 */
.msg { color: var(--msg); }

/* 显影：三通道不同下划线（楷体／色彩降级可辨；不波及气泡通道） */
html.reveal .sea {
  color: var(--sea-strong);
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
}

html.reveal .inner {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
}

html.reveal .msg {
  color: var(--msg);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
}

/* …… 六点省略号永不跨行折断（气泡内同样生效） */
.ell { white-space: nowrap; }

/* ---------- 可点词条：顶标（ruby 注本）与浮现（卡片） ---------- */

.term {
  cursor: help;
  border-bottom: 1px dotted currentColor;
  border-bottom-color: color-mix(in srgb, currentColor calc(var(--term-hint-opacity) * 100%), transparent);
  transition: border-bottom-color .3s ease;
}

.term:hover,
.term:focus {
  border-bottom-color: currentColor; /* hover/focus 满显示 */
  outline: none;
}

.term rt {
  font-size: .6em;
  letter-spacing: .05em;
  color: var(--dim);
}

.note-card {
  position: absolute;
  z-index: 50;
  max-width: 22em;
  padding: .6em .8em;
  font-size: .85em;
  line-height: 1.8;
  text-align: left;
  background: var(--bubble-say-bg);
  border: 1px solid var(--bubble-say-border);
  border-radius: 8px;
  box-shadow: var(--note-shadow);
  cursor: default;
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

/* 卡片指针：钉在词条中心。卡片默认在词条上方，指针在底边；翻到下方时改 data-side="below" */
.note-card::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: var(--arrow-x, 50%);
  width: 10px;
  height: 10px;
  background: var(--bubble-say-bg);
  border-right: 1px solid var(--bubble-say-border);
  border-bottom: 1px solid var(--bubble-say-border);
  transform: translateX(-50%) rotate(45deg);
}

.note-card[data-side="below"]::before {
  bottom: auto;
  top: -6px;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--bubble-say-border);
  border-top: 1px solid var(--bubble-say-border);
}

/* 卡片内再点一层：目标词（如“苹果”）→ 后续文本（如“苹果手机”） */
.note-card .note-term {
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  border-bottom-color: color-mix(in srgb, currentColor 55%, transparent);
  transition: border-bottom-color .3s ease;
}

.note-card .note-term:hover,
.note-card .note-term:focus {
  border-bottom-color: currentColor;
  outline: none;
}

.note-card--follow { color: var(--inner); }

/* 高亮联动：inner 暖色荧光笔底；入场 1.2s 呼吸脉冲后落定为静态（reduced-motion 直接静态） */
.lit {
  background: color-mix(in srgb, var(--inner) 32%, transparent);
  border-radius: 2px;
  padding: 0 .05em;
  animation: lit-pulse 1.2s ease-out 1;
}

@keyframes lit-pulse {
  0% { background: color-mix(in srgb, var(--inner) 55%, transparent); }
  100% { background: color-mix(in srgb, var(--inner) 32%, transparent); }
}

/* ---------- 会话气泡：say / own / recall ---------- */

#flow p.say,
#flow p.own,
#flow p.recall {
  position: relative;
  width: fit-content;
  max-width: 78%;
  margin-bottom: .8em;
  padding: .55em .9em;
  line-height: 1.9;
  text-align: left;
  box-shadow: var(--bubble-shadow);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

#flow p.say {
  --bubble-edge: var(--bubble-say-border);
  margin-right: auto;
  background: var(--bubble-say-bg);
  border: 1px solid var(--bubble-say-border);
  border-radius: 10px 10px 10px 2px;
}

#flow p.own {
  margin-left: auto;
  background: var(--bubble-own-bg);
  border-radius: 10px 10px 2px 10px;
}

/* 回忆：虚线、半透明、文字整体调暗一档（记忆降级） */
#flow p.recall {
  margin-right: auto;
  background: var(--bubble-recall-bg);
  border: 1.5px dashed var(--bubble-say-border);
  border-radius: 10px 10px 10px 2px;
  opacity: .8;
}

/* 气泡后接叙述：补回段落间距（相邻 margin 折叠后约 1.1em） */
#flow p.say + p.inner,
#flow p.own + p.inner,
#flow p.recall + p.inner,
#flow p.say + p.sea,
#flow p.own + p.sea,
#flow p.recall + p.sea { margin-top: 1.1em; }

/* ---------- 场景旁白：不成泡、不居中，贴在说话方一侧的留白 ---------- */
/* aside＝他人／现场侧（贴左）；aside:own＝我侧（贴右）。无底色、无尾巴，只靠位置与色阶退后。 */

#flow p.aside,
#flow p.aside-own {
  width: fit-content;
  max-width: calc(78% - 1em);
  margin-bottom: .8em;
  line-height: 1.9;
  text-align: left;
  text-wrap: balance;
  color: var(--aside);
}

/* 缩进 1em：与气泡内文字的左右缘对齐，读作贴着这段对话的舞台指示 */
#flow p.aside { margin-right: auto; margin-left: 1em; }
#flow p.aside-own { margin-left: auto; margin-right: 1em; }

/* 旁白只是场景拍：后接内心／海声时恢复段落间距 */
#flow p.aside + p.inner,
#flow p.aside-own + p.inner,
#flow p.aside + p.sea,
#flow p.aside-own + p.sea { margin-top: 1.9em; }


/* ---------- 手机聊天线程：im-in / im-out ---------- */

/* 说话人配色：他人发言气泡按人着色（底色/边框，文字色不变）；无说话人标识时用通道底色 */
#flow p.say.sp-man     { --bubble-edge: var(--sp-man-border);     background: var(--sp-man-bg);     border-color: var(--sp-man-border); }
#flow p.say.sp-girl    { --bubble-edge: var(--sp-girl-border);    background: var(--sp-girl-bg);    border-color: var(--sp-girl-border); }
#flow p.say.sp-sis     { --bubble-edge: var(--sp-sis-border);     background: var(--sp-sis-bg);     border-color: var(--sp-sis-border); }
#flow p.say.sp-machine { --bubble-edge: var(--sp-machine-border); background: var(--sp-machine-bg); border-color: var(--sp-machine-border); }
#flow p.say.sp-mom     { --bubble-edge: var(--sp-mom-border);     background: var(--sp-mom-bg);     border-color: var(--sp-mom-border); }

/* 豆包语音：语义仍是 say（他人声音），但落在主角自己这一侧，尾与圆角同 own */
#flow p.say.sp-doubao {
  --bubble-edge: var(--sp-doubao-border);
  background: var(--sp-doubao-bg);
  border-color: var(--sp-doubao-border);
  margin-left: auto;
  margin-right: 0;
  border-radius: 10px 10px 2px 10px;
}
#flow p.say.sp-doubao::before,
#flow p.say.sp-doubao::after {
  left: auto;
  right: 13px;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
#flow p.say.sp-doubao::before { right: 12px; }

/* 豆包外链：保持气泡文字色，用虚线下划线提示可点 */
#flow a.doubao-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--sp-doubao-border) 85%, transparent);
}
#flow a.doubao-link:hover { border-bottom-color: var(--sp-doubao-border); }
#flow a.doubao-link:focus-visible {
  outline: 1px dotted var(--sp-doubao-border);
  outline-offset: 3px;
}

.im-thread {
  width: min(78%, 30em);
  margin: 0 auto 1.9em;
  padding: .7em .8em;
  border: 1px solid color-mix(in srgb, var(--rule) 75%, transparent);
  border-radius: 12px;
  background: var(--im-thread-bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent), var(--bubble-shadow);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

#flow .im-thread p {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 .35em;
  padding: .35em .7em;
  font-size: .95em;
  line-height: 1.55;
  text-align: left;
  border-radius: 10px;
  transition: background-color .35s ease;
  animation: feed-in .35s ease both;
}

#flow .im-thread p:last-child { margin-bottom: 0; }

#flow p.im-in { margin-right: auto; background: var(--im-in-bg); }
#flow p.im-out { margin-left: auto; background: var(--im-out-bg); }

/* 气泡尾巴：say 带描边（双层三角），own 单层填充；recall/im 无（回忆不是现场，线程自带容器） */
#flow p.say::before,
#flow p.say::after,
#flow p.own::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 13px;
  width: calc(var(--tail-size) * 1.33);
  height: var(--tail-size);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* 外圈只比内层大 1px：补上气泡描边，尖端留一点边 */
#flow p.say::before {
  left: 12px;
  width: calc(var(--tail-size) * 1.55);
  height: calc(var(--tail-size) * 1.1);
  background: var(--bubble-edge, var(--bubble-say-border));
}

#flow p.say::after,
#flow p.own::after { background: inherit; }

#flow p.own::after {
  left: auto;
  right: 13px;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* ---------- 信息流分组：连续 msg 成组（屏幕质感） ---------- */

.msg-group {
  margin: 0 0 1.9em;
  padding: .75em 1em;
  border: 1px solid color-mix(in srgb, var(--msg) 12%, transparent);
  border-radius: 12px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--msg) 7%, transparent),
    color-mix(in srgb, var(--msg) 2.5%, transparent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--msg) 14%, transparent), var(--bubble-shadow);
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}

/* 每条消息逐拍送入（推进模型下没有批量入场，故不做级联延迟）：短促刷新，区别于潮感 */
#flow .msg-group p {
  margin: 0 0 .3em;
  font-size: .96em;
  line-height: 1.6;
  animation: feed-in .35s ease both;
}

#flow .msg-group p:last-child { margin-bottom: 0; }

@keyframes feed-in {
  from { opacity: 0; transform: translateY(2px); }
}

/* ---------- 章头：新的潮带 ---------- */

header.chapter {
  margin: 5.5em 0 3.5em;
  text-align: center;
}

/* 潮带：章号上方一条细线从中心展开，字距由宽收窄、微模糊落定 */
header.chapter::before {
  content: "";
  display: block;
  width: 4.5em;
  height: 1px;
  margin: 0 auto 1.6em;
  background: var(--rule);
  transform-origin: center;
  animation: rule-in .8s ease both;
}

header.chapter span {
  font-size: 1.55em;
  letter-spacing: .2em;
  opacity: .88;
  animation: chapter-in .9s cubic-bezier(.25, .6, .3, 1) both;
}

@keyframes chapter-in {
  from { opacity: 0; filter: blur(3px); letter-spacing: .32em; }
}

/* ---------- 结局屏 ---------- */

p.endline {
  text-align: center;
  letter-spacing: .14em;
  margin: 2.4em 0;
}

.restart-wrap {
  text-align: center;
  margin: 3.5em 0 10vh;
}

.restart-wrap .choice {
  display: inline-block;
  width: auto;
}

/* ---------- 泥板引文（结尾预留；正文写上去之前不产生任何 DOM） ---------- */

.tablet {
  max-width: 26em;
  margin: 4.5em auto 6em;
  padding: 2.2em 2.2em 2.6em;
  border: 1px solid color-mix(in srgb, var(--inner) 22%, var(--rule));
  border-radius: 3px;
  background: color-mix(in srgb, var(--inner) 9%, var(--bg-hi));
}

.tablet .en {
  display: block;
  margin: 0 0 1.4em;
  font-size: .92em;
  line-height: 1.95;
  letter-spacing: .02em;
}

.tablet .zh {
  display: block;
  color: var(--dim);
  font-size: .9em;
  line-height: 1.9;
}

/* 移动端：气泡放宽到 85% */
@media (max-width: 640px) {
  #flow p.say, #flow p.own, #flow p.recall { max-width: 85%; }
  #flow p.aside, #flow p.aside-own { max-width: calc(85% - 1em); }
  .im-thread { width: 85%; }
}

/* ---------- 错误卡（.ink 编译错误直接可读） ---------- */

#error {
  max-width: 42em;
  margin: 18vh auto;
  padding: 1.6em 2em;
  border: 1px solid var(--rule);
}

#error .error-title { margin: 0 0 .8em; font-size: 1.1em; letter-spacing: .08em; }

#error pre {
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--dim);
}
