@charset "UTF-8";

/* ==========================================================================
   图标字体：HM Symbol（鸿蒙 Symbol）子集
   --------------------------------------------------------------------------
   原来散在各处的内联 SVG 统一换成这套字体图标：
     <i class="ic" aria-hidden="true">&#xF00DA;</i>     ← chevron_left
   好处：继承文字颜色与字号，天然跟着主题色/缩放走；也省掉一堆重复的 svg 标签。
   进包的只有 assets/hmsymbol.woff2（6KB，按用到的字形子集化），
   4.2MB 的原字体不在仓库里参与打包。
   ⚠️ 彩色天气/情绪表情不走这里 —— 那是 Microsoft 表情图片，见 emoji-map.js。
   ========================================================================== */
@font-face {
  font-family: "HM Symbol";
  src: url("assets/hmsymbol.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;          /* 图标宁可晚一秒出现，也不要先闪成方框 */
}
.ic {
  font-family: "HM Symbol", sans-serif;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}
/* ==========================================================================
   留白 V2 — 首页 + 话题列表 Demo
   --------------------------------------------------------------------------
   设计基准：主界面.png / 话题.png（440 × 956 pt @4x）
   单位约定：1rem = 20 设计 pt
     html { font-size: calc(min(100vw, 440px) / 22); }
     所以在 440pt 宽的设计稿上 1rem = 20px，在 393pt 手机上整体等比缩放，
     布局比例与设计稿完全一致，不会溢出。
   ========================================================================== */

:root {
  /* ==========================================================================
     留白 3.0 · 设计令牌（单一事实来源）
     --------------------------------------------------------------------------
     语义化命名，组件里不再直接写十六进制。改动顺序：
        色板 → 语义颜色 → 兼容别名 → 圆角 / 阴影 / 间距 / 排版 / 动效
     旧令牌（--ink / --ink-soft / --placeholder / --line / --r-* / --shadow-*）
     全部保留为别名，全站既有样式不用改一行就跟着换色 —— 这样这次升级是
     「换一套统一的值」，不是「重写一遍样式」。

     对比度（WCAG 2.1，正文 4.5:1 / 大字与控件 3:1）已按 #F5F6F3 与 #FCFCFB
     两种底色实算：
       ink 18.15 / secondary 7.08 / tertiary 5.21
       brand #1B4FBF 6.6（分区眉标、品牌强调）
       interactive #207BFF 3.6（只用于描边、焦点、图形，不做小字）
       interactive-strong #1B4FBF 7.2（填充按钮、链接文字）
       danger 6.06 / success 4.90 / warning 5.46

     暗色模式：本次不引入。现有界面由纸面、日记本、树洞、泡泡机等浅色实拍素材
     构成，且产品从未提供外观切换；凭空加一个暗色外观属于新增功能，不是这次
     OTA 的设计升级范围。这里用 color-scheme: light 明确告诉 WebView / 表单控件
     「本页始终是浅色」，避免系统深色时原生控件与滚动条变黑。
     ========================================================================== */
  color-scheme: light;

  /* ---- 色板 ---- */
  --color-paper: #F5F6F3;              /* 页面基础背景（暖白纸面） */
  --color-surface: #FCFCFB;            /* 主要内容表面 */
  --color-surface-secondary: #F2EFE9;  /* 次级表面 / 输入底（暖中性） */
  --color-surface-raised: #FFFFFF;     /* 浮层、弹窗、菜单 */
  --color-text-primary: #0B0B0A;
  --color-text-secondary: #55534E;
  --color-text-tertiary: #6A675F;
  --color-text-inverse: #FCFCFB;
  --color-brand: #1B4FBF;              /* 3.0 蓝主题：品牌强调（纸面 6.6:1） */
  --color-brand-deep: #163C9C;
  --color-brand-soft: rgba(32, 123, 255, 0.10);
  --color-interactive: #207BFF;        /* 焦点、描边、图形：非文字强调 */
  --color-interactive-strong: #1B4FBF; /* 填充按钮 / 链接文字（白字 7.2:1） */
  --color-interactive-pressed: #163C9C;
  --color-focus: #207BFF;
  --color-border-subtle: rgba(11, 11, 10, 0.08);
  --color-border-strong: rgba(11, 11, 10, 0.16);
  --color-overlay: rgba(24, 26, 33, 0.22);
  --color-danger: #B42318;
  --color-success: #1F7A4D;
  --color-warning: #8A5A00;
  --color-nav-solid: rgba(255, 255, 255, 0.92);

  /* ---- 兼容别名：既有样式全部读这几个 ---- */
  --ink: var(--color-text-primary);
  --ink-soft: var(--color-text-secondary);
  --placeholder: var(--color-text-tertiary);
  --line: var(--color-border-subtle);

  /* ---- 圆角层级 ----
     胶囊 / 控件 / 输入框 / 内容容器 / 浮层 / 气泡。数值沿用既有设计，
     只是把「同一层里该用哪个」写清楚；不是把所有角统一成一个大圆角。 */
  --r-pill: 999px;
  --r-control: 0.85rem;      /* 17pt：chip、小按钮 */
  --r-field: 0.95rem;        /* 19pt：输入框 */
  --r-card: 1rem;            /* 20pt：内容容器 */
  --r-panel: 1.5rem;         /* 30pt：浮层 / 大面板 */
  --r-bubble: 1.1rem;
  --r-chip: var(--r-control);
  /* 屏幕圆角：主流安卓 2024–25 旗舰实测多在 40–48dp、中端 24–30dp，
     加权平均约 36dp。本页根字号 = 屏宽 / 22，36dp 约合 2.2rem。
     只用在「朝对话区」的面上（话题抽屉右侧两角）。 */
  --r-screen: 2.2rem;

  /* 话题抽屉的毛玻璃（CSS 实时合成；滑块会改这两个值） */
  --drawer-tint: 0.88;
  --drawer-blur: 20px;

  /* ---- 阴影：只在「浮起来」的层用 ---- */
  --shadow-1: 0 0.05rem 0.35rem rgba(20, 22, 20, 0.07);
  --shadow-2: 0 0.1rem 0.45rem rgba(110, 74, 44, 0.12);
  --shadow-sheet: 0 1.4rem 3.2rem rgba(20, 22, 20, 0.18),
                  0 0.15rem 0.55rem rgba(20, 22, 20, 0.06);

  /* ---- 间距：4pt 起步的 10 级 ----
     只在新写 / 改写的规则里使用；既有规则保持原值，避免一次改 800 处间距。 */
  --space-1: 0.2rem;   /*  4pt */
  --space-2: 0.4rem;   /*  8pt */
  --space-3: 0.6rem;   /* 12pt */
  --space-4: 0.8rem;   /* 16pt */
  --space-5: 1rem;     /* 20pt */
  --space-6: 1.2rem;   /* 24pt */
  --space-7: 1.6rem;   /* 32pt */
  --space-8: 2.4rem;   /* 48pt */
  --space-9: 3.2rem;   /* 64pt */
  --space-10: 4rem;    /* 80pt */

  /* ---- 动效 ----
     微交互 120–180ms / 状态切换 180–240ms / 面板 240–320ms。
     时长是参数，不是规范；拖动类交互不用这里的时长，必须跟手。
     数值恰好等于 token 的直写值已等值收口为 var(--dur-*)；
     其余时长是逐处调过的编排值，保留原样，不硬套。 */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 240ms;
  --dur-4: 320ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* ---- 排版下限 ----
     留白的字号原本跟着屏宽等比缩放：440pt 宽时 1rem = 20px，360pt 宽时 1rem = 16.4px。
     小屏上的正文会掉到 13px 左右，低于舒适阅读区。这里给「要读的字」加一个
     像素下限（clamp），布局比例不变，只是不让小屏把字压得太小。
     440pt 宽时取值与原来完全一致，所以设计稿观感不变。 */
  --fs-reading: clamp(15px, 0.9rem, 19px);   /* 对话正文 / 树洞回声 */
  --fs-body: clamp(14px, 0.8rem, 17px);      /* 常规正文 */
  --fs-label: clamp(14px, 0.82rem, 17px);    /* 设置项、按钮标签 */
  --fs-note: clamp(12px, 0.66rem, 14px);     /* 说明、脚注 */
  --fs-eyebrow: clamp(11.5px, 0.68rem, 13.6px); /* 分区眉标 */
  --fs-caption: clamp(11px, 0.62rem, 13px);  /* 时间、计数、状态 */
  --fs-input: clamp(16px, 0.9rem, 19px);     /* 输入区（≥16px 避免聚焦缩放） */
  --fs-page-title: clamp(25px, 1.6rem, 34px);
  --fs-hero: clamp(24px, 1.5rem, 32px);
  --fs-title: clamp(22px, 1.34rem, 30px);

  /* ---- 触控 ----
     视觉尺寸可以小于 44，热区不能小于 44。所有「小圆钮」用伪元素扩热区。 */
  --tap-min: 44px;


  /* ---- 页面背景 ----
     暖白纸面 → 雾蓝。默认梯度按 #A9C7FF 预计算，和 app.js 的 applyAccent
     使用同一条公式；JS 启动时会按用户选的强调色重写，首帧不跳色。
     3.0 的主题色为雾蓝：纸面上半屏保持安静，蓝在下半屏慢慢浮出来。 */
  --bg: linear-gradient(
    to bottom,
    #F5F6F3 0%,
    #F5F6F3 46%,
    #F4F5F3 54%,
    #F1F4F4 60%,
    #ECF0F4 67%,
    #E3EBF6 74%,
    #DCE6F7 80%,
    #CDDEF9 90%,
    #A9C7FF 100%
  );

  /* 快捷栏与输入框：实心暖白。
     底部栏落在渐进模糊带里，半透明会让模糊透上来把按钮糊掉。 */
  --chip-bg: linear-gradient(to bottom, #FFFFFF 0%, #F7F7F3 100%);
  --ask-bg:  linear-gradient(to bottom, #FFFFFF 0%, #FBFBF8 100%);

  /* 遮罩：压暗底层、拉开抽屉层次，同时保留可见的背景（不是一块死黑） */
  --scrim: var(--color-overlay);

  /* 主题强调色 + 由它调出的浅色（聊天气泡底）。
     app.js 的 applyAccent 会随用户设置实时覆盖这两个值；
     3.0 默认雾蓝 #A9C7FF，气泡是它向白调 55% 的结果。 */
  --accent: #A9C7FF;
  --bubble: #D0E0FF;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  /* ---- 字体 ----
     正文：平台的中文字体（iOS/安卓 WebView 各自给 PingFang / HarmonyOS Sans /
     Noto Sans CJK）。这是 Apple 系产品的常规做法，也是这个项目里最省成本的选择：
     OPPO Sans 的 woff2 有 13 MB，装进包里、每次启动都要解析，而系统字体为 0 字节。
     OPPO Sans 的字体文件保留在 assets/ 与 @font-face 里，没有删除，随时可以切回。
     标题：钉钉进步体（985 KB）—— 原版中文界面的大标题字体，保留品牌辨识度。
     Leon Sans 的 @font-face 也保留（英文版用过），中文界面不再引用。 */
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC",
               "Microsoft YaHei", sans-serif;
  --brand: "DingTalk JinBuTi", -apple-system, BlinkMacSystemFont, "PingFang SC",
           "Hiragino Sans GB", "HarmonyOS Sans SC", "Noto Sans SC",
           "Microsoft YaHei", sans-serif;
}

/* Leon Sans 2.0 —— 全站唯一字体（正文、UI、标题都用它）。
   设计 / 工程：Jongmin Kim，SIL Open Font License 1.1。
   变量轴 wght 100–900，467 字形（latin + latin-ext），373 KB。
   取代原来的 OPPO Sans（13.6 MB）与钉钉进步体。 */
@font-face {
  font-family: "Leon Sans";
  src: url("assets/leon-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 钉钉进步体：中文界面的标题字体（--brand 引用）。
   Leon Sans / OPPO Sans 的 @font-face 保留，中文界面不再引用，文件也没有删除。 */
@font-face {
  font-family: "DingTalk JinBuTi";
  src: url("assets/DingTalkJinBuTi.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* OPPO Sans 4.0 —— 全站主字体。
   源文件 assets/oppo-sans.woff2 由 素材/OPPO Sans 4.0.ttf 转码而来（可变字重）。
   font-display: swap：首屏先用系统字垫一下，字体到位后再换，不白屏。 */
@font-face {
  font-family: "OPPO Sans";
  src: url("assets/oppo-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

/* 整个 App 的比例来自这一个变量：
     设计稿 440pt 宽 ÷ 22 = 20px，所以 1rem = 20 设计 pt。
     · 手机上 = 屏幕宽度（比例与设计稿一致）
     · 平板上最多放大到 1.5 倍（660pt），再宽一行字就读不动了
     · 再按高度反推一次，横屏和扁屏幕上不会上下溢出
     JS 会用 visualViewport 覆盖它（见 syncUnit），这里只是首屏兜底。 */
:root {
  /* 兜底值。0.92 的由来见 app.js 的 syncUnit（横屏不再被压成窄条） */
  --unit: min(100vw, 660px, 100dvh * 0.92);
}

html {
  /* 15px 下限：极窄屏（<330px）上不让最小的 0.58rem 掉到 8~9px。
     正常手机上 calc 远大于 15px，这一档基本不生效，不改变设计比例。 */
  font-size: max(calc(var(--unit) / 22), 15px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* 和 .app 同一张渐变：画布被 16:9 上限截住时，多出来的部分由这里补上，
     不会再露出 #F2F4F7 那种灰底（横屏平板上特别刺眼）。 */
  background: var(--bg);
  /* 锁死文档：手机上软键盘弹起时，浏览器默认会把整页顶上去，
     输入框看着"跳"一下。固定定位之后只剩内部滚动。 */
  position: fixed;
  inset: 0;
  height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
}

button:not(:where(.lb-astryx *, .topic-controls *, [data-astryx-portal] *)) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

/* 注意：padding 必须显式清零。
   iOS Safari 的 UA 样式给 input / textarea 加了 padding-inline: 0.5em
   （16pt 字号下就是 8pt），Chrome 只给 2px，各家还不一样。
   不写这一行，搜索框里的文字就会被推右 8pt，和黑胶囊里的「发起新话题」
   对不齐 —— 就是「未对齐」那个 bug。 */
input:not(:where(.lb-astryx *, .topic-controls *, [data-astryx-portal] *)),
textarea:not(:where(.lb-astryx *, .topic-controls *, [data-astryx-portal] *)) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}

input:focus:not(:where(.lb-astryx *, .topic-controls *)),
textarea:focus:not(:where(.lb-astryx *, .topic-controls *)) { outline: none; }

img { display: block; -webkit-user-drag: none; user-select: none; }

/* ---------- 手机屏幕容器 ---------- */
.app {
  position: relative;
  /* 画布宽度不再等于 --unit。
     --unit 只管「1rem 是多少」（字号与所有间距的比例），画布自己铺开：
       · 竖屏手机：铺满屏宽，和以前完全一样
       · 平板 / 横屏：一路铺到 16:9 为止
       · 比 16:9 更宽的屏（21:9 等）：画布停在 16:9 居中，两侧由 body 的同一张渐变补齐
     横屏时正文还要单独收窄，见文件末尾「横屏与平板」那段。 */
  width: 100vw;
  /* 上限从 16:9 放宽到 21:9：横屏手机（含 21:9）画布铺满，不再两侧留白 */
  width: min(100vw, calc(100dvh * 21 / 9));
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* 内容区：首页与对话页在这里互相淡入淡出，底部输入框不参与切换 */
.stage {
  position: relative;
  z-index: 1;              /* 压在极光层之上（极光只在生成回答时出现） */
  flex: 1 1 auto;
  min-height: 0;
}

/* ==========================================================================
   首页
   ========================================================================== */
.home {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  /* 快捷栏已经移到底部的 .dock 里（首页与对话页共用），
     那 24pt 的间距现在由 .quickbar 的 margin-bottom 承担，
     所以这里不再留白 —— hero 的高度与从前完全一致。 */
  padding-bottom: 0;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}

.app.is-chat .home { opacity: 0; visibility: hidden; }

/* ---------- 顶栏（首页与对话页共用，切换时不移动） ---------- */
/* 只有左侧一个话题列表按钮，直接用设计稿素材（画布 85pt，圆形按钮 42pt）。
   右侧原本还有一个「发起新话题」圆钮，已移除 —— 功能与侧栏那颗黑胶囊重复。 */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 5.3rem);      /* 106pt */
  z-index: 12;
  pointer-events: none;                                      /* 不遮挡下方内容 */
}

.iconbtn {
  position: absolute;
  /* 与话题列表同步下移：安全区 + 10.5pt + 37pt（约一个灵动岛）。
     真机浏览器的 env(safe-area-inset-top) 通常是 0，
     不加这一档按钮会直接顶进状态栏。 */
  top: calc(env(safe-area-inset-top, 0px) + 2.375rem);
  width: 4.25rem;                                            /* 85pt */
  height: 4.25rem;
  pointer-events: auto;
  transition: transform 0.16s var(--ease), opacity 0.28s var(--ease);
}

.iconbtn--menu { left: 0.445rem; }                           /* 圆心 x=51.4pt */

.iconbtn img { width: 100%; height: 100%; }

.iconbtn:active { transform: scale(0.94); }

/* 顶栏标题：首页隐藏（首页由知序与问候语承担），对话页显示 */
.topbar__title {
  position: absolute;
  left: 4.4rem;                                              /* 88pt */
  right: 1.8rem;                                             /* 留出右侧呼吸 */
  /* 必须和左边的菜单按钮同一个 top —— 按钮下移时这里要跟着动，
     否则标题会飘在按钮上方。 */
  top: calc(env(safe-area-inset-top, 0px) + 2.375rem);
  height: 4.25rem;
  margin: 0;
  line-height: 4.25rem;                                      /* 单行垂直居中 */
  font-size: 0.85rem;                                        /* 17pt */
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;                                   /* 长标题截断 */
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.app.is-chat .topbar__title { opacity: 1; }

/* ---------- 中部：知序 + 问候语 ---------- */
.hero {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 顶部让出话题按钮的位置（按钮为绝对定位，不占流），
     使「知序 + 问候语」在按钮下沿与底部快捷栏之间居中 —— 与设计稿一致 */
  padding-top: calc(env(safe-area-inset-top, 0px) + 4.775rem);   /* 95.5pt */
  padding-bottom: 0.65rem;                                      /* 13pt 视觉重心微调 */
}

.hero__greet {
  margin: 0.85rem 0 0;     /* 17pt */
  max-width: 15rem;        /* 300pt：比设计稿略宽，给长句留出均衡断行的余地 */
  font-size: 1.5rem;       /* 30pt */
  line-height: 1.75rem;    /* 35pt 行距 */
  /* 按语义断行：不再把「说不好」这类词组拆到两行；不支持时自动退回普通断行 */
  text-wrap: balance;
  cursor: pointer;
  /* 400：进步体是静态单字重，写 600 会得到浏览器合成的假粗体 */
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
  text-align: center;
  transition: opacity 0.22s var(--ease);   /* 每日问候换字时淡出再淡入 */
}

.hero__greet.is-fading { opacity: 0; }

/* ---------- 底部：快捷栏 + 输入框 ---------- */
.dock {
  position: relative;
  z-index: 1;              /* 与 .stage 同理：压在极光层之上，胶囊不透出极光 */
  flex: 0 0 auto;
  padding: 0 1.8rem calc(env(safe-area-inset-bottom, 0px) + 1.1rem);   /* 左右 36pt / 下 22pt */
}

.quickbar {
  flex: 0 0 auto;
  display: flex;
  gap: 0.7rem;             /* 14pt */
  margin-bottom: 1.2rem;   /* 24pt：与下方输入框的间距 */
}

.chip {
  flex: 1 1 0;
  height: 2.2rem;          /* 44pt：贴近 44pt 最小触控目标（原 40pt 在 393px 上约 35.7px） */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;             /* 8pt */
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  box-shadow: 0 0.05rem 0.2rem rgba(96, 126, 178, 0.10);
  font-size: 0.6rem;       /* 12pt */
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
}

.chip__ico { height: 0.9rem; width: auto; }
.chip__ico--release { height: 0.925rem; }

.chip:active { transform: scale(0.97); filter: brightness(0.985); }

/* ---- 液态玻璃底部栏（快捷栏三个 chip + 输入框） ----
   chip / 输入框的实心白渐变是有意的（见 --chip-bg 注释：半透明会让模糊透上来把
   按钮糊掉）。液态玻璃折射的是页面真实内容，底色必须让出来，否则玻璃层压在渐变
   下面什么也看不见。

   ⚠️ targets 模式下，库把 canvas 挂在**容器**（.dock）里、把 data-liquid-glass
   也记在容器上 —— 四个面共用一张画布，所以规则都从 .dock 起头，不要写回 .chip /
   .askbar 自己身上。

   「让出底色」只在真正拿到 WebGL 玻璃、而且画完第一帧之后才发生：
     无 WebGL2 → app.js 直接不接管，一个属性都不挂，胶囊就是原来那张实心白；
     拿到上下文又失败 → 库挂 "fallback"，这里没有对应规则，胶囊同样保持实心白，
       也就是说「降级 = 回到改之前」，不会出现半透明却没玻璃的破相；
     刚挂上还没出帧 → "pending" / 未 ready，先把底色按住，不闪空白。
   想整体关掉：给 <html> 加 data-no-glass，或地址栏加 #noglas。 */

/* 还没出第一帧：底色留住 */
.dock[data-liquid-glass="pending"] .chip,
.dock[data-liquid-glass="pending"] .askbar,
.dock:not(.is-glass-ready)[data-liquid-glass="webgl"] .chip,
.dock:not(.is-glass-ready)[data-liquid-glass="webgl"] .askbar {
  background: var(--chip-bg);
  box-shadow: 0 0.05rem 0.2rem rgba(96, 126, 178, 0.10);
}
.dock[data-liquid-glass="pending"] .askbar,
.dock:not(.is-glass-ready)[data-liquid-glass="webgl"] .askbar {
  background: var(--ask-bg);
  box-shadow: 0 0.1rem 0.45rem rgba(64, 96, 150, 0.12);
}

/* 玻璃在画：撤掉底色，交给画布（背景层在画布之下，留着会泛白）。
   输入框自己不设底色，但 .askbar 这层壳要撤 —— 输入框本体在画布之上，
   文字和光标照常清晰、可选、可聚焦。 */
.dock[data-liquid-glass="webgl"] .chip,
.dock[data-liquid-glass="webgl"] .askbar {
  background: none;
  box-shadow: none;
}

/* 按压反馈要改。
   原来是 .chip:active { transform: scale(0.97) } —— 底色撤掉之后，缩放只动得了
   图标和文字，玻璃胶囊纹丝不动，看着像「字缩了、按钮没缩」的穿帮。
   这里把缩放换成只作用于内容的一点点压暗，按钮本体交给玻璃的光学。
   输入框不加这条：它要聚焦、要弹键盘，任何 filter 都会给打字添堵。 */
.dock[data-liquid-glass="webgl"] .chip:active {
  transform: none;
  filter: brightness(0.97);
}

/* 输入框 */
.askbar {
  position: relative;
  height: 4rem;            /* 80pt */
  border-radius: 1.7rem;   /* 34pt */
  background: var(--ask-bg);
  box-shadow: 0 0.1rem 0.45rem rgba(64, 96, 150, 0.12);
  display: flex;
  align-items: center;
}

.askbar__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  /* 语音按钮已移除，输入区铺满整条胶囊，右侧留出一点呼吸 */
  padding: 0 1.6rem 0 1.95rem;  /* 左 39pt / 右 32pt */
  font-size: 1rem;         /* 20pt */
  font-weight: 400;
  color: #4A4A4A;
  background: none;
}

.askbar__input::placeholder { color: var(--placeholder); opacity: 1; }

/* 玻璃底下的占位文字要压深一档。
   --placeholder #6E6E73 是按「白底 ≈4.5:1，过 AA」选的（见 :root 注释）。
   可输入框一旦让出底色、露出玻璃，实测底就变成 (205,223,250) ——
   占位文字掉到 3.75:1，跌破 AA。这里只在玻璃真的生效时换深一档，
   实测 5.1:1，回到安全区。实心白那几个状态不受影响。 */
.dock[data-liquid-glass="webgl"].is-glass-ready .askbar__input::placeholder {
  color: #5A5A5F;
}

/* ==========================================================================
   对话页
   --------------------------------------------------------------------------
   知序的回答没有气泡、没有头像，通栏纯文本 —— 这是参考里最关键的一点，
   也是留白「安静」的来源。用户自己的话才是灰色气泡。
   ========================================================================== */
.chat {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding-top: calc(env(safe-area-inset-top, 0px) + 5.3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}

.app.is-chat .chat { opacity: 1; visibility: visible; }

.stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.6rem 1.5rem 1.1rem;
}

.msg { animation: msgIn 0.34s var(--ease) both; }

/* 2.7.01：消息文本默认不可选中 —— 长按消息要弹「操作菜单」，
   不能让系统的文本选择先抢；需要选中时由「选择内容」临时放开（.is-selecting）。 */
.msg { -webkit-user-select: none; user-select: none; }

/* 用户：右对齐浅灰胶囊 */
.msg--user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.35rem;
}

/* 只作用于「用户说的话」。必须带上 .msg--user 前缀：
   泡泡天空里那颗 .bubble 是同名类，一旦这里裸写 max-width: 76%，
   天空里的每颗泡泡就只剩计算直径的 76%，字撑破圆边被裁 ——
   就是「泡泡比例失衡」。 */
.msg--user .bubble,
.bubble--fly {
  max-width: 82%;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-bubble);
  background: var(--bubble, #F0F0F2);
  font-size: 0.8rem;
  line-height: 1.62;
  color: var(--ink);
  word-break: break-word;
  /* 2.7.01：用户消息文本始终右对齐（每行贴右缘）。
     同时解掉同名类 .bubble（泡泡天空的玻璃泡泡）漏进来的两条布局：
     display:grid + place-items:center 与 text-align:center 会把整块文字居中。
     这里显式改回普通文本流并右对齐；.sky .bubble / .bubble--mine 不受影响。 */
  display: block;
  text-align: right;
}

/* Phase 1 的飞行克隆体：它被挂到 <body> 上，离开了 .msg--user 的作用域，
   所以上面那条规则把两个选择器写在一起 —— 样式只有一份，不会漂移。 */
.bubble--fly {
  position: fixed;
  z-index: 9999;
  margin: 0;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

/* 飞行期间真气泡先隐身：位置已经占好，克隆体落位后再显身，避免两个同时出现 */
.msg--user .bubble.is-flying { opacity: 0; }

/* 知序：无气泡、通栏、大行距 */
.msg--zhixu {
  margin-bottom: 1.6rem;
  font-size: 0.8rem;
  line-height: 1.92;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 等待第一个字：两条很轻的呼吸骨架条。
   比一个转圈更像「正在写」，又不打破留白的安静。 */
.msg--zhixu:empty::before,
.msg--zhixu:empty::after {
  content: "";
  display: block;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: #EDEDEF;
  animation: breathe 1.5s ease-in-out infinite;
}
.msg--zhixu:empty::before { width: 64%; }
.msg--zhixu:empty::after { width: 34%; margin-top: 0.5rem; animation-delay: 0.22s; }

/* 系统提示（连不上 / 还没配置）——用安静的灰字，不弹错误框 */
.msg--sys {
  margin: 0 0 1.15rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- 功能推荐卡片 ---------- */
/* 知序推荐某个功能时，在对话末尾出现一张小卡片，点进去直接用。 */
.rec {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin: -0.35rem 0 1.15rem;
  padding: 0.72rem 0.85rem;
  border-radius: var(--r-chip);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-1);
  text-align: left;
  animation: msgIn 0.34s var(--ease) both;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.rec:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.9); }

.rec__ico {
  flex: 0 0 auto;
  width: 2rem;             /* 40pt */
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.045);
}
.rec__ico img { height: 1rem; width: auto; }

.rec__txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}
.rec__txt strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}
.rec__txt em {
  font-size: 0.64rem;
  font-style: normal;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec__go {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink-soft);
}

/* 流式：文本按「内容行」成块出现。
   一行开始时整块从 40% 淡到 100%（0.2s ease-out），随后这一行的字在原地长出来；
   同一批到达的多行由 JS 给 120ms 递延，列表项天然形成 stagger。 */
.chunk { animation: chunkIn 0.2s ease-out both; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(0.35rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 参考里新的一行是「先浅灰再转黑」，不是从全透明浮出来 */
@keyframes chunkIn {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.9; }
}

/* ---------- 知序回复的 Markdown 结构（2026-10-31） ----------
   结构只有三样：段落、短列表、加粗 —— 回答是陪伴的一段话，不是文档。
   所在容器仍是 pre-wrap（.msg--zhixu），段落内的软换行照原样断行。 */
.msg--zhixu .mdp { margin: 0.7rem 0 0; }   /* 加宽段距：回答的「分镜」呼吸感 */
.msg--zhixu .mdp--h,
.msg--zhixu b { font-weight: 600; }
.msg--zhixu .mdlist {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;                     /* 自画圆点/序号，间距可控 */
}
.msg--zhixu .mdi {
  position: relative;
  margin: 0.55rem 0 0;
  padding-left: 1.35em;                 /* 悬挂缩进：第二行对齐首字，不顶到圆点下 */
}
.msg--zhixu .mdi::before {
  content: attr(data-marker);           /* '•' 或 '1.' */
  position: absolute;
  left: 0.18em;
  opacity: 0.62;
}
.msg--zhixu .mdp:first-child,
.msg--zhixu .mdlist:first-child,
.msg--zhixu .mdi:first-child { margin-top: 0; }

/* ==========================================================================
   情绪树洞
   --------------------------------------------------------------------------
   写下来 → 选一个情绪 → 丢进树洞 → 树洞回一句。
   布局与文案取自 1.0 的树洞设计，画布与配色沿用 2.0，保证是同一个 App。
   全屏覆盖（含底部输入框），z-index 低于侧栏与提示，高于首页与对话页。
   ========================================================================== */
.treehole {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  /* 独立页面。底色取自设计图（暖白 #FFF9EF→#FFFCF7），
     纸、树洞、按钮都在这个底色上取样，所以整页比原来的纯白暖一点。
     想退回纯白只改这一行。 */
  background:
    radial-gradient(120% 80% at 50% 34%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 62%),
    linear-gradient(to bottom, #FFF9EF 0%, #FFFCF7 46%, #FFFBF4 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
  overscroll-behavior: contain;
}

.app.is-treehole .treehole { opacity: 1; visibility: visible; }
.app.is-treehole .home,
.app.is-treehole .chat { opacity: 0; visibility: hidden; }

/* 固定头 + 滚动体：返回头不随内容滚走。
   现在里面同时装着「写纸条页」和「树洞页」两屏，所以这里只做定位；
   每一屏各自滚动，切换时不会互相带着滚。 */
.treehole__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

/* 话题列表固定栏可见时，顶部采用 5 档真实 backdrop-filter 半径，
   每档通过线性渐隐遮罩只占据渐变的一段；滚动正文从清晰到模糊连续过渡。 */
.topics__scroll { position: relative; z-index: 0; }
.settings { position: relative; z-index: 2; }

/* 树洞是双屏切换（.th-write / .th-hole），滚动层固定不可滚动；
   故模糊层必须固定在返回头下方、当前屏内容上方。 */
.th-head { position: relative; z-index: 4; }
/* 仅支持 backdrop-filter 的浏览器启用；不支持时移除装饰层。 */

/* ---------- 返回头 ---------- */
.th-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}

.th-back {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  /* 玻璃质感（本轮改动）：原来是 assets/btn-back.png 那张中性白实心圆盘，
     钉在暖白底上像贴上去的一块白。改成半透明 + 背景虚化，
     把树洞自己的暖白底色透出来 —— 与释放空间 2.0 的玻璃球、日记本同一套语言。
     箭头随之改回图标字体的 .ic（素材里烘的那枚箭头不再用）。 */
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(0.5rem) saturate(1.35);
  backdrop-filter: blur(0.5rem) saturate(1.35);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.72),
              0 0.05rem 0.3rem rgba(120, 100, 60, 0.08);
  color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.th-back .ic { font-size: 0.95rem; }
.th-back:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.78); }

.th-head__label {
  font-size: 0.65rem;      /* 13pt */
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ---------- 标题 ---------- */
.th-title {
  margin: 1.6rem 0 0;
  font-size: 1.8rem;       /* 36pt */
  line-height: 1.24;
  /* 400：见上。进步体自带字面宽度，再叠 -0.01em 紧排会挤在一起 */
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
}

.th-sub {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;       /* 16pt */
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.5);
}

/* ---------- 书写区 ---------- */
.th-input {
  display: block;
  width: 100%;
  min-height: 8.5rem;      /* 170pt */
  margin-top: 1.5rem;
  padding: 1rem 1.05rem;
  border: 0;
  border-radius: var(--r-card);     /* 20pt */
  background: rgba(0, 0, 0, 0.035);   /* 白底上的浅灰，下同 */
  font-family: inherit;
  font-size: 0.85rem;      /* 17pt */
  line-height: 1.7;
  color: var(--ink);
  resize: none;
  outline: none;
  -webkit-appearance: none;
}
.th-input::placeholder { color: var(--placeholder); }

/* ---------- 情绪标签 ---------- */
.th-ask {
  margin: 2rem 0 0.85rem;
  font-size: 0.72rem;      /* 14pt */
  color: rgba(0, 0, 0, 0.5);
}

.th-emotions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.th-emo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 2.2rem;          /* 44pt */
  border-radius: var(--r-pill);
  /* 玻璃质感（本轮改动）：原来是 rgba(0,0,0,0.04) 的灰片，
     压在暖白底上发脏。改成半透明白 + 背景虚化，与返回键同材质。
     选中态（.is-on）仍是实心深色，保证选中一眼可辨。 */
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(0.42rem) saturate(1.3);
  backdrop-filter: blur(0.42rem) saturate(1.3);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  color: var(--ink);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.16s var(--ease);
}
.th-emo__icon { font-size: 0.85rem; line-height: 1; }
.th-emo__name { font-size: 0.72rem; }
.th-emo:active { transform: scale(0.97); }
.th-emo.is-on { background: #1C1C1E; color: #FFFFFF; }
/* AI 猜的那一个：只用一圈细边提示，不抢用户自己选的 */
.th-emo.is-guess { box-shadow: inset 0 0 0 0.075rem rgba(0, 0, 0, 0.22); }

/* ---------- 丢进树洞 ---------- */
.th-submit {
  display: block;
  width: 100%;
  height: 2.6rem;          /* 52pt */
  margin-top: 1.6rem;
  border-radius: var(--r-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 0.85rem;      /* 17pt */
  font-weight: 500;
  transition: transform 0.16s var(--ease), opacity 0.2s ease;
}
.th-submit:active { transform: scale(0.97); }
.th-submit:disabled {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}

/* 回声生成中的占位 */
.th-echo--pending .th-echo__text { color: var(--ink-soft); }

/* ---------- 放进树洞的话 ---------- */
.th-list-title {
  margin: 2.6rem 0 0;
  font-size: 0.85rem;      /* 17pt */
  font-weight: 700;
  color: var(--ink);
}

.th-entries { margin-top: 0.4rem; }

.th-entry { padding: 1.1rem 0; border-bottom: 0.05rem solid rgba(0, 0, 0, 0.07); }
.th-entry:last-child { border-bottom: 0; }

.th-entry__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
}

.th-entry__tag {
  padding: 0.12rem 0.5rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.045);
  color: rgba(0, 0, 0, 0.62);
}

.th-entry__text {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 树洞的回声 */
.th-echo {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, 0.032);
}

.th-echo__label {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.th-echo__text {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  line-height: 1.72;
  color: rgba(0, 0, 0, 0.78);
  white-space: pre-wrap;
  word-break: break-word;
}

.th-empty {
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   遮罩
   ========================================================================== */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.app.is-open .scrim {
  opacity: 1;
  pointer-events: auto;
  /* 2.7.01：增强底层高斯模糊，让抽屉和主页面拉开层次（原来是 1.5px，
     几乎看不出；现在主页内容不可读、轮廓仍可辨认，不至于糊成色块）。
     只在打开时启用，关闭状态不占着合成层（不支持则自动忽略）。 */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ==========================================================================
   左侧话题列表
   ========================================================================== */
.topics {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 12.9rem;                                  /* 258pt */
  /* 只圆靠对话区的那一侧。靠屏幕边的那两条边保持直角 —— 屏幕本身的
     圆角是硬件裁出来的，抽屉再自己圆一次会在角落露出一块底色；
     朝对话区的两个角用 --r-screen（主流安卓屏幕圆角均值 ≈36dp）
     跟着设备走，看起来才像同一块玻璃。overflow 同时裁掉画布出血。 */
  border-radius: 0 var(--r-screen) var(--r-screen) 0;
  overflow: hidden;
  /* 常驻 CSS 毛玻璃（不是 WebGL 画布）：
     backdrop-filter 是浏览器实时合成，滑入/滑出的每一帧都按当前位置
     重新取背景，不存在「关着时留着白快照」的问题。
     透明度和模糊度由设置里的滑块写 --drawer-tint / --drawer-blur
     （见 app.js applyGlassLevel）；默认档 = 0.88 / 20px。 */
  background: rgba(255, 255, 255, var(--drawer-tint, 0.88));
  -webkit-backdrop-filter: blur(var(--drawer-blur, 12px));
  backdrop-filter: blur(var(--drawer-blur, 12px));
  /* 外阴影：让话题列表看起来是叠在 AI 上面的一层，而不是凹进去的一块。
     注意：关闭时面板 translateX(-100%)，右边缘刚好停在 x=0，
     而阴影会从这个边缘向外扩散 40pt —— 若不关掉，首屏左侧会一直挂着
     一道投影。所以用 alpha 过渡：关=完全透明，开=正常投影。 */
  box-shadow: 0.4rem 0 1.6rem rgba(28, 32, 44, 0);
  transform: translateX(-100%);
  transition: transform var(--dur-4) var(--ease),
              box-shadow var(--dur-4) var(--ease);
  will-change: transform, box-shadow;
  display: flex;
  flex-direction: column;
}

.app.is-open .topics {
  transform: translateX(0);
  box-shadow: 0.4rem 0 1.6rem rgba(28, 32, 44, 0.13);
}

.topics {
  --topics-gutter: clamp(12px, 4vw, 18px);
  --topics-top-gap: clamp(18px, 4dvh, 32px);
  --topics-divider: color-mix(in srgb, var(--ink) 12%, transparent);
  --topics-highlight: color-mix(in srgb, var(--color-surface-raised) 50%, transparent);
  width: min(310px, calc(100% - 34px));
  border-radius: 0 24px 24px 0;
}

.topics__toolbar {
  display: grid;
  flex: none;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + var(--topics-top-gap)) var(--topics-gutter) 10px;
}

.topics .topics__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 8px;
  padding: 0;
}

.topics .topics__logo {
  display: block;
  width: min(104px, 100%);
  height: auto;
  margin-inline-start: 5px;
}

html[data-lb-theme="dark"] .topics .topics__logo { filter: invert(1); }

.topics svg {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topics .settings {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: 100%;
  min-width: 0;
  padding-inline: 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  text-align: start;
}

#topicControls { min-height: 96px; min-width: 0; }
.topic-controls { display: grid; gap: 8px; min-width: 0; }
.topics .topic-controls :is(.topic-create,.topic-search) {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  padding-inline: 12px;
  font: 500 16px/22px var(--font-body);
}
.topics .topic-controls .topic-create {
  justify-content: flex-start;
  border: 1px solid transparent;
  background: var(--ink);
  color: var(--color-paper);
}
.topics .topic-create > span:first-child, .topics .topic-search { gap: 10px; }
.topics .topic-create > span:first-child > span:has(> svg) {
  width: 18px;
  height: 18px;
  flex: none;
}
.topics .topic-controls .topic-search {
  color: var(--ink);
  background: var(--topics-highlight);
  border: 1px solid var(--topics-divider);
}
.topics .topic-search input {
  min-width: 0;
  font: inherit;
  color: inherit;
}
.topics .topic-search input::placeholder { color: var(--ink-soft); opacity: 1; }
.topics .topic-search:focus-within { outline: 2px solid var(--color-focus); outline-offset: -2px; }

.topics > .topics__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 var(--topics-gutter) 10px;
}

.topics .topiclist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topics .topics__label {
  margin: 12px 0 4px;
  padding-inline: 10px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--ink-soft);
}

.topics .topics__label:not(:first-child) { margin-top: 18px; }

.topics .topic {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 20px;
  border-radius: 10px;
  color: var(--ink);
  text-align: start;
  background: transparent;
}

.topics .topic span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topics .topic[aria-current="true"],
.topics .topic:active,
.topics .settings:active {
  background: var(--topics-highlight);
}

.topics .topic[aria-current="true"] { font-weight: 650; }
.topics .topic--confirm { flex-wrap: wrap; gap: 4px; }
.topics .topic__btn--danger { color: var(--color-danger); }
.topics .topiclist__empty { margin: 12px 10px; color: var(--ink-soft); }

.topics__footer {
  flex: none;
  padding: 7px var(--topics-gutter) calc(env(safe-area-inset-bottom, 0px) + 7px);
  border-top: 1px solid var(--topics-divider);
}

.topics .settings {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.topics button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

@media (max-height: 340px) {
  .topics__toolbar { gap: 4px; padding-block-end: 4px; }
  .topics__footer { padding-block-start: 3px; }
}

/* ==========================================================================
   释放空间
   --------------------------------------------------------------------------
   两步：写在白纸上 → 走进泡泡天空，点破它。
   这一步刻意不接 AI —— 它要的是安静，不是有人回应。
   全屏天空用强调色渐变，泡泡是玻璃质感的，破开时是一圈圈涟漪往外荡。
   ========================================================================== */
.release {
  position: absolute;
  inset: 0;
  z-index: 26;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}

.app.is-release .release { opacity: 1; visibility: visible; }
.app.is-release .home,
.app.is-release .chat { opacity: 0; visibility: hidden; }

.rel-write,
.rel-sky { position: absolute; inset: 0; }

/* ---------- 第一步：写 ---------- */
.rel-write {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

/* 固定头 + 滚动体，和树洞、日记一致 */
.rl-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}

.rl-back {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: url("assets/btn-back.png") center / 190% 190% no-repeat;
  color: var(--ink);
  transition: transform 0.16s var(--ease);
}
.rl-back:active { transform: scale(0.94); }

.rl-head__label {
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.rel-write__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.6rem 1.8rem calc(env(safe-area-inset-bottom, 0px) + 3rem);
}

.rl-title {
  margin: 1.6rem 0 0;
  font-size: 1.8rem;
  line-height: 1.24;
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
}

.rl-sub {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.5);
}

.rl-input {
  display: block;
  width: 100%;
  min-height: 6.6rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, 0.035);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink);
  resize: none;
  outline: none;
  -webkit-appearance: none;
}
.rl-input::placeholder { color: var(--placeholder); }

.rl-count {
  margin: 0.5rem 0 0;
  font-size: 0.62rem;
  text-align: right;
  color: var(--ink-soft);
}

/* 几个开头，点一下就能用 —— 面对空白最容易卡住 */
.rl-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.rl-idea {
  padding: 0.5rem 0.8rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.035);
  font-size: 0.68rem;
  color: rgba(0, 0, 0, 0.58);
  text-align: left;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.rl-idea:active { transform: scale(0.97); }

.rl-go {
  display: block;
  width: 100%;
  height: 2.6rem;
  margin-top: 1.6rem;
  border-radius: var(--r-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.16s var(--ease);
}
.rl-go:active { transform: scale(0.97); }

.rl-hint {
  margin: 0.8rem 0 0;
  font-size: 0.62rem;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- 第二步：泡泡天空 ---------- */
.rel-sky {
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}

.rl-sky-back {
  position: absolute;
  /* 与写页头部同一落点（padding 1.8rem 再回退 -0.4rem），两屏的返回键上下对齐 */
  left: 1.4rem;
  top: calc(env(safe-area-inset-top, 0px) + 1.2rem);
  z-index: 3;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: url("assets/btn-back.png") center / 190% 190% no-repeat;
  color: var(--ink);
  transition: transform 0.16s var(--ease);
}
.rl-sky-back:active { transform: scale(0.94); }

.sky { position: absolute; inset: 0; }

/* 预设泡泡：外层负责缓慢漂移（负延迟入场，一进来就是活的） */
.preset {
  position: absolute;
  left: var(--x);
  top: var(--y);
  animation: bubbleDrift var(--dur) ease-in-out var(--delay) infinite alternate;
}

@keyframes bubbleDrift {
  /* 起止位置由每颗泡泡的 --dx/--dy 决定（app.js 按设计稿的漂移方向逐颗设置），
     幅度保持克制 —— 泡泡是活的，但更像远处的呼吸。 */
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--dx, 0.36rem), var(--dy, -0.54rem), 0); }
}

/* 玻璃质感的泡泡 */
.bubble {
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  /* 千万不要用百分比内边距：CSS 里百分比 padding 是相对【父元素宽度】算的，
     不是相对自己。440px 宽的舞台 × 14% = 61.6px，152px 的泡泡直接被压扁。
     留白改由 sizeForText 用几何算出来（矩形对角线 ≤ 直径）。 */
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.74) 30%,
    rgba(255, 255, 255, 0.38) 64%,
    rgba(255, 255, 255, 0.66) 100%);
  box-shadow:
    inset 0 0 0 0.05rem rgba(255, 255, 255, 0.92),
    inset -0.15rem -0.28rem 0.75rem rgba(150, 185, 235, 0.22),
    0 0.25rem 1rem rgba(28, 32, 44, 0.07);
  font-family: inherit;
  font-size: var(--fs, 0.6rem);   /* 由文字长度算出来，见 sizeForText */
  line-height: 1.42;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  animation: bubbleBob var(--bob) ease-in-out var(--bob-delay) infinite alternate;
  -webkit-tap-highlight-color: transparent;
}

@keyframes bubbleBob {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(0, -0.28rem, 0) scale(1.018); }
}

/* 用户自己那颗：居中、更大、更亮 */
.bubble--mine {
  position: absolute;
  left: 50%;
  top: 42%;
  margin-left: calc(var(--size) / -2);
  margin-top: calc(var(--size) / -2);
  z-index: 2;
  font-size: var(--fs, 0.66rem);
  font-weight: 500;
  color: rgba(0, 0, 0, 0.64);
  box-shadow:
    inset 0 0 0 0.06rem rgba(255, 255, 255, 1),
    inset -0.2rem -0.35rem 0.9rem rgba(150, 185, 235, 0.26),
    0 0.35rem 1.7rem rgba(28, 32, 44, 0.14);
}

/* ---------- 释放空间 2.0：泡泡改用玻璃球素材 ----------
   --art 由 app.js 逐颗指定（assets/release/bubble-1~7.png）。
   素材自带球壁高光与阴影，所以要把 CSS 拼的渐变与 box-shadow 全部让出去，
   否则会和素材叠成两层玻璃。文字仍是正体、居中 —— 不加斜体。 */
.sky .bubble,
.bubble--mine {
  background: var(--art, none) center / contain no-repeat;
  box-shadow: none;
  font-family: inherit;
  font-style: normal;
  color: rgba(0, 0, 0, 0.58);
}
.bubble--mine { color: rgba(0, 0, 0, 0.7); }

/* 破掉的那一下 */
.bubble.is-popping {
  animation: bubblePop 320ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes bubblePop {
  0%   { transform: scale(1); opacity: 1; }
  45%  { transform: scale(1.26); opacity: 0.72; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* 换句子时淡一下，让画面一直是活的 */
.preset.is-swap .bubble { opacity: 0.25; transition: opacity 0.24s ease; }

/* ---------- 绽放：涟漪、亮核、光点、星光 ---------- */
.burst-ring {
  position: absolute;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.85rem 0 0 -0.85rem;
  border-radius: 50%;
  border: 0.07rem solid rgba(255, 255, 255, 0.95);
  pointer-events: none;
  animation: ringOut var(--rdur) cubic-bezier(0.15, 0.7, 0.3, 1) var(--rdelay) forwards;
}
@keyframes ringOut {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(var(--rscale)); opacity: 0; }
}

.burst-glint {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, rgba(255, 255, 255, 0.82) 38%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
  animation: glintOut 520ms ease-out forwards;
}
@keyframes glintOut {
  0%   { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.6); opacity: 0; }
}

.burst-dot {
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  animation: dotOut 760ms ease-out var(--delay) forwards;
}
@keyframes dotOut {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  100% { transform: translate3d(var(--dx), var(--dy), 0) scale(0.3); opacity: 0; }
}

.burst-spark {
  position: absolute;
  width: var(--size);
  height: 0.09rem;
  margin: calc(var(--size) / -2) 0 0 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%, #FFFFFF 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  animation: sparkOut 700ms ease-out var(--sdelay) forwards;
}
@keyframes sparkOut {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(0.4); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ---------- 提示与收尾 ---------- */
.rl-sky-hint {
  position: absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
  z-index: 8;
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.45);
  transition: opacity 0.4s ease;
}
.rl-sky-hint.is-gone { opacity: 0; }

.rl-done {
  position: absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95rem;
  animation: msgIn 0.5s var(--ease) both;
}
.rl-done[hidden] { display: none; }

.rl-done__text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.rl-again {
  height: 2.4rem;
  padding: 0 1.35rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  color: var(--ink);
  transition: background 0.18s var(--ease);
}
.rl-again:active { background: rgba(255, 255, 255, 0.95); }

/* ==========================================================================
   释放空间（重构版）
   --------------------------------------------------------------------------
   一屏式释放仪式，素材全部来自设计稿导出原图：
   machine.png（泡泡机）、panel.png（输入面板）、input.png（输入框）、
   title.png（「有什么想放下的吗」）、bubble-1..7.png（泡泡）。
   CSS 只负责编排与运动，不改素材视觉。
   ========================================================================== */
.release {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(130% 70% at 50% -6%, rgba(191, 212, 246, .62) 0%, rgba(214, 228, 250, .30) 42%, rgba(255, 255, 255, 0) 74%),
    linear-gradient(180deg, #E3EDFB 0%, #EFF5FD 30%, #F9FCFF 64%, #FFFFFF 100%);
}

.rx-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ---- 背景泡泡：和设计稿一样散在中上部，安静地漂 ---- */
.rx-decor { position: absolute; inset: 0; }
.rx-decor__bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  pointer-events: none;
  will-change: transform;
  transition: transform 1s cubic-bezier(.3, .66, .4, 1);   /* 避让推开 / 回位时缓缓让位 */
}
.rx-decor__drift {
  --dx: 0.36rem;   /* 默认漂移向量；由 app.js 按设计稿运动方向逐颗设置 */
  --dy: -0.54rem;
  --dur: 8s;
  --delay: 0s;
  animation: bubbleDrift var(--dur) ease-in-out var(--delay) infinite alternate;
}
.rx-decor__drift img { display: block; width: 100%; height: auto; }
.rx-decor__core { position: relative; width: 100%; }
/* 预设文案（2.7.01）：装饰泡泡上的句子 —— 与自己那颗泡泡的文字同一气质 */
.rx-decor__text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74%;
  text-align: center;
  line-height: 1.32;
  color: rgba(54, 64, 84, .9);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .6);
  pointer-events: none;
  overflow-wrap: anywhere;
}
/* 有文案的装饰泡泡收回点击（测量模式不带文案、保持纯装饰） */
.rx-decor__bubble[role="button"] { pointer-events: auto; cursor: pointer; }
.rx-decor__bubble[role="button"]:focus-visible {
  outline: 2px solid rgba(90, 125, 185, 0.8);
  outline-offset: 3px;
  border-radius: 50%;
}

/* ---- 泡泡机：屏幕右下，机器素材 1:1 原位（设计稿块内 x884-1856 / y2395-3363），
        底部沉入输入容器之上，与设计稿完全一致 ---- */
.rx-machine {
  position: absolute;
  left: 48.04%;      /* 884 / 1840 */
  bottom: 13.86%;    /* (3904 - 3363) / 3904 */
  z-index: 5;        /* 高于 .rx-panel(4)：机器底部压在容器上，与设计稿一致 */
  width: 52.83%;     /* 972 / 1840 */
  pointer-events: none;
}
/* 发射机底层（机身内舱）：透过顶层的透明圆环能看到它 —— 设计稿的三层结构：
   底层 machine-base / 中层机内泡泡 / 顶层 machine */
.rx-machine__base {
  position: absolute;
  left: -2.67%;      /* 屏内 x858 → 相对机器盒(884)：-26 / 972 */
  top: 2.17%;        /* 屏内 y2416 → 21 / 968 */
  width: 105.35%;    /* 1024 / 972 */
  height: auto;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-machine__art {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- 机内泡泡：贴在机器圆环后面，机身边缘天然遮住它 ---- */
.rx-core {
  position: absolute;
  left: 49.4%;
  top: 40.6%;
  z-index: 1;
  width: 0;
  height: 0;
}
.rx-core__inner {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--core-dia, 3rem);
  height: var(--core-dia, 3rem);
  transform: translate(-50%, -50%) scale(.18);
  opacity: 0;
  transition: transform 880ms cubic-bezier(.34, 1.5, .58, 1), opacity 420ms ease;
}
.rx-core.is-in .rx-core__inner { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.rx-core.is-breathing .rx-core__inner { animation: rxBreathe 1.9s ease-in-out infinite alternate; }
/* 准备发射时：泡泡从「中层」上移到「顶层」，盖过机身（z 高于 .rx-machine__art 的 2） */
.rx-core.is-rising { z-index: 3; }
.rx-core.is-rising .rx-core__inner {
  transform: translate(-50%, -50%) scale(1.35);
  transition-duration: 1150ms;
  transition-timing-function: cubic-bezier(.3, .6, .4, 1);
}
@keyframes rxBreathe {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(-50%, -50%) scale(1.045); }
}
.rx-core__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-core__text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  display: block;
  overflow: hidden;
  text-align: center;
  font-size: .55rem;
  line-height: 1.45;
  color: rgba(58, 68, 88, .85);
  opacity: 0;
  transition: opacity 460ms ease;
  pointer-events: none;
  overflow-wrap: anywhere;
}
.rx-core.has-text .rx-core__text { opacity: 1; }

/* ---- 释放后的完整泡泡：位于机器前方，可以盖住机器一部分 ---- */
.rx-flight { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
/* 发射泡泡的外层包装：只承担「被其他泡泡推开」的避让平移（CSS 过渡平滑），
   内层的生长 / 上浮动画完全不受影响 */
.rx-bubble-wrap {
  position: absolute;
  inset: 0;
  transition: transform 1s cubic-bezier(.3, .66, .4, 1);
  will-change: transform;
}
.rx-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 18px rgba(120, 150, 200, .10));
}
.rx-bubble__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-bubble__text {
  position: relative;
  z-index: 1;
  display: block;
  width: 64%;
  overflow: hidden;
  text-align: center;
  line-height: 1.42;
  color: rgba(54, 64, 84, .9);
  text-shadow: 0 1px 2px rgba(255, 255, 255, .6);
  pointer-events: none;
  overflow-wrap: anywhere;
}
.rx-bubble.is-idle { animation: rxIdle 6.8s ease-in-out infinite alternate; }
@keyframes rxIdle {
  from { transform: translate3d(calc(-50% + var(--bx, 0px)), calc(-50% + var(--by, 0px)), 0) scale(var(--gs, 1)); }
  to   { transform: translate3d(calc(-50% + var(--bx, 0px) + var(--ix, 8px)), calc(-50% + var(--by, 0px) + var(--iy, -10px)), 0) scale(var(--gs, 1)); }
}

/* ---- 点破（2.7.01）：落定的泡泡可以点破 ----
   只有 .is-idle 的泡泡接点击（飞行中不挡任何控件）；破碎一开始立刻交还点击。
   波纹与光点都是临时元素（app.js 生成），跟随包装层一起移除。 */
.rx-bubble.is-idle { pointer-events: auto; cursor: pointer; }
.rx-bubble.is-popping { pointer-events: none; }
.rx-bubble:focus-visible { outline: 2px solid rgba(90, 125, 185, 0.8); outline-offset: 3px; border-radius: 50%; }

.rx-pop-ring {
  position: absolute;
  border-radius: 50%;
  border: 0.09rem solid rgba(178, 203, 240, 0.55);
  box-shadow: inset 0 0 0.5rem rgba(196, 218, 248, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}
.rx-pop-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(224, 236, 255, 0.75) 45%,
    rgba(196, 216, 248, 0.35) 72%,
    rgba(196, 216, 248, 0) 100%);
  pointer-events: none;
  opacity: 0;
}

/* ---- 被机器吸收的文字 ---- */
.rx-flyer {
  position: absolute;
  z-index: 9;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---- 底部输入容器：整块设计稿素材（panel.png 1960×964），
        横贯全宽（每侧外扩 3.26%，多出部分被页面裁掉），从屏高 76.43% 起、贴到屏幕底部。
        纵向 object-fit:fill —— 素材是投影 + 纯浅色面，1%~5% 的纵向伸缩肉眼不可见，
        换来任何屏幕比例下都严格「撑满底部、不漏缝」。 ---- */
.rx-panel {
  position: absolute;
  left: -3.26%;      /* -60 / 1840 */
  right: -3.26%;
  top: 76.43%;       /* 2984 / 3904 */
  bottom: 0;
  z-index: 4;
}
.rx-panel__card { position: absolute; inset: 0; }
.rx-panel__bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-panel__inner { position: absolute; inset: 0; }

/* 底沿延伸遮罩（2.7.01）
   ------------------------------------------------------------------
   输入区所在的浅色面（panel 素材）原本在屏底约 2% 处被裁断，下面露出
   一条白的，像贴纸没贴到边。这里补一层纯渐变，把它顺到整个屏幕底部
   （bottom:0 —— 含安全区与虚拟导航栏区域，keyboard 弹起时同样贴底），
   中线以下取素材同色 rgb(240,246,255)、上缘与两侧软收边，和释放空间
   背景自然融合。不模糊、不换色、pointer-events:none，输入与发送不受影响。 */
.rx-panel::after {
  content: '';
  position: absolute;
  left: 3.06%;        /* 屏内左右缘（素材 60 / 1960）；出血部分本就在屏外 */
  right: 3.06%;
  bottom: 0;
  height: 26.5%;
  background: linear-gradient(180deg,
    rgba(240, 246, 255, 0) 0%,
    rgba(240, 246, 255, 0.6) 40%,
    rgba(240, 246, 255, 1) 62%,
    rgba(240, 246, 255, 1) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
  pointer-events: none;
}
/* 标题与输入框：按设计稿屏内坐标换算为容器内百分比
   （容器 = 屏内 x[-60..1900] × y[2984..3904]） */
.rx-panel__title {
  position: absolute;
  left: 13.88%;      /* 屏内 x212 → (-(-60)) 272 / 1960 */
  top: 31.96%;       /* 屏内 y3278 → 294 / 920 */
  width: 38.67%;     /* 758 / 1960 */
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-row {
  position: absolute;
  left: 12.24%;      /* 屏内 x180 → 240 / 1960 */
  top: 47.83%;       /* 屏内 y3424 → 440 / 920 */
  width: 74.90%;     /* 1468 / 1960 */
}
.rx-row__bg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.rx-input {
  position: absolute;
  left: 3.8%;        /* 文字起点对齐设计稿 x236（180 + 3.8%×1468） */
  right: 17%;
  top: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: .88rem;
  color: #3E495E;
  outline: none;
  -webkit-appearance: none;
}
.rx-input::placeholder { color: rgba(62, 73, 94, .34); }
.rx-send {
  position: absolute;
  right: 2.4%;
  top: 13%;
  height: 74%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, #A9C7FF);
  color: #35415C;
  box-shadow: 0 2px 8px rgba(110, 145, 205, .35);
  transition: transform .18s var(--ease), opacity .22s ease;
}
.rx-send svg { width: 56%; height: 56%; }
.rx-send:active { transform: scale(.94); }
.rx-send:disabled { opacity: .38; }
.rx-send:focus-visible { outline: 2px solid rgba(90, 125, 185, .8); outline-offset: 2px; }

/* ---- 返回键 ---- */
.rx-back {
  position: absolute;
  /* 2.7.01：尺寸 / 质感与全站新版返回键统一（1.7rem 玻璃圆钮）。
     left/top 做了半个尺寸差的补偿，按钮的视觉中心与原来的 2.9rem 大圆钮一致。 */
  left: 1.045rem;
  top: calc(env(safe-area-inset-top, 0px) + 2.975rem);
  z-index: 6;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(0.5rem) saturate(1.35);
  backdrop-filter: blur(0.5rem) saturate(1.35);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.72),
              0 0.05rem 0.3rem rgba(120, 100, 60, 0.08);
  color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.rx-back .ic { font-size: 0.95rem; }
.rx-back:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.78); }

/* ---- 无障碍播报（视觉隐藏） ---- */
.rx-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .rx-decor__bubble { animation: none; }
  .rx-bubble.is-idle { animation: none; }
  .rx-core__inner { transition-duration: 1ms !important; }
}

/* ==========================================================================
   心情日记
   --------------------------------------------------------------------------
   像天气一样回顾过去的心情，但不预测未来 ——
   它只做一件事：请他把今天记下来。
   与树洞一致，用纯白底（内容页白底、陪伴页渐变）。
   ========================================================================== */
.diary {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}

.app.is-diary .diary { opacity: 1; visibility: visible; }
.app.is-diary .home,
.app.is-diary .chat { opacity: 0; visibility: hidden; }

/* 固定头 + 滚动体：返回头不随内容滚走 */
.diary__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.6rem 1.8rem calc(env(safe-area-inset-bottom, 0px) + 3.4rem);
}

/* ---------- 返回头 ---------- */
.dy-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}

.dy-back {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.16s ease;
}
.dy-back .ic { font-size: 0.95rem; }
.dy-back:active { background: rgba(0, 0, 0, 0.05); }

.dy-head__label {
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.dy-title {
  margin: 1.6rem 0 0;
  font-size: 1.8rem;
  line-height: 1.24;
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
}

.dy-sub {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.5);
}

/* ---------- 今天的天气 ---------- */
.dy-weathers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-top: 1.5rem;
}

.dy-w {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.72rem 0;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.035);
  transition: background 0.18s var(--ease), transform 0.16s var(--ease);
}
.dy-w:active { transform: scale(0.97); }

.dy-w__emoji { font-size: 1.45rem; line-height: 1; }
.dy-w__name  { font-size: 0.6rem; color: rgba(0, 0, 0, 0.5); }

.dy-w.is-on { background: #1C1C1E; }
.dy-w.is-on .dy-w__name { color: rgba(255, 255, 255, 0.9); }

/* 「多云 转 晴」—— 让用户看见自己拼出来的顺序 */
.dy-preview {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.dy-note {
  display: block;
  width: 100%;
  min-height: 5.4rem;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: var(--r-card);
  background: rgba(0, 0, 0, 0.035);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink);
  resize: none;
  outline: none;
  -webkit-appearance: none;
}
.dy-note::placeholder { color: var(--placeholder); }

.dy-save {
  display: block;
  width: 100%;
  height: 2.6rem;
  margin-top: 1.2rem;
  border-radius: var(--r-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.16s var(--ease), background 0.2s ease, color 0.2s ease;
}
.dy-save:active { transform: scale(0.97); }
.dy-save:disabled { background: rgba(0, 0, 0, 0.06); color: var(--ink-soft); }

/* ---------- 这几天（只回看，不预测） ---------- */
.dy-sec {
  margin: 2.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.dy-sec__hint {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
}

.dy-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: none;
}
.dy-strip::-webkit-scrollbar { display: none; }

.dy-day {
  flex: 0 0 auto;
  width: 3.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, 0.035);
}

.dy-day__label { font-size: 0.56rem; color: rgba(0, 0, 0, 0.45); }
.dy-day__emoji { font-size: 1.15rem; line-height: 1; }
.dy-day__emoji--multi { font-size: 0.78rem; letter-spacing: -0.04em; }
.dy-day--today { background: #1C1C1E; }
.dy-day--today .dy-day__label { color: rgba(255, 255, 255, 0.75); }
.dy-day--none .dy-day__emoji { opacity: 0.22; }

/* ---------- 写下的 ---------- */
.dy-list { margin-top: 0.6rem; }

.dy-item { padding: 0.95rem 0; border-bottom: 0.05rem solid rgba(0, 0, 0, 0.07); }
.dy-item:last-child { border-bottom: 0; }

.dy-item__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
}
.dy-item__meta span:first-child { font-size: 0.82rem; }

.dy-item__text {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.dy-empty {
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   设置
   --------------------------------------------------------------------------
   这一页用强调色渐变做底 —— 用户在这里换颜色，必须当场看得见。
   ========================================================================== */
.sp {
  position: absolute;
  inset: 0;
  z-index: 26;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}

.app.is-settings .sp { opacity: 1; visibility: visible; }
.app.is-settings .home,
.app.is-settings .chat { opacity: 0; visibility: hidden; }

.sp__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 顶部给「固定返回头」让位（返回头在滚动区外，见下）：
     原来 1.2rem + 头高 1.7rem = 2.9rem，保证「设置」标题位置不变 */
  padding: calc(env(safe-area-inset-top, 0px) + 2.9rem) 1.8rem
           calc(env(safe-area-inset-bottom, 0px) + 3.4rem);
}

/* 顶部模糊保护层（两档 backdrop-filter 叠出渐进感）
   ------------------------------------------------------------------
   内容滑到返回键下面是被糊掉，而不是被白色抹掉 —— 和对话页 / 树洞 /
   话题列表用同一套语言，深色内容滚上来也不会糊成一团白。
   2.7.01 修正：原来两层一路盖到 6.2rem / 9rem，把停在原位的「设置」
   大标题（约 4.4rem 处）也一起糊掉了；现在遮罩在 4.3rem 前收干净 ——
   标题与正文保持清晰，滚动内容在返回头下方（≈2.9rem）的模糊强度不变。
     ::before  14px，45% 处仍全强度，之后线性收干
     ::after    5px，从头线性收干，把过渡接柔和 */
.sp::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 4.3rem);
  z-index: 1;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  pointer-events: none;
}
.sp::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 4.3rem);
  z-index: 1;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  pointer-events: none;
}

/* ---------- 返回头 ---------- */
/* 固定在滚动区外（同树洞）：内容滚动时留在顶部 */
.sp-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}

.sp-back {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  /* 玻璃质感（2.7.01 统一为树洞新版）：素材里烘好的箭头不再用，改回图标字体 */
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(0.5rem) saturate(1.35);
  backdrop-filter: blur(0.5rem) saturate(1.35);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.72),
              0 0.05rem 0.3rem rgba(120, 100, 60, 0.08);
  color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.sp-back .ic { font-size: 0.95rem; }
.sp-back:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.78); }

.sp-head__label {
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.sp-title {
  margin: 1.5rem 0 0;
  font-size: 1.6rem;       /* 32pt */
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
}

/* ---------- 分区 ---------- */
.sp-sec { margin-top: 2.3rem; }

.sp-sec__title {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;      /* 14pt */
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.45);
}

.sp-note {
  margin: 0.75rem 0 0;
  font-size: 0.66rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.42);
}

.sp-input {
  display: block;
  width: 100%;
  height: 3rem;            /* 60pt */
  padding: 0 1.1rem;
  border: 0;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.68);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
}
.sp-input::placeholder { color: var(--placeholder); }

/* ---------- 标签（「想让它怎么陪你」）
   写一句、按「加上」，它就变成一枚标签。最多 8 枚。 ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.tags:empty { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 2.1rem;              /* 42pt */
  padding: 0 0.55rem 0 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0.05rem 0.25rem rgba(28, 32, 44, 0.1),
              inset 0 0 0 0.05rem rgba(0, 0, 0, 0.05);
  font-size: 0.76rem;
  color: var(--ink);
  animation: msgIn 0.26s var(--ease) both;
}

.tag__x {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.3);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.tag__x:active { background: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.62); }

.tagadd { display: flex; align-items: center; gap: 0.5rem; }
.tagadd .sp-input { flex: 1 1 auto; width: auto; min-width: 0; }

.tagadd__go {
  flex: 0 0 auto;
  height: 3rem;                /* 和左边的输入框同高 */
  padding: 0 1.15rem;
  border-radius: 0.95rem;
  background: rgba(0, 0, 0, 0.84);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 500;
  transition: transform 0.16s var(--ease), background 0.2s ease, color 0.2s ease;
}
.tagadd__go:active { transform: scale(0.97); }
.tagadd__go:disabled {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}

/* ---------- 色卡 ---------- */
.sp-swatches {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sp-sw {
  position: relative;
  width: 2.2rem;           /* 44pt */
  height: 2.2rem;
  border-radius: 50%;
  box-shadow: 0 0.05rem 0.3rem rgba(0, 0, 0, 0.12), inset 0 0 0 0.05rem rgba(0, 0, 0, 0.06);
  transition: transform 0.16s var(--ease);
}
.sp-sw:active { transform: scale(0.92); }

/* 选中的那颗：外面套一圈细环 */
.sp-sw.is-on {
  box-shadow: 0 0.05rem 0.3rem rgba(0, 0, 0, 0.12),
              0 0 0 0.14rem #FFFFFF,
              0 0 0 0.26rem rgba(0, 0, 0, 0.5);
}

/* 最后一颗「自定义」：底色跟着色相条走，一眼能看出自己调的是什么颜色 */
.sp-sw--custom {
  display: grid;
  place-items: center;
  background: #EDEDED;
}
.sp-sw--custom::after {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset 0 0 0 0.05rem rgba(0, 0, 0, 0.12), 0 0 0 0.14rem #FFFFFF;
}

/* ---------- 自绘色相条 ----------
   亮度和饱和度锁死在预设那一档（实测预设 S≈82% / L≈83%），
   所以整条色条本身就是一排粉彩，怎么拖都不会出现刺眼的颜色。 */
.pick { margin-top: 0.9rem; }

.pick__bar {
  position: relative;
  height: 2.2rem;              /* 和上面的色卡同高，视觉上是一排 */
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 0.05rem rgba(0, 0, 0, 0.08),
              0 0.05rem 0.3rem rgba(0, 0, 0, 0.1);
  touch-action: none;           /* 手机上别让页面跟着滚 */
  cursor: pointer;
}

/* 选中的位置：一圈白环 + 一点投影，像镶在色条里的一颗珠子 */
.pick__knob {
  position: absolute;
  top: 50%;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.85rem 0 0 -0.85rem;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0.1rem 0.35rem rgba(28, 32, 44, 0.28), inset 0 0 0 0.22rem currentColor;
  transition: transform 0.12s var(--ease);
  pointer-events: none;
}
.pick__bar:active .pick__knob { transform: scale(1.12); }

/* ---------- 横向拟物波轮 ----------
   先前是竖着的时间选择器（一档一档点）。现在改成横向、可以按住拖，
   无极调节 —— 温度这种连续量，本来就该是「旋」出来的，不是「点」出来的。

   拟物感靠三件事：一条压进面板的凹槽（内阴影 + 上暗下亮）、
   槽里一排刻度线、以及一颗凸起来的旋钮（外阴影 + 高光）。 */
.hwheel { padding-top: 0.35rem; }

/* 刻度：由 JS 按温度步长生成，压在凹槽下面 */
.hwheel__scale {
  position: relative;
  height: 0.62rem;
  margin: 0 1.05rem;           /* 和旋钮的行程对齐，两端各让出一个旋钮半径 */
}
.hwheel__tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 0.3rem;
  background: rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
}
.hwheel__tick--major {              /* 有名字的那几档：长一点、深一点 */
  height: 0.5rem;
  background: rgba(0, 0, 0, 0.42);
}

.hwheel__groove {
  position: relative;
  height: 1.5rem;
  border-radius: var(--r-pill);
  /* 上沿暗、下沿亮 —— 光从上面来，槽看上去就是凹进去的 */
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.085) 0%,
    rgba(0, 0, 0, 0.035) 42%,
    rgba(255, 255, 255, 0.55) 100%);
  box-shadow: inset 0 0.09rem 0.22rem rgba(0, 0, 0, 0.18),
              inset 0 -0.04rem 0 rgba(255, 255, 255, 0.75),
              0 0.05rem 0 rgba(255, 255, 255, 0.6);
  touch-action: none;
  cursor: grab;
}
.hwheel__groove:active { cursor: grabbing; }

.hwheel__knob {
  position: absolute;
  top: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.675rem 0 0 -0.675rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #FFFFFF 0%, #FDFDFE 42%, #E8EAEF 100%);
  box-shadow: 0 0.12rem 0.3rem rgba(28, 32, 44, 0.32),
              inset 0 -0.05rem 0.1rem rgba(28, 32, 44, 0.12),
              inset 0 0.08rem 0 #FFFFFF;
  pointer-events: none;
  /* 只在「点一下」时给个短过渡；拖动时是跟手的，不能有延迟 */
  transition: transform 0.12s var(--ease);
}
.hwheel__groove.is-drag .hwheel__knob { transform: scale(1.08); }

/* ---------- 清空 ---------- */
.sp-clear { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.3rem; }

.sp-danger {
  height: 2.3rem;
  padding: 0 1.1rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  color: #C0392B;
  transition: background 0.18s var(--ease);
}
.sp-danger:active { background: rgba(255, 255, 255, 0.9); }

.sp-ask {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.6);
}

.sp-confirm {
  height: 2.3rem;
  padding: 0 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  color: rgba(0, 0, 0, 0.6);
}

.sp-confirm--danger { color: #C0392B; }

/* ==========================================================================
   聊天里的记忆确认卡片（AI 想记住时，先问用户「记住 / 不用」）
   ========================================================================== */
.memask {
  margin: -0.15rem 0 1.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--r-chip);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-1);
  animation: msgIn 0.34s var(--ease) both;
}
.memask__head {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.memask__body {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.memask__content {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}
.memask__cat {
  flex: 0 0 auto;
  font-size: 0.62rem;
  color: var(--ink-soft);
}
.memask__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.memask__btn {
  height: 2.1rem;
  padding: 0 1rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.74rem;
  color: var(--ink);
  transition: background 0.16s var(--ease);
}
.memask__btn--yes {
  background: var(--bubble, #E3EEFF);
  font-weight: 600;
}
.memask__btn:active { background: rgba(0, 0, 0, 0.12); }

/* ==========================================================================
   新用户引导
   --------------------------------------------------------------------------
   第一步问名字（只问名字，不问姓），第二步指一下左上角的话题列表按钮。
   遮罩用 box-shadow 的大扩散做「挖洞」，让被指着的那颗按钮保持原样。
   ========================================================================== */
.onb {
  position: absolute;
  inset: 0;
  z-index: 60;                 /* 高于侧栏与提示 */
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* 引导结束 → 淡出落到主页上（不是硬切）；出现时稍快一点 */
  transition: opacity 0.55s var(--ease), visibility 0s linear 0.55s;
}

.app.is-onboarding .onb {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0s;
}

.onb__step { position: absolute; inset: 0; }
.onb__step[hidden] { display: none; }

/* ---------- 共用版式：标题 / 说明 / 主按钮 ---------- */
.onb__title {
  margin: 0;
  font-size: 1.34rem;      /* 26.8pt */
  font-weight: 400;
  font-family: var(--brand);
  line-height: 1.5;
  color: var(--ink);
}

.onb__sub {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.onb__go {
  display: block;
  width: 100%;
  height: 2.7rem;          /* 54pt */
  border-radius: var(--r-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.16s var(--ease), background 0.2s ease, color 0.2s ease;
}
.onb__go:active { transform: scale(0.97); }
.onb__go:disabled {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}
/* 作者样式里的 display:block 会盖掉 UA 的 [hidden]{display:none}，这里补回来 */
.onb__go[hidden] { display: none; }

/* ==========================================================================
   新用户引导 · 六步（重构版）
   --------------------------------------------------------------------------
   每一步对应一个真实功能，并让用户轻量体验一次：
     01 欢迎 → 02 心情天气 → 03 情绪树洞 → 04 释放空间 → 05 心情日记 → 06 知序
   再接已有的隐私页（#onbPrivacyStep），然后进入 App。

   步骤切换不做「下一页」硬切，用三个状态类：
     .is-wait  还没到（在下方一点、透明）
     .is-on    当前（在位）
     .is-out   已经走过（向上一点、透明）
   只动 opacity / transform，走合成层，0.46s。

   每一屏的素材都复用 App 既有实现（见 index.html 顶部注释）：
     天气 = .dy-w + dy-frame-on/off + Microsoft 彩色表情（保留彩色，不走图标字体）
     树洞 = th-paper / th-hole-back / th-hole-front
     释放 = .bubble + bubblePop
     日记 = .dy-book__fit + .dy-book__page + 清雅宋
     知序 = .msg--user .bubble / .msg--zhixu
   ========================================================================== */
.ob-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 2.4rem) 2.2rem
           calc(env(safe-area-inset-bottom, 0px) + 1.9rem);
  opacity: 0;
  transform: translate3d(0, 1.4%, 0);
  pointer-events: none;
  transition: opacity 0.46s var(--ease), transform 0.46s var(--ease);
  will-change: opacity, transform;
}
.ob-step.is-on  { opacity: 1; transform: none; pointer-events: auto; }
.ob-step.is-out { opacity: 0; transform: translate3d(0, -1%, 0); }

.ob-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ob-foot {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.2rem;
}
.ob-go--quiet { background: rgba(0, 0, 0, 0.06); color: var(--ink); margin-top: 0.7rem; }

/* ---------- 01 · 欢迎 ---------- */
.ob-logo { width: 7.4rem; height: auto; margin-bottom: 1.6rem; -webkit-user-drag: none; }
.ob-hello {
  margin: 0;
  font-family: var(--brand);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
}

/* 一句轻反馈（选完天气 / 投完纸条 / 戳破泡泡后出现） */
.ob-said {
  margin: 1.1rem 0 0;
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--ink-soft);
  animation: obSaidIn 0.42s var(--ease) both;
}
@keyframes obSaidIn {
  from { opacity: 0; transform: translateY(0.25rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 02 · 心情天气（复用日记的 .dy-w） ---------- */
.ob-weathers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  width: 15.4rem;
  margin-top: 1.7rem;
}

/* ---------- 03 · 情绪树洞（复用纸条与树洞素材） ---------- */
.ob-th {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.ob-th__paper {
  position: relative;
  width: 56%;
  aspect-ratio: 985 / 1064;
  transform-origin: 50% 100%;
  transition: transform 0.56s var(--ease), opacity 0.4s ease 0.16s;
  will-change: transform, opacity;
}
.ob-th__paper .th-paper__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.25rem 0.5rem rgba(96, 78, 52, 0.13));
}
.ob-th__paper .th-paper__text {
  font-size: 0.64rem;
  line-height: 1.7;
  padding: 13% 12% 12% 12.5%;
}
.ob-th__hole { position: relative; width: 40%; aspect-ratio: 1085 / 1190; }
.ob-th__hole img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; pointer-events: none; -webkit-user-drag: none;
}
.ob-th__back  { z-index: 1; }
.ob-th__front { z-index: 2; }
/* 投进去：纸条缩小下沉、钻进洞里 */
.ob-step.is-throwing .ob-th__paper {
  transform: translate3d(0, 52%, 0) scale(0.3) rotate(-3deg);
  opacity: 0;
}

/* ---------- 04 · 释放空间（复用 .bubble + bubblePop） ---------- */
.ob-sky {
  position: relative;
  width: 100%;
  max-width: 19rem;
  height: 12.5rem;
  margin-top: 1.3rem;
}
.ob-sky .bubble { position: absolute; }

/* ---------- 05 · 心情日记（复用日记本 + 页纸 + 清雅宋） ---------- */
.ob-book {
  position: relative;
  width: 100%;
  max-width: 20.5rem;
  aspect-ratio: 1.80;                 /* 与书本框一致，不拉伸 */
  margin-top: 1.5rem;
}
.ob-book .dy-book__fit { position: absolute; inset: 0; }
.ob-book .dy-book__text { font-size: 3.05cqw; }   /* 比日记页略大，手机上才读得清 */

/* ---------- 06 · 知序（复用聊天气泡样式） ---------- */
.ob-title--soft { font-size: 1.16rem; line-height: 1.65; }
.ob-chat {
  width: 100%;
  max-width: 20rem;
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
}
.ob-chat .ob-msg { opacity: 0; animation: obMsgIn 0.46s var(--ease) both; }
@keyframes obMsgIn {
  from { opacity: 0; transform: translateY(0.4rem); }
  to   { opacity: 1; transform: none; }
}
.ob-chat .msg--user { margin: 0; }
.ob-chat .msg--user .bubble { font-size: 0.78rem; }
.ob-chat .msg--zhixu { margin: 0; font-size: 0.78rem; line-height: 1.85; }

/* 「可读宽度上限」那条 .ob-body > * 会给所有子元素 width:100%（它的位置更靠后），
   下面这几个需要按自己的尺寸来，所以用更高优先级写一遍。 */
.ob-body > .ob-logo     { width: 7.4rem; }
.ob-body > .ob-weathers { width: 15.4rem; }
.ob-body > .ob-th       { width: 100%; max-width: 19rem; }

/* ==========================================================================
   Demo 提示
   ========================================================================== */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8.2rem);
  z-index: 40;
  max-width: 80%;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.82);
  color: #FFFFFF;
  font-size: 0.65rem;
  line-height: 1.05rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 0.35rem);
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   可读宽度上限
   --------------------------------------------------------------------------
   画布现在能铺到 16:9（见 .app），平板上还会一直铺满屏宽。
   于是「要读的、要输入的那几列」需要一道上限，否则中文一行会拉到 40 多字，很难读。

   24rem = 设计稿里 480pt ≈ 32 个汉字一行，是舒服区间的上沿。
   ⚠️ 手机完全不受影响：竖屏时这些列的宽度就是画布宽 22rem，本来就在 24rem 以内。
   只有平板 / 横屏 / 桌面浏览器才会撞到这道线。
   天空、话题侧栏、引导圈这些本来就该铺满的，不在此列。
   ========================================================================== */
.dock,
.quickbar,
.stream,
.treehole__scroll,
.rel-write__scroll,
.diary__scroll,
.sp__scroll,
.ob-body > * {
  width: 100%;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

/* 返回头是滚动体的兄弟节点，得单独收一次，否则会和正文错开一大截。
   它们的左右内边距和滚动体一致（都是 1.8rem），所以同一个宽度就对齐了。 */
.th-head,
.rl-head,
.dy-head,
.sp-head {
  width: 100%;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

/* 天空的提示语和收尾是绝对定位的，收窄后要重新居中 */
.rl-sky-hint,
.rl-done {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   宽屏：聊天气泡也跟着变宽松
   --------------------------------------------------------------------------
   手机竖屏里气泡 76% 已经合适；到了平板 / 桌面，正文列放宽到 24rem，
   气泡跟着放宽一点、内边距加宽，不会在宽画布上显得局促。
   ========================================================================== */
@media (min-width: 640px) {
  .msg--user .bubble {
    max-width: 88%;
    padding: 0.85rem 1.4rem;
  }
}

/* ==========================================================================
   极矮屏幕兜底：保证不溢出
   ========================================================================== */
@media (max-height: 560px) {
  .hero__greet { font-size: 1.25rem; line-height: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   页面切换：把「同时淡出淡入」改成「先退后进」
   --------------------------------------------------------------------------
   原来首页 / 对话 / 树洞 / 日记 / 释放空间 / 设置 共用同一条
   opacity 0.32s var(--ease)：旧页面和新页面会在同一帧里各糊一半、
   叠在一起，中间那一下又脏又生硬。
   现在拆成两段 —— 旧页面先用 0.26s 干脆退干净，新页面晚 0.10s 再开始、
   用 0.46s 柔和地淡进来。只改时长与缓动曲线，不动任何布局、尺寸与位置。
   （.onb 是 display 切换，本来就无法过渡，不在此列。）
   ========================================================================== */
/* ==========================================================================
   iOS 风格 Push / Slide-over 页面转场
   --------------------------------------------------------------------------
   只把「页面切换」从淡入淡出换成横向位移：
     新页从右侧屏外滑入 → 旧页左移 26% 让位；返回时整体反向。
   全部走 transform: translate3d()（GPU 合成），不触发布局。
   不改任何尺寸 / 颜色 / 组件 / 交互逻辑，抽屉（.topics）与引导（.onb）不在此列。
   转场期间由 .is-pushing 统一接管指针事件并提前合成（JS 只挂这一个类）。
   ========================================================================== */
:root { --push-dur: 0.42s; }
/* 画布宽度（.app 的宽度公式），给需要按「屏宽」而不是「自身宽度」位移的元素用 */
.app { --appw: min(100vw, calc(100dvh * 21 / 9)); }

/* 一级页：默认停在右侧屏外；离场时滑完再隐藏 */
.chat, .treehole, .release, .diary, .sp, .ab {
  transform: translate3d(100%, 0, 0);
  opacity: 1;
  visibility: hidden;
  transition: transform var(--push-dur) var(--ease),
              visibility 0s linear var(--push-dur);
}

/* 首页 / 顶栏 / 输入框：默认在位（被压到左边时也是滑过去） */
.home, .topbar, .dock {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  transition: transform var(--push-dur) var(--ease),
              visibility 0s linear 0s;
}

/* 旧层左移让位 */
.app.is-chat .home,
.app.is-treehole .home, .app.is-treehole .chat,
.app.is-diary .home,    .app.is-diary .chat,
.app.is-release .home,  .app.is-release .chat,
.app.is-settings .home, .app.is-settings .chat,
.app.is-about .home,    .app.is-about .chat,
.app.is-treehole .topbar, .app.is-treehole .dock,
.app.is-diary .topbar,    .app.is-diary .dock,
.app.is-release .topbar,  .app.is-release .dock,
.app.is-settings .topbar, .app.is-settings .dock,
.app.is-about .topbar,    .app.is-about .dock,
.app.is-about .sp {
  transform: translate3d(-26%, 0, 0);
  opacity: 1;
  visibility: hidden;
  transition: transform var(--push-dur) var(--ease),
              visibility 0s linear var(--push-dur);
}

/* 新页滑到位（并且立刻可见） */
.app.is-chat .chat,
.app.is-treehole .treehole,
.app.is-diary .diary,
.app.is-release .release,
.app.is-settings .sp,
.app.is-about .ab {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  transition: transform var(--push-dur) var(--ease),
              visibility 0s linear 0s;
}

/* 两处修正（必须放在上面几条之后才生效）：
   1) 设置 → 关于：设置页要留在左边让位，不能被「新页滑到位」拉回 0
   2) 输入框有 24rem 宽度上限，-26% 是相对它自身；这里按画布宽度算，才和页面同步 */
.app.is-settings.is-about .sp {
  transform: translate3d(-26%, 0, 0);
  opacity: 1;
  visibility: hidden;
  transition: transform var(--push-dur) var(--ease),
              visibility 0s linear var(--push-dur);
}
.app.is-treehole .dock, .app.is-diary .dock, .app.is-release .dock,
.app.is-settings .dock, .app.is-about .dock {
  transform: translate3d(calc(var(--appw) * -0.26), 0, 0);
}

/* 进对话页时，首页要「干脆地让位」。
   必须写在上面那条「旧层左移让位」之后 —— 那条会把 opacity 重新写成 1，
   于是首页只能靠 0.42s 之后的 visibility 隐藏：整段不透明地压在对话页下面
   （大标题、知序形象、快捷回复都会透出来），既不像「指令被立即执行」，
   也让过渡多画一整屏。这里让它 0.2s 淡完。 */
.app.is-chat .home {
  opacity: 0;
  transition: transform var(--push-dur) var(--ease),
              opacity 0.2s ease-out,
              visibility 0s linear 0.2s;
}

/* 转场进行中：挡住指针（防误点）+ 提前合成（保 60fps） */
.app.is-pushing .home, .app.is-pushing .chat, .app.is-pushing .treehole,
.app.is-pushing .release, .app.is-pushing .diary, .app.is-pushing .sp,
.app.is-pushing .ab, .app.is-pushing .topbar, .app.is-pushing .dock {
  pointer-events: none;
}
.app.is-pushing .home, .app.is-pushing .chat, .app.is-pushing .treehole,
.app.is-pushing .release, .app.is-pushing .diary, .app.is-pushing .sp,
.app.is-pushing .ab {
  will-change: transform, opacity;
}

/* ==========================================================================
   失败与重试 / 停止  ——  与 P0 修复配套的界面
   --------------------------------------------------------------------------
   以前请求失败时只 addSystemLine 一句灰字：用户那句话已经落库，
   但没有重发入口，只能自己再打一遍。现在失败是「这一条没接上」，
   下面直接给一个重发。
   ========================================================================== */
.msg--failed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin: -0.6rem 0 1.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-1);
}

.msg--failed .msg__detail {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #55555A;
}

.retry-btn {
  padding: 0.42rem 0.95rem;
  border-radius: var(--r-pill);
  background: var(--accent, #A9C7FF);
  color: #0A0C12;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

.retry-btn:active { transform: scale(0.97); }
.retry-btn:focus-visible { outline: 0.1rem solid var(--ink); outline-offset: 0.15rem; }

/* 失败且一个字都没流出来：收掉空行的骨架条，别在屏幕上留半截东西 */
.msg--zhixu.is-empty-failed:empty::before,
.msg--zhixu.is-empty-failed:empty::after { content: none; }
.msg--zhixu.is-empty-failed { margin-bottom: 0.35rem; }
.msg--zhixu.is-retrying { animation: fadeIn 0.24s ease both; }

/* ---------- 危机兜底卡片 ---------- */
/* 只在用户自己的话命中危机信号时出现，12 小时最多一次。
   和错误提示一样走「安静的卡片」，不弹窗、不报警式红框。 */
.crisis {
  margin: 0 0 1.3rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0.05rem 0.4rem rgba(28, 32, 44, 0.08);
  border-left: 0.14rem solid var(--accent, #A9C7FF);
  animation: msgIn 0.34s var(--ease) both;
}

.crisis__title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.crisis__text {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.crisis__list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crisis__item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.035);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.16s ease;
}
.crisis__item:active { background: rgba(0, 0, 0, 0.075); }

.crisis__item strong {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.crisis__item span {
  font-size: 0.64rem;
  color: var(--ink-soft);
}

.crisis__tail {
  margin: 0.7rem 0 0;
  font-size: 0.64rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.stop-btn {
  align-self: flex-start;
  margin: -0.8rem 0 1.2rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0.05rem 0.3rem rgba(28, 32, 44, 0.08);
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1;
}

.stop-btn:active { transform: scale(0.97); }
.stop-btn:focus-visible { outline: 0.1rem solid var(--ink); outline-offset: 0.15rem; }

/* ---------- 回到底部 ---------- */
/* 用户往上翻看历史时出现；滚回底部后消失。浮在对话区底部正中。 */
.to-bottom {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.1rem 0.5rem rgba(28, 32, 44, 0.16);
  color: var(--ink);
  z-index: 6;
  animation: fadeIn 0.2s ease both;
}
.to-bottom[hidden] { display: none; }
.to-bottom .ic { font-size: 1.1rem; }
.to-bottom:active { transform: translateX(-50%) scale(0.94); }
.to-bottom:focus-visible { outline: 0.1rem solid var(--ink); outline-offset: 0.15rem; }

/* 液态玻璃：回到底部圆钮
   ----------------------------------------------------------------------
   与 .dock 那几条同源，但它是**独立实例**（.chat 里，不在 .dock 子树中，
   targets 合不过去）。两条与 chip 不同的地方：

   1. 底色撤掉后不用改按压反馈。chip 的 canvas 挂在 .dock 上，缩 chip 只动得了
      图标和文字；圆钮的 canvas 是它**自己的子元素**，transform: scale() 会带着
      玻璃一起缩，所以原来那条 :active 保持不动（连 translateX(-50%) 的居中一起）。

   2. 它是 hidden 出来的：display:none 时量到 0×0，库会把画布 visibility:hidden，
      重新出现时 ResizeObserver 再唤醒。 */
.to-bottom[data-liquid-glass="pending"],
.to-bottom:not(.is-glass-ready)[data-liquid-glass="webgl"] {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.1rem 0.5rem rgba(28, 32, 44, 0.16);
}
.to-bottom[data-liquid-glass="webgl"] {
  background: none;
  box-shadow: none;
}

/* ==========================================================================
   缩放复位锚：1×1、不可见、不参与布局，只用来把视图滚回左上角
   ========================================================================== */
.zoom-anchor {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   键盘焦点环
   --------------------------------------------------------------------------
   全局写了 input:focus { outline: none } 却没给替代方案 ——
   设置页那两个 role="slider" 的自绘控件（色相条、波轮）键盘完全不可用。
   用 :focus-visible 只给键盘用户画环，触屏点按不会出现。
   ========================================================================== */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  /* 焦点环用主题蓝（纸面上 3.6:1，达到非文字 3:1）；深色填充按钮的
     「白内圈 + 蓝外圈」在末尾 3.0 段里单独覆盖。 */
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* ==========================================================================
   防误触：把「点按」和「缩放」分开
   --------------------------------------------------------------------------
   按钮、卡片这类可点元素用 touch-action: manipulation —— 浏览器会跳过双击
   缩放（那 300ms 的等待也一起省了），单击与滚动都不受影响。
   正文不能设 none，否则用户没法选中和复制知序说的话。
   ========================================================================== */
button,
.chip,
.rec,
.topic,
.sp-sw,
.dy-w,
.th-emo,
.tag,
.rl-idea,
.retry-btn,
.stop-btn {
  touch-action: manipulation;
}

/* ==========================================================================
   动效敏感
   --------------------------------------------------------------------------
   原来只用 @media 关了 transition，漏了 animation ——
   呼吸点、泡泡漂流、泡泡上下浮动这三个无限循环动画照跑不误。
   这里补上 animation 的兜底；JS 侧还会加 .is-motion-reduced
   （Lynx 端 prefers-reduced-motion 永不匹配，必须靠 class 开关）。
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .preset, .bubble { transform: none !important; }
}

.app.is-motion-reduced .preset,
.app.is-motion-reduced .bubble {
  animation: none !important;
  transform: none !important;
}
.app.is-motion-reduced .msg,
.app.is-motion-reduced .chunk { animation: none !important; }

/* ==========================================================================
   v2.3 UX 专项修复
   --------------------------------------------------------------------------
   1) 首页：知序先开口 -> 快捷回应句，把「组织一段话」降成「点一下」
   2) 抽屉：设置入口上提到标题旁、文字化
   3) 设置：知序记住的事，逐条可删（把「用户可控记忆」补成闭环）
   4) 断网整体提示
   5) 树洞：字数计数 + 回声失败提示
   6) 日记：多选提示 + 无记录改成空心点（不只靠明暗）
   ========================================================================== */

/* ---------- 首页：快捷回应 ---------- */
.hero__replies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 22rem;
  margin-top: 0.95rem;
  padding: 0 1.2rem;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

/* 输入框获得焦点（准备打字 / 键盘弹出）时收起来，把这一屏让给输入；
   失焦（收起键盘、点了别处）再回来 */
.home.is-typing .hero__replies {
  opacity: 0;
  transform: translateY(0.35rem);
  pointer-events: none;
}

.hero__reply {
  height: 2.05rem;
  padding: 0 0.85rem;
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  box-shadow: 0 0.05rem 0.2rem rgba(96, 126, 178, 0.10);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
}
.hero__reply:active { transform: scale(0.96); filter: brightness(0.985); }

/* 快捷回复的液态玻璃（2026-11-01）：targets 模式，画布挂在 #heroReplies，
   规则从容器起头（同 .dock，不要写回 .hero__reply 自己身上）。
   没出第一帧时保留实心底；降级（无 WebGL / fallback）时根本不加 webgl 属性，
   也就回到原来的白色小胶囊。 */
.hero__replies:not(.is-glass-ready)[data-liquid-glass="webgl"] .hero__reply {
  background: var(--chip-bg);
  box-shadow: 0 0.05rem 0.2rem rgba(96, 126, 178, 0.10);
}
.hero__replies[data-liquid-glass="webgl"] .hero__reply {
  background: none;
  box-shadow: none;
}
/* 底色撤掉后不能只缩文字：换成内容压暗，胶囊本体交给玻璃 */
.hero__replies[data-liquid-glass="webgl"] .hero__reply:active {
  transform: none;
  filter: brightness(0.97);
}

/* ---------- 设置：知序记住的事 ---------- */
.mems { display: flex; flex-direction: column; gap: 0.6rem; }

.mem {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.55rem 0.7rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.72);
}

.mem__body { flex: 1 1 auto; min-width: 0; }

.mem__content {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-word;
}

.mem__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.6rem;
  color: var(--ink-soft);
}

.mem__cat {
  padding: 0.1rem 0.45rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.62);
}

.mem__del {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.32);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.mem__del:active { background: rgba(0, 0, 0, 0.08); color: #C0392B; }

.mems__empty {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- 断网整体提示 ---------- */
.offline {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  z-index: 55;
  transform: translateX(-50%);
  width: calc(100% - 2.4rem);
  max-width: 22rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(28, 32, 44, 0.86);
  color: #FFFFFF;
  font-size: 0.66rem;
  line-height: 1.5;
  text-align: center;
}
.offline[hidden] { display: none; }

/* ---------- 树洞：字数计数 + 回声失败 ---------- */
.th-count {
  margin: 0.45rem 0.2rem 0;
  font-size: 0.6rem;
  text-align: right;
  color: var(--ink-soft);
}

.th-echo--failed { background: rgba(0, 0, 0, 0.022); }
.th-echo--failed .th-echo__text { color: rgba(0, 0, 0, 0.5); }
.th-echo__retry {
  margin-top: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.66rem;
  color: var(--ink);
}
.th-echo__retry:active { background: rgba(0, 0, 0, 0.12); }

/* ---------- 日记：多选提示 / 无记录的空心点 ---------- */
.dy-limit {
  margin: 0.7rem 0 0;
  font-size: 0.6rem;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-soft);
}

.dy-day--none .dy-day__emoji {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0.35rem 0;
  border: 0.08rem dashed rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  color: transparent;
  opacity: 1;
}
.dy-day--today.dy-day--none .dy-day__emoji { border-color: rgba(255, 255, 255, 0.35); }

/* ---------- emoji：指定一套彩色 emoji 字体栈 ----------
   天气与情绪目前用 emoji 表达，各家 Android 版本自带的 Noto Color Emoji
   画风并不一致（同一颗 😢 在不同机型上差别明显）。这里先统一字体族，
   保证至少走彩色 emoji 字体而不是黑白符号；要彻底一致，需要把这几颗
   换成内联 SVG，属于后续可做项（已评估，见交付说明）。 */
:root {
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
           "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
}
.th-emo__icon,
.dy-w__emoji,
.dy-day__emoji { font-family: var(--emoji); }

/* ==========================================================================
   纸条投入树洞 —— 共享元素转场
   --------------------------------------------------------------------------
   写纸条页（设计图 A） → 树洞页（设计图 B）。
   结构上不新增「页面」，只在 #treehole 里叠了两屏，用状态类切换：
       is-treehole            → 树洞整段可见（沿用原有状态，未破坏）
       is-treehole.is-writing → 停在 A 页，纸和「写完了」都在
       is-flying              → 起飞后的那 1 秒：A 页让位、B 页淡入、
                                .th-fly 里的克隆纸沿曲线飞向树洞
   两屏之间没有「淡出→淡入」的整页跳转，用户看到的是同一张纸飞过去。
   ========================================================================== */

/* 两屏叠在同一个滚动容器里，各自滚，互不带着滚。
   默认都藏起来，由状态类决定谁出来 —— 这样落地后 A 页一定是干净的，
   不依赖 :not() 的过渡时序。 */
.th-write,
.th-hole {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.6rem 1.8rem calc(env(safe-area-inset-bottom, 0px) + 3rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.42s var(--ease), visibility 0.42s;
}

/* A 页：写纸条 */
.app.is-writing .th-write {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* B 页：树洞 */
.app.is-treehole:not(.is-writing) .th-hole {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* 起飞：A 页先干净退场，B 页同时慢慢浮上来（这条写在后面，优先级更高） */
.app.is-flying .th-write { opacity: 0; visibility: hidden; pointer-events: none; }
.app.is-flying .th-hole  { opacity: 1; visibility: visible; pointer-events: auto; }

/* --------------------------------------------------------------------------
   A 页 · 那张纸
   #thInput 直接坐在纸面上：透明、无边框、无底色。
   -------------------------------------------------------------------------- */
.th-paper {
  position: relative;
  width: 100%;
  margin: 0.9rem 0 0;
  aspect-ratio: 985 / 1064;          /* 与 paper-front.png 一致，永远不变形 */
  transform-origin: 50% 62%;
  /* 第一段：纸张从页面里浮起 —— 只动 transform 与阴影，不碰布局 */
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.th-paper__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  /* 阴影用 drop-shadow 挂在纸的轮廓上，纸张浮起时才会「轻一点」 */
  filter: drop-shadow(0 0.3rem 0.55rem rgba(96, 78, 52, 0.14));
  transition: filter 0.42s ease;
}
.th-paper.is-lifting { transform: translateY(-0.5rem) rotate(-1.2deg) scale(1.02); }
.th-paper.is-lifting .th-paper__bg {
  filter: drop-shadow(0 0.85rem 1.35rem rgba(96, 78, 52, 0.22));
}

.th-paper__text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 12.5% 11.5% 12% 12%;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;                /* 设计图正文约 17~18pt */
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: #474138;
  resize: none;
  outline: none;
  -webkit-appearance: none;
  overflow: hidden;
}
.th-paper__text::placeholder { color: #A79C89; }

/* 「写完了」：设计图里的暖沙胶囊，不是原来的黑胶囊 */
.th-write .th-submit {
  background: #FCE8C6;
  color: #3D372C;
  font-weight: 400;
  font-family: var(--brand);
  font-size: 0.95rem;
  box-shadow: 0 0.15rem 0.5rem rgba(150, 120, 70, 0.12);
}
.th-write .th-submit:disabled {
  background: #F6EEE0;
  color: #B7AC99;
  box-shadow: none;
}
/* 第一段：按钮轻微缩小 / 淡出 */
.th-submit.is-pressed {
  transform: scale(0.94);
  opacity: 0.45;
  transition: transform 0.15s var(--ease), opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   B 页 · 树洞三层：内壁 → 纸层 → 前缘
   -------------------------------------------------------------------------- */
.th-stage {
  position: relative;
  width: 100%;
  max-width: 22rem;
  margin: 0.2rem auto 0;
  aspect-ratio: 1085 / 1190;         /* 与 hole-back.png / hole-front.png 一致 */
  /* 这些常量全部来自 hole-front.png 里挖空的那个洞口：
       --hole-cx / --hole-cy  洞口中心
       --pile-base-y          洞底（纸堆的落点基线）
       --paper-w              单张纸的宽度占比 */
  --pile-base-y: 74.5%;
  --paper-w: 17.5%;
}
.th-stage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.th-stage__front { z-index: 3; }       /* 前缘盖住一切，纸进来就被挡住 */
.th-stage__back  { z-index: 1; }

/* 纸张层：夹在内壁和前缘之间，并且裁剪在洞口轮廓内。
   所以纸永远不会出现在洞外的树皮上，落到洞底才露出来。 */
.th-paper-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: polygon(
    51.08% 36.88%, 61.01% 38.69%, 66.43% 42.80%, 69.32% 49.39%,
    70.40% 56.97%, 69.14% 64.38%, 64.80% 71.30%, 58.48% 74.92%,
    50.17% 76.24%, 42.04% 73.44%, 38.43% 69.32%, 36.44% 62.57%,
    35.36% 55.98%, 36.35% 50.22%, 38.07% 44.45%, 42.22% 39.51%
  );
}

/* 洞里的一张纸：位置由 JS 用 --r / --s / left / top 随机好 */
.th-flake {
  position: absolute;
  width: var(--paper-w);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--r, 0deg)) scale(var(--s, 1));
  will-change: transform, opacity;
}
.th-flake img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
}

/* 新纸落进纸堆时轻轻弹一下（1400–1700ms 那一段） */
@keyframes thLand {
  0%   { opacity: 0; transform: translate(-50%, -100%) translateY(-0.7rem)
                     rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * 0.84)); }
  58%  { opacity: 1; transform: translate(-50%, -100%) translateY(0.14rem)
                     rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * 1.07)); }
  100% { opacity: 1; transform: translate(-50%, -100%) translateY(0)
                     rotate(var(--r, 0deg)) scale(var(--s, 1)); }
}
.th-flake.is-landing { animation: thLand 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* --------------------------------------------------------------------------
   共享元素层：飞行中的那张纸
   它夹在 tree-hole-back 与 tree-hole-front 之间（z-index:2 < 前缘 3），
   所以纸飞到洞口时会真的被前缘挡住 —— 不是「淡出消失」。
   坐标相对 .th-stage，起点由 JS 从 A 页纸的位置换算过来。
   -------------------------------------------------------------------------- */
.th-fly {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.th-fly__paper {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.th-fly__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.th-fly__text {
  position: absolute;
  inset: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  color: #474138;
  pointer-events: none;
}

/* 转场期间把返回键禁掉，避免动画中途把页面关掉 */
.app.is-flying .th-back { pointer-events: none; opacity: 0.4; }

/* ==========================================================================
   关于留白
   --------------------------------------------------------------------------
   严格按素材里的设计图（iPhone 17 pro max.webp）还原：
     · 背景沿用全站渐变 --bg
     · 应用标识 / 版本卡 / 检查更新卡 / 作者卡都用设计成品图
     · 版本卡上的三个「值」是动态填充的（客户端版本 / 后端版本 / 构建号），
       label 印在图里，值由 app.js 写进来，页面不写死任何版本号
   比例取自设计稿：内容列 = 屏宽 73.6%，版本卡 1300×576，两张小卡 683/560 宽。
   ========================================================================== */
.ab {
  position: absolute;
  inset: 0;
  z-index: 27;                 /* 高于设置页(26)，低于侧栏(30) */
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-4) var(--ease), visibility var(--dur-4);
}
.app.is-about .ab { opacity: 1; visibility: visible; }
.app.is-about .home,
.app.is-about .chat,
.app.is-about .sp { opacity: 0; visibility: hidden; }

.ab-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}
.ab-back {
  width: 1.7rem; height: 1.7rem;
  margin-left: -0.4rem;
  display: grid; place-items: center;
  border-radius: 50%;
  /* 玻璃质感 + 一圈克制的浅影（2.7.01 统一为树洞新版）：
     内圈留一道极淡的高光描边，外圈是柔和的落地影，不提亮、不发光晕 */
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(0.5rem) saturate(1.35);
  backdrop-filter: blur(0.5rem) saturate(1.35);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.72),
              0 0.05rem 0.3rem rgba(120, 100, 60, 0.08);
  color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.ab-back .ic { font-size: 0.95rem; }
.ab-back:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.78); }

.ab__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 顶部留白对应设计里标识上方的空场 */
  padding: calc(env(safe-area-inset-top, 0px) + 8.6rem)
           0 calc(env(safe-area-inset-bottom, 0px) + 3rem);
}

/* 顶部渐隐保护层：与设置页同款（返回键固定在滚动区外的页面都有一层） */
.ab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 6.5rem);
  z-index: 1;
  background: linear-gradient(
    to bottom,
    #FFFFFF 0%,
    rgba(255, 255, 255, 0.95) 38%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

/* ---------- 应用标识 ---------- */
.ab-logo {
  width: 10.1rem;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

/* ---------- 版本卡 ---------- */
.ab-ver {
  position: relative;
  width: 16.2rem;
  margin-top: 2rem;
}
.ab-ver__bg { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.ab-ver__val {
  position: absolute;
  left: 42%;
  max-width: 54%;
  transform: translateY(-50%);
  font-family: inherit;   /* 版本号是数据，用正文的 OPPO Sans，不用标题体 */
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #1C1C1E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
/* 三行标签中心（与卡图 576 高上的 128 / 284 / 440 对应） */
.ab-ver__val--1 { top: 22.2%; }
.ab-ver__val--2 { top: 49.3%; }
.ab-ver__val--3 { top: 76.4%; }

/* ---------- 检查更新 / 作者 ---------- */
.ab-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 16.2rem;
  margin-top: 0.98rem;
}
.ab-update {
  flex: 0 0 8.54rem;
  width: 8.54rem;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  transition: transform 0.16s var(--ease), opacity 0.16s ease;
}
.ab-update img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.ab-update:active { transform: scale(0.97); }
.ab-update.is-busy { opacity: 0.6; }
.ab-author { flex: 0 0 7rem; width: 7rem; }
.ab-author img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }

/* ---------- 设置页里的入口 ---------- */
.sp-about {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 2.6rem;
  padding: 0 0.95rem;
  border-radius: var(--r-chip);
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.8rem;
  color: var(--ink);
  transition: background 0.16s ease, transform 0.16s var(--ease);
}
.sp-about:active { background: rgba(0, 0, 0, 0.08); transform: scale(0.99); }
.sp-about__arrow { width: 0.8rem; height: 0.8rem; color: var(--ink-soft); }
#spPrivacyBtn { margin-top: 0.5rem; }      /* 第二行，和「关于留白」留一点间距 */

/* 页面切换：与其它整页一致的两段式淡出/淡入 */
.app.is-about .ab { transition: opacity 0.46s cubic-bezier(0.4, 0, 0.2, 1) 0.10s,
                                visibility 0s linear 0.10s; }
.ab { transition: opacity 0.26s cubic-bezier(0.4, 0, 0.2, 1),
                  visibility 0s linear 0.26s; }

/* ==========================================================================
   个性化体验（2.7.01）
   --------------------------------------------------------------------------
   从设置里打开的二级页：四项授权开关（个人偏好摘要 / 近期状态摘要 /
   相关交流背景 / 日常情境参考）+ 反馈共享开关 + 隐私协议链接。
   版式沿用设置页的行与分组（同款自定义属性）；返回键采用树洞新版的
   玻璃质感，后续替换其它页面时以这套参数为准。
   ========================================================================== */
.xp,
.gl {
  --sp-pad: 0.85rem;
  --sp-ic: 1.5rem;
  --sp-gap: 0.62rem;
  --sp-line: rgba(0, 0, 0, 0.055);
  position: absolute;
  inset: 0;
  z-index: 27;                 /* 同关于页：高于设置(26)、低于侧栏(30) */
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.26s;
}
.app.is-exp .xp {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.46s cubic-bezier(0.4, 0, 0.2, 1) 0.10s, visibility 0s linear 0.10s;
}
/* 液态玻璃二级页：同一个壳，只是换一个状态类 */
.app.is-glass .gl {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.46s cubic-bezier(0.4, 0, 0.2, 1) 0.10s, visibility 0s linear 0.10s;
}
.app.is-exp .sp,
.app.is-glass .sp { opacity: 0; visibility: hidden; }

/* 顶部模糊保护层：与设置页修正后的同款（在标题上方收干净，不糊标题） */
.xp::before,
.gl::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 4.3rem);
  z-index: 1;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  pointer-events: none;
}
.xp::after,
.gl::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 4.3rem);
  z-index: 1;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  pointer-events: none;
}

.xp-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1.8rem 0;
}
/* 新版返回键（玻璃质感，与树洞 / 关于 / 释放空间同一套参数） */
.xp-back {
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(0.5rem) saturate(1.35);
  backdrop-filter: blur(0.5rem) saturate(1.35);
  box-shadow: inset 0 0 0 0.05rem rgba(255, 255, 255, 0.72),
              0 0.05rem 0.3rem rgba(120, 100, 60, 0.08);
  color: var(--ink);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}
.xp-back .ic { font-size: 0.95rem; }
.xp-back:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.78); }

.xp-head__label {
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.xp__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 2.9rem) 1.8rem
           calc(env(safe-area-inset-bottom, 0px) + 3.4rem);
}

.xp-title {
  margin: 1.5rem 0 0;
  font-size: 1.6rem;       /* 32pt，与「设置」标题同档 */
  font-weight: 400;
  font-family: var(--brand);
  color: var(--ink);
}
.xp-lead {
  margin: 0.7rem 0 0;
  font-size: 0.66rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ---------- 液态玻璃二级页 ----------
   示例区先留空（设计待定）：这里只保留「入口图标里的 SVG 尺寸」和
   滑块卡的上边距。等示例稿定了再补 .gl-demo 那一块。 */
.sp-item__ic svg {
  width: 0.95rem;
  height: 0.95rem;
  display: inline-block;
  vertical-align: -0.12em;
}
.gl-control { margin-top: 1.1rem; }

/* 两行开关行：标题 + 一行说明 */
.xp-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}
.xp-desc {
  font-size: 0.6rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ==========================================================================
   Microsoft / 天气 表情图片
   --------------------------------------------------------------------------
   资源映射见 emoji-map.js；认识的 emoji 用 <img class="emoji-img">，
   大小 1em 跟着所在容器的 font-size 走，不认识的回退成字符。
   ========================================================================== */
.emoji-img {
  display: inline-block;
  width: 1em;
  height: 1em;
  object-fit: contain;
  vertical-align: -0.14em;
  -webkit-user-drag: none;
  user-select: none;
}
.emoji-text { font-family: var(--emoji); }

/* 表情图片在各处的尺寸微调（默认 1em，这里按设计观感略作修正） */
.th-emo__icon .emoji-img { width: 1.05rem; height: 1.05rem; }
.th-entry__tag .emoji-img { width: 0.78rem; height: 0.78rem; vertical-align: -0.12em; }
.dy-day__emoji--multi .emoji-img { width: 0.8rem; height: 0.8rem; }
.dy-item__meta .emoji-img { width: 0.95rem; height: 0.95rem; }
.dy-preview .emoji-img,
.dy-preview span { vertical-align: -0.12em; }

/* ==========================================================================
   焦点黑框：触屏设备上一律不要
   --------------------------------------------------------------------------
   原因：Chrome 对 <input>/<textarea> 聚焦时「总是」命中 :focus-visible
   （它认为文本输入 = 需要键盘），于是手指点一下输入框就会画出一圈黑框，
   在留白这种干净界面上非常刺眼。
   · 触屏（粗指针 / 不支持 hover）→ 全部关掉；
   · 桌面（细指针 + hover）→ 保留细环，键盘用户仍然可用。
   ========================================================================== */
/* 焦点策略（3.0 起）搬到文件末尾「留白 3.0」段的第 2 节：
   触屏不再一刀切关掉所有焦点框，改由 html.is-pointer-nav 区分
   「手指点按」与「键盘 / 开关控制」两种输入方式。 */

/* 聊天 / 回声里的行内表情：比 1em 略大，贴近系统 Emoji 的观感 */
.bubble .emoji-img,
.chunk .emoji-img,
.th-echo__text .emoji-img { width: 1.15em; height: 1.15em; vertical-align: -0.18em; }

/* 文本框即使被 Chrome 判定为 :focus-visible，也不画环（光标本身就是焦点提示） */
/* 输入框的焦点框：不再全局抹掉。手指点按时由 html.is-pointer-nav 抑制，
   键盘操作时显示（见文件末尾第 2 节）。 */

/* ==========================================================================
   Item 2 · 克制的空间感动效
   --------------------------------------------------------------------------
   全部是「一次性、短时长、不循环」的微动效；只动 transform / opacity，
   不新增任何元素，不改配色、尺寸、间距与交互逻辑。
   ========================================================================== */

/* ---------- 2a 树洞投纸：给飞行层一个观察点，纸片才有 3D 透视 ---------- */
.th-fly {
  perspective: 900px;
  perspective-origin: 50% 45%;
}

/* ---------- 2b 心情日记：进入时轻轻「翻」上来（内容层，不动整页） ---------- */
@keyframes dyPageIn {
  0%   { transform: perspective(1000px) rotateY(3.5deg) translate3d(1.2%, 0.35rem, 0); opacity: 0.55; }
  100% { transform: none; opacity: 1; }
}
.app.is-diary .diary__scroll {
  transform-origin: 0 50%;
  animation: dyPageIn 0.46s var(--ease) both;
}

/* ---------- 2c 知序「被回应」 ---------- */
/* 等待首字的两条骨架：从下沿轻轻长出来（breathe 继续负责呼吸的透明度）。
   参考里「正在想」的指示器要等一拍才出现（约 170ms），不是发出去就立刻亮。 */
@keyframes skelIn { from { transform: scaleY(0.55); } to { transform: none; } }
@keyframes skelFade { from { opacity: 0; } to { opacity: 1; } }
.msg--zhixu:empty::before {
  transform-origin: 50% 100%;
  animation: breathe 1.5s ease-in-out infinite, skelIn 0.26s var(--ease) both,
             skelFade 0.16s ease-out 0.17s backwards;
}
.msg--zhixu:empty::after {
  transform-origin: 50% 100%;
  animation: breathe 1.5s ease-in-out 0.22s infinite, skelIn 0.26s var(--ease) both,
             skelFade 0.16s ease-out 0.17s backwards;
}
/* 每日问候换成知序写的那句时，形象做一次极轻的呼吸（只一次，不循环） */

/* ---------- 2d 心情天气：选中时轻轻落定；记下来后整页极轻地一沉 ---------- */
@keyframes dyPickSettle {
  0%   { transform: scale(0.96); }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.dy-w.is-on { animation: dyPickSettle 0.22s var(--ease); }

@keyframes dySettle {
  0%   { transform: translate3d(0, 0, 0); }
  45%  { transform: translate3d(0, 0.12rem, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.diary.is-saved { animation: dySettle 0.3s var(--ease); }

/* ==========================================================================
   心情日记 · 横屏（严格按设计图「容器 1」）
   --------------------------------------------------------------------------
   左：整块拟物化日记本（占左侧约 57% 宽、约 88% 高）
   右：一张卡片（与书同高），3×2 天气 + 大输入框
   竖屏：整页高斯模糊 + 横屏提示
   功能、数据、交互沿用原实现。
   ========================================================================== */
@font-face {
  font-family: "Zihun QingYaSong";
  src: url("assets/zihun-qingyasong.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 底色取自设计图（页面 / 卡片 / 输入框） */
.diary { display: block; background: #FEF6E9; }
/* 横屏整屏：不受全站「最多铺到 16:9」的画布限制 */
.app.is-diary { width: 100vw; max-width: none; }

/* ---------- 横屏：书（左）+ 卡片（右） ---------- */
.dy-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 1.5% 0 7.3%;
  gap: 5.8%;
  box-sizing: border-box;
}
.app.is-diary .dy-stage { animation: dyPageIn 0.46s var(--ease) both; }

/* 左栏：返回/标题浮在左上，书本占满其余 */
.dy-left {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.dy-head {
  position: absolute;
  top: 3.6%;
  height: 6.45vw;              /* 与返回钮等高，别被标题行高撑大 */
  padding: 0;                  /* 覆盖旧规则留下的内边距 */
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: none;
  margin: 0;
}
.dy-back {
  /* 尺寸按「页宽」定，和设计图一致（圆盘 ≈ 页宽 4.9%），不受 rem 缩放影响 */
  width: 6.45vw;
  height: 6.45vw;
  display: grid;
  place-items: center;
  border-radius: 50%;
  /* 液态玻璃返回钮：用素材里提前算好的成品图（组合 3），不再用 CSS 拼 */
  background: url("assets/dy-back-glass.png") center / contain no-repeat;
  box-shadow: none;
  color: #2B2B30;
  transition: transform 0.16s var(--ease);
}
.dy-back .ic { font-size: 1.68vw; }
.dy-back:active { transform: scale(0.94); }
.dy-head__label {
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2B2B30;
  letter-spacing: 0.01em;
}

/* 书本：填满左栏（顶部给返回钮留出空间） */
.dy-book {
  position: absolute;
  left: 0;
  right: 0;
  top: 21.5%;          /* 设计图：书顶 21.7% */
  bottom: 5.2%;         /* 设计图：书底 94.8% */
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.dy-book__fit {
  position: relative;
  width: 100%;
  height: 100%;
  container-type: size;
}
.dy-book__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;           /* 框比例(1.80)≈素材(1.789)，不拉伸 */
  -webkit-user-drag: none;
  user-select: none;
}
.dy-book__page {
  position: absolute;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}
.dy-book__page--l { left: 9%;    top: 12%; width: 36%; height: 72%; }
.dy-book__page--r { left: 53.5%; top: 12%; width: 36%; height: 72%; }

.dy-book__text {
  height: 100%;
  padding: 0.15rem 0.2rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  font-family: "Zihun QingYaSong", "OPPO Sans", serif;
  color: #3F382E;
  font-size: 2.15cqw;            /* 随书本宽度缩放 */
  line-height: 1.85;
  letter-spacing: 0.02em;
}
.dy-book__text::-webkit-scrollbar { display: none; }
/* 字贴着纸面：左页 +3°、右页 −3° */
.dy-book__page--l .dy-book__text { transform: rotate(3deg);  transform-origin: 50% 50%; }
.dy-book__page--r .dy-book__text { transform: rotate(-3deg); transform-origin: 50% 50%; }
.dy-entry + .dy-entry { margin-top: 0.8em; }
.dy-entry__date { margin: 0; font-size: 1.05em; letter-spacing: 0.05em; }
.dy-entry__body { margin: 0.35em 0 0; white-space: pre-wrap; word-break: break-word; }
.dy-empty { margin: 0; color: rgba(63, 56, 46, 0.4); }

/* ---------- 这几天（设计图没有 → 隐藏，逻辑保留） ---------- */
.dy-strip { display: none; }

/* ---------- 右卡片：3×2 天气 + 大输入框 ---------- */
.dy-card {
  position: relative;
  flex: 0 0 29%;
  min-width: 0;                 /* 否则会被 textarea 的固有宽度顶大 */
  height: 83%;
  align-self: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: 1.5rem;
  background: #FCEED6;
}
.dy-weathers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;            /* 让 chip 保持正方形（不被行高拉伸） */
  gap: 0.55rem;
}
.dy-w {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 16%;
  background: url("assets/dy-frame-off.png") center / 100% 100% no-repeat;
  transition: transform 0.16s var(--ease);
}
.dy-w.is-on { background: url("assets/dy-frame-on.png") center / 100% 100% no-repeat; }
.dy-w:active { transform: scale(0.96); }
.dy-w__emoji { position: absolute; inset: 15%; display: grid; place-items: center; }
.dy-w__emoji .emoji-img { width: 100%; height: 100%; }
.dy-w__name {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.dy-preview {
  margin: 0.5rem 0 0;
  font-size: 0.6rem;
  text-align: center;
  color: rgba(63, 56, 46, 0.6);
}
.dy-note {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  margin-top: 0.65rem;
  border: 0;
  border-radius: 1.1rem;
  background: #FDE9CA;
  padding: 0.85rem 0.9rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.7rem;
  line-height: 1.85;
  color: #3F382E;
  resize: none;
  outline: none;
  -webkit-appearance: none;
}
.dy-note::placeholder { color: rgba(150, 128, 96, 0.55); }
/* 设计图里没有保存按钮；功能需要，做成右下角一枚小胶囊，不占版面 */
.dy-save {
  position: absolute;
  width: auto;
  right: 1.1rem;
  bottom: 1rem;
  height: 1.7rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: rgba(43, 43, 48, 0.9);
  color: #FFFFFF;
  font-size: 0.66rem;
  transition: transform 0.16s var(--ease), opacity 0.2s ease;
}
.dy-save:active { transform: scale(0.96); }
.dy-save:disabled { opacity: 0.32; }

/* 竖屏提示（.dy-rotate）已移除。
   手机在原生侧被锁成竖屏，靠 CSS 的 orientation 媒体查询永远等不到横屏，
   只会一直弹「请把手机横过来」。现在改成：进入日记时由 MainActivity 的
   ScreenBridge 请求横屏、离开时请求回竖屏，提示就不需要了。 */

/* ==========================================================================
   知序生成回答时的三段式动效（复刻参考的 Motion Design，不改留白自己的视觉身份）
   --------------------------------------------------------------------------
     Phase 1  0–300ms   用户气泡从输入框飞到消息区（app.js 里的 FLIP）
     Phase 2  0–3400ms  极光背景色相旅程 ‖ 流式文本按行成块淡入
     Phase 3  ≥3400ms   极光 100ms 交叉淡出 → 250ms 后操作栏淡入
   取值来自逐帧逆向报告：色相顺序、时间尺度、收尾节奏是核心。
   刻意不加：粒子 / glow / 弹跳 / overshoot / 缩放 / 旋转 UI / 波纹。
   ========================================================================== */

/* ---------- 极光层 ---------- */
/* 这是「顶部的一片柔光」，不是整屏特效：
   色层用顶部锚定的椭圆径向渐变，被自身 alpha 一路衰减到透明，
   所以留白原本的白→蓝底子始终透得出来；屏幕下半（输入区一带）基本不受影响。
   整层只改 opacity；6 个色层也只改 opacity（全走合成，不重绘渐变）。 */
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;                       /* .stage / .dock 在它上面 */
  overflow: hidden;
  pointer-events: none;
  /* 加载期间整幅底子换成白色：柔光打在纯白上才干净，下半屏不会和留白
     原本的蓝底互染；这一层随极光一起淡入淡出，所以 E6 一结束，
     主题色（白→蓝渐变）自动回来，不需要额外恢复逻辑。 */
  background: #FFFFFF;
  opacity: 0;
  /* 收敛也走淡出。原来 0.12s 太快，白底一撤主题色像被硬切回来 ——
     实测观感是「没有过渡」，所以放到 0.4s（时长见 app.js 的 AURORA_OUT_MS）。 */
  transition: opacity 0.4s ease-out;
}
.aurora.is-on {
  opacity: 1;
  transition: opacity 0.26s ease-out;       /* 出现稍慢，别硬切 */
}

/* 缓慢流动：整片光极轻地左右漂，只走 transform（不做旋转，避免光斑跑位） */
.aurora__spin {
  position: absolute;
  inset: 0;
  animation: auroraDrift 27s ease-in-out infinite;
  will-change: transform;
}
.aurora__c {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}

/* 六个色停，3.0 的蓝紫青柔光：雾蓝 → 薰衣草 → 薄荷 → 樱粉 → 浅蓝 → 近白。
   每层都是「顶边最浓、向下衰减到透明」的柔光；椭圆横向略宽于屏，
   所以顶部整幅都有颜色，但左右边缘也是柔和收掉的，不会出现硬边。 */
.aurora__c--1 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(214, 235, 255, 1) 0%, rgba(214, 235, 255, 0.72) 32%,
  rgba(214, 235, 255, 0.34) 55%, rgba(214, 235, 255, 0) 84%); }
.aurora__c--2 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(228, 224, 255, 1) 0%, rgba(228, 224, 255, 0.72) 32%,
  rgba(228, 224, 255, 0.34) 55%, rgba(228, 224, 255, 0) 84%); }
.aurora__c--3 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(221, 246, 240, 1) 0%, rgba(221, 246, 240, 0.72) 32%,
  rgba(221, 246, 240, 0.34) 55%, rgba(221, 246, 240, 0) 84%); }
.aurora__c--4 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(255, 226, 238, 1) 0%, rgba(255, 226, 238, 0.72) 32%,
  rgba(255, 226, 238, 0.34) 55%, rgba(255, 226, 238, 0) 84%); }
.aurora__c--5 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(234, 243, 255, 1) 0%, rgba(234, 243, 255, 0.72) 32%,
  rgba(234, 243, 255, 0.34) 55%, rgba(234, 243, 255, 0) 84%); }
.aurora__c--6 { background: radial-gradient(ellipse 104% 64% at 50% 0%,
  rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.72) 32%,
  rgba(255, 255, 255, 0.34) 55%, rgba(255, 255, 255, 0) 84%); }

@keyframes auroraDrift {
  0%, 100% { transform: translate3d(-1.8%, 0, 0); }
  50%      { transform: translate3d(1.8%, 0, 0); }
}

/* 色相旅程 3.4s，按报告的关键时间点插值：0 / 800 / 1900 / 2400 / 3000 / 3400ms。
   百分比 = 该时刻 ÷ 3400ms。 */
.aurora.is-run .aurora__c {
  animation-duration: 3.4s;
  animation-timing-function: linear;
  animation-fill-mode: both;        /* 走完停在末态，等收尾 */
  /* 网络慢的时候「色相旅程」3.4s 早走完了，会干等在近白那一帧上 ——
     看起来像卡住。改成无限循环，等回复期间一直在流动；
     alternate 让首尾都是浅色，折返处不会闪一下。
     回复到达时 auroraConverge() 照常摘掉 .is-on，整层 0.4s 淡出。 */
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.aurora.is-run .aurora__c--1 { animation-name: aurora1; }
.aurora.is-run .aurora__c--2 { animation-name: aurora2; }
.aurora.is-run .aurora__c--3 { animation-name: aurora3; }
.aurora.is-run .aurora__c--4 { animation-name: aurora4; }
.aurora.is-run .aurora__c--5 { animation-name: aurora5; }
.aurora.is-run .aurora__c--6 { animation-name: aurora6; }

@keyframes aurora1 { 0% { opacity: 1; } 23.5% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aurora2 { 0% { opacity: 0; } 23.5% { opacity: 1; } 55.9% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aurora3 { 0% { opacity: 0; } 23.5% { opacity: 0; } 55.9% { opacity: 1; } 70.6% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aurora4 { 0% { opacity: 0; } 55.9% { opacity: 0; } 70.6% { opacity: 1; } 88.2% { opacity: 0; } 100% { opacity: 0; } }
@keyframes aurora5 { 0% { opacity: 0; } 70.6% { opacity: 0; } 88.2% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aurora6 { 0% { opacity: 0; } 88.2% { opacity: 0; } 100% { opacity: 1; } }

/* ---------- Phase 3：回复操作栏（点赞 / 点踩，只在当前这一轮） ---------- */
.fb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: -0.7rem 0 1.2rem;
  animation: fbIn 0.28s ease-out both;
}
@keyframes fbIn {
  from { opacity: 0; transform: translateY(0.3rem); }
  to   { opacity: 1; transform: none; }
}
.fb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-1);
  transition: transform 0.16s var(--ease), color 0.16s var(--ease),
              background 0.16s var(--ease);
}
.fb__btn .ic { font-size: 0.92rem; }
.fb__btn:active { transform: scale(0.94); }
.fb__btn:focus-visible { outline: 0.1rem solid var(--ink); outline-offset: 0.15rem; }
.fb__btn.is-on { color: var(--ink); background: #FFFFFF; }

/* ---------- 2.7.01：聊天操作栏视觉减重 ----------
   原来的白色圆底 + 投影让点赞/点踩比回复本身还抢眼 —— 拿掉，图标直接落在留白上。
   命中区不缩水：伪元素在按钮四周做隐形扩展（1.9rem + 0.8rem ≈ 44px），
   原有视觉尺寸与间距都不变，点击时的缩放过渡沿用基础规则的 0.16s / var(--ease)。
   三态：未投 = 灰图标；已投 = 深图标 + 极浅状态底；再点取消回灰 —— 由 is-on 类承载，
   与 msg.fb 的既有逻辑一一对应（数据与上报不动）。
   树洞的 .fb--th 有自己的浅灰底与选中样式，这里用 :not() 排除，不受影响。 */
.fb:not(.fb--th) .fb__btn {
  position: relative;
  background: none;
  box-shadow: none;
}
.fb:not(.fb--th) .fb__btn::after {
  content: "";
  position: absolute;
  inset: -0.4rem;              /* 隐形命中区（触控 ≥44px 友好） */
}
.fb:not(.fb--th) .fb__btn:active { transform: scale(0.92); }
.fb:not(.fb--th) .fb__btn.is-on { color: var(--ink); background: rgba(0, 0, 0, 0.055); }

/* ---------- 2.7.01：长按消息菜单 ----------
   白底轻卡、圆角、极轻阴影、无边框；出现在长按点附近，
   出现/消失只是一次 0.16s 的淡入位移，克制不弹跳。 */
.msg-menu {
  position: fixed;
  z-index: 80;
  min-width: 8.4rem;
  padding: 0.3rem;
  border-radius: 0.9rem;
  background: #FFFFFF;
  box-shadow: 0 0.35rem 1.5rem rgba(20, 22, 28, 0.16),
              0 0.1rem 0.35rem rgba(20, 22, 28, 0.05);
  opacity: 0;
  transform: translateY(0.25rem) scale(0.97);
  transform-origin: center top;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  pointer-events: none;
}
.msg-menu[hidden] { display: none; }
.msg-menu.is-on { opacity: 1; transform: none; pointer-events: auto; }
.msg-menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.58rem 0.7rem;
  border-radius: 0.62rem;
  font-size: 0.74rem;
  color: var(--ink);
  text-align: left;
  background: none;
  transition: background 0.16s var(--ease);
}
.msg-menu__item .ic { font-size: 0.9rem; color: var(--ink-soft); }
.msg-menu__item:active { background: rgba(0, 0, 0, 0.05); }
.msg-menu__item--danger { color: #C0392B; }   /* 破坏性操作：红文字（与设置页一致） */
.msg-menu__item--danger .ic { color: inherit; }
.msg-menu__item:focus-visible { outline: 0.1rem solid var(--ink); outline-offset: -0.1rem; }

/* 选择内容模式：这一条消息临时开放系统文本选择（拖动调整、走系统复制） */
.msg.is-selecting,
.msg.is-selecting * {
  -webkit-user-select: text;
  user-select: text;
}

/* 2.7.01：引导末尾的隐私说明页已移除（直接完成引导进入 App）。
   原来这里有一整段 .onb__step--privacy / .pv__* 的样式（素材 pv-art.png、
   pv-foot-on/off.png 仍在 assets/ 里，未删）。隐私开关在设置「个性化体验」。 */

/* 树洞回声下面的评分条：复用 .fb 的按钮，只是位置和间距不同 */
.fb--th { margin: 0.55rem 0 0; justify-content: flex-start; }
.fb--th .fb__btn {
  width: 1.7rem;
  height: 1.7rem;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.045);
}
.fb--th .fb__btn.is-on { background: #FFFFFF; box-shadow: var(--shadow-1); }
.fb--th .fb__btn .ic { font-size: 0.85rem; }

/* ==========================================================================
   设置页 · 分组列表（2.6.01）
   --------------------------------------------------------------------------
   结构参照系统设置的「分组列表」逻辑：组标签 + 圆角容器 + 等高行
   （左图标 / 中标题 / 右侧状态或 Chevron），分割线从标题左缘内缩。
   配色、圆角、字号仍是留白自己的语言（浅色、温和），不照搬系统配色。
   ========================================================================== */

/* 行内度量：想整体调对齐只改这里 */
.sp {
  --sp-pad: 0.85rem;                 /* 行左右内边距 */
  --sp-ic: 1.5rem;                   /* 图标列宽 */
  --sp-gap: 0.62rem;                 /* 图标与标题的间距 */
  --sp-line: rgba(0, 0, 0, 0.055);   /* 行间细线 */
}

.sp-sec { margin-top: 1.9rem; }

.sp-sec__title {
  margin: 0 0 0.55rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.4);
}

.sp-note {
  margin: 0.55rem 0.3rem 0;
  font-size: 0.66rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.42);
}

/* 隐私协议：文字链接（地址待补，拿到后给 <a> 填上 href 即可） */
.sp-note--link { margin-top: 0.35rem; }
.sp-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* ---------- 组容器：一块大圆角卡片，行间只用一条细线 ---------- */
.sp-group {
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.72);
  /* 页面顶部接近纯白，纯白卡片会「消失」；一条极淡的内描边让分组在浅底上也有边界 */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.045);
  overflow: hidden;
}

/* ---------- 行：所有设置项等高 ---------- */
.sp-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-gap);
  width: 100%;
  min-height: 2.9rem;
  padding: 0.42rem var(--sp-pad);
  background: transparent;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
  text-align: left;
}
.sp-item + .sp-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: calc(var(--sp-pad) + var(--sp-ic) + var(--sp-gap));   /* 分割线与标题左缘对齐 */
  height: 1px;
  background: var(--sp-line);
}

/* 作者样式里的 display:flex 会盖掉 UA 的 [hidden]{display:none} ——
   液态玻璃入口在无 WebGL 时要整行收起（连同它上面的分割线），补回来。 */
.sp-item[hidden] { display: none; }

/* 图标：视觉重量跟标题持平（略大一点点，不抢字） */
.sp-item__ic {
  flex: 0 0 auto;
  width: var(--sp-ic);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.5);
}

.sp-item__label { flex: 1 1 auto; min-width: 0; }
.sp-item__val {
  flex: 0 0 auto;
  max-width: 48%;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: right;
}
.sp-item__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  /* 「今天和知序说了多少」那一行：0.72rem 时整句会折成 3 行、
     第三行只剩一两个孤字。降到 0.62rem 后收进 2 行。
     这个类只有 #spQuota 用，改动不会波及其它设置项。 */
  font-size: 0.62rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.sp-item__chev { flex: 0 0 auto; font-size: 0.76rem; color: rgba(0, 0, 0, 0.22); }

/* 跟在首行之后的第二行（色条、加标签这类控件）：左缩进对齐标题列 */
.sp-item--indent { padding-left: calc(var(--sp-pad) + var(--sp-ic) + var(--sp-gap)); }

/* 多行行：图标同样在行内垂直居中 —— 全页图标只用一个对齐规则 */
.sp-item--block { align-items: center; }

/* 可点行 */
.sp-item--link:active { background: rgba(0, 0, 0, 0.035); }

/* 危险行：只让文字和图标带警示色，不做红底 */
.sp-item__ic--danger { color: #C0392B; }

/* ---------- 复选框行（隐私） ---------- */
.sp-item--check:active { background: rgba(0, 0, 0, 0.035); }
.sp-check {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.38rem;
  border: 0.075rem solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  color: #FFFFFF;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease);
}
.sp-check .ic {
  font-size: 0.72rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.14s ease, transform 0.16s var(--ease);
}
.sp-item--check.is-on .sp-check { background: var(--ink); border-color: var(--ink); }
.sp-item--check.is-on .sp-check .ic { opacity: 1; transform: none; }
.sp-item--check:active .sp-check { transform: scale(0.94); }

/* ---------- 行里原有的控件：去掉各自的卡片感，融进组里 ---------- */
.sp-group .sp-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 2.1rem;
  min-height: var(--tap-min);       /* 42–43px 的裸输入框补到 44 的命中高度 */
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.82rem;
}
.sp-group .sp-swatches { width: 100%; }
.sp-group .pick { margin: 0; flex: 1 1 auto; min-width: 0; width: auto; }

/* 第二行：自定义色卡坐行首（与上一行图标同一条竖线），分割线对到色条左缘 */
.sp-custom-slot {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.sp-item--pick::before {
  left: calc(var(--sp-pad) + 2.2rem + 0.75rem);
}

/* 背景颜色这一组的磨砂材质：半透 + 高斯模糊 + 一层顶部高光 */
.sp-group--glass {
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65),
              inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 1px 2px rgba(28, 32, 44, 0.04);
}

/* ---------- 液态玻璃强度滑块（设置页） ----------
   一个滑块同时调「透明度 + 模糊度」（见 app.js applyGlassLevel）：
   左端更透、模糊更浅，右端更接近磨砂。参考 iOS Liquid Glass 调节页：
   左图标 = 透叠的两块玻璃，右图标 = 填实的玻璃。蓝轨用品牌交互蓝，
   填充长度由 --glp 控制（JS 按当前值写）。 */
.glslider {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.glslider__ico {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--color-text-secondary);
  opacity: 0.55;
}
.glslider__ico--solid {
  color: var(--color-text-tertiary);
  opacity: 0.62;
}
.glslider__input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 2.75rem;                     /* 命中高度 44：轨道细但不能难拖 */
  margin: 0;
  background: transparent;
  cursor: pointer;
}
/* WebKit / Blink：轨道本身画「已填充 + 未填充」两段 */
.glslider__input::-webkit-slider-runnable-track {
  height: 0.34rem;
  border-radius: var(--r-pill);
  background: linear-gradient(
    to right,
    var(--color-interactive) 0,
    var(--color-interactive) var(--glp, 50%),
    rgba(11, 11, 10, 0.14) var(--glp, 50%),
    rgba(11, 11, 10, 0.14) 100%
  );
}
.glslider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0.1rem 0.35rem rgba(28, 32, 44, 0.24),
              inset 0 0 0 0.05rem rgba(0, 0, 0, 0.05);
  margin-top: -0.58rem;                /* (1.5 - 0.34) / 2 */
  transition: transform 0.12s var(--ease);
}
.glslider__input:active::-webkit-slider-thumb { transform: scale(1.08); }
/* Firefox */
.glslider__input::-moz-range-track {
  height: 0.34rem;
  border-radius: var(--r-pill);
  background: rgba(11, 11, 10, 0.14);
}
.glslider__input::-moz-range-progress {
  height: 0.34rem;
  border-radius: var(--r-pill);
  background: var(--color-interactive);
}
.glslider__input::-moz-range-thumb {
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0.1rem 0.35rem rgba(28, 32, 44, 0.24);
}
.glslider__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: var(--r-pill);
}
.sp-group .hwheel { width: 100%; padding-top: 0; }

.sp-group .tagbox { display: flex; flex-direction: column; gap: 0.65rem; flex: 1 1 auto; min-width: 0; }
.sp-group .tags { width: 100%; margin-bottom: 0; }
.sp-group .tagadd { width: 100%; }
.sp-group .tagadd .sp-input {
  height: 2.15rem;
  padding: 0 0.8rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.04);
}
.sp-group .tagadd__go {
  flex: 0 0 auto;
  height: 2.15rem;              /* 与组内的输入框同高 */
  padding: 0 0.95rem;
  border-radius: 1rem;
  font-size: 0.76rem;
}

/* 记忆：不再是每张小白卡，而是组内的行，行间同一条细线 */
.sp-group .mems { width: 100%; gap: 0; }
.sp-group .mem {
  position: relative;
  padding: 0.55rem 0;
  border-radius: 0;
  background: transparent;
}
.sp-group .mem + .mem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--sp-line);
}

/* 清空：行内红色文字；展开后说明在上、两个按钮另起一行靠右，不收缩不换行 */
.sp-group .sp-clear {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin-top: 0;
}
.sp-group .sp-clear__acts {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-end;
}
.sp-group .sp-danger {
  min-height: 2.1rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #C0392B;
  font-size: 0.82rem;
  text-align: left;
}
.sp-group .sp-danger:active { background: transparent; opacity: 0.55; }
.sp-group .sp-ask { font-size: 0.72rem; line-height: 1.6; color: rgba(0, 0, 0, 0.55); }
.sp-group .sp-confirm {
  height: 2.1rem;
  min-width: 4.7rem;
  padding: 0 0.9rem;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.05);
  font-size: 0.74rem;
  color: rgba(0, 0, 0, 0.62);
}
.sp-group .sp-confirm--danger { color: #C0392B; background: rgba(192, 57, 43, 0.08); }

/* ==========================================================================
   通用提示框（2.6.01）
   --------------------------------------------------------------------------
   设计稿量出来的比例：卡片圆角 ≈ 卡宽 15.4%，内边距 ≈ 7%，按钮高 ≈ 15.2%，
   两个按钮等宽平分、间距 ≈ 4.2%。主操作在左（实心），取消在右（浅灰）。
   ========================================================================== */
.dlg {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0.24s;
}
.dlg.is-on { opacity: 1; visibility: visible; }

.dlg__scrim {
  position: absolute;
  inset: 0;
  background: rgba(24, 26, 33, 0.16);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dlg__card {
  position: relative;
  width: min(19.2rem, calc(100% - 3.2rem));
  padding: 1.55rem 1.3rem 1.2rem;
  border-radius: 2.9rem;          /* 设计稿比例：约为卡宽 15% */
  background: #FFFFFF;
  box-shadow: 0 1.4rem 3.2rem rgba(20, 22, 28, 0.18),
              0 0.15rem 0.55rem rgba(20, 22, 28, 0.06);
  transform: translateY(0.5rem) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.dlg.is-on .dlg__card { transform: none; }

.dlg__title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.dlg__title:empty { display: none; }

.dlg__text {
  margin: 0 0 1.35rem;
  font-size: 0.76rem;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.58);
  text-align: center;
  white-space: pre-line;
}

.dlg__acts { display: flex; gap: 0.75rem; }   /* 设计稿比例：约为卡宽 4.2% */

.dlg__btn {
  flex: 1 1 0;
  min-width: 0;
  height: 2.85rem;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;          /* 中文再长也不拆行 */
  transition: transform 0.16s var(--ease), background 0.2s ease, opacity 0.2s ease;
}
.dlg__btn:active { transform: scale(0.975); }
.dlg__btn--primary { background: #207BFF; color: #FFFFFF; }
.dlg__btn--primary:active { background: #1B6FE8; }
.dlg__btn--danger { background: #E5484D; color: #FFFFFF; }
.dlg__btn--danger:active { background: #D93F44; }
.dlg__btn--ghost { background: #D7D7D7; color: rgba(0, 0, 0, 0.55); }
.dlg__btn--ghost:active { background: #CECECE; }

/* 隐私那行：字号收一档，让整句停在一行里 */
.sp-item--check .sp-item__label { font-size: 0.72rem; }

/* ==========================================================================
   心情日记 · 页面级 3D 翻页（2.6.01）
   --------------------------------------------------------------------------
   书本素材与两个文字层保持原样；翻页时由 app.js 在 .dy-flip 里搭出「正在翻动
   的那一张纸」：正面 = 当前页内容、背面 = 翻过去后的内容，绕书脊（49.25%）
   做 rotateY 翻转。纸面裁切自 diary-book.png 本身（277.78% × 138.89% 放大后
   取单页区域），尺寸、纸色与纹理和书完全一致；明暗只加在两张贴片上。
   ========================================================================== */
.dy-flip {
  position: absolute;
  inset: 0;
  z-index: 3;
  visibility: hidden;               /* 空闲时完全不出现在画面上 */
  pointer-events: none;
  perspective: 1500px;
  perspective-origin: 49.25% 50%;
}
.dy-flip.is-on { visibility: visible; }

.dy-flip__sheet {
  position: absolute;
  top: 12%;
  height: 72%;
  width: 36%;
  transform-style: preserve-3d;
  will-change: transform;
}
/* 向后翻（去看更早的）：翻的是右页，绕书脊向左转 -180° */
.dy-flip.is-fwd .dy-flip__sheet { left: 53.5%; transform-origin: -11.8% 50%; transform: rotateY(0deg); }
/* 向前翻（回到较新的一页）：翻的是左页，绕书脊向右转 +180° */
.dy-flip.is-bwd .dy-flip__sheet { left: 9%; transform-origin: 111.94% 50%; transform: rotateY(0deg); }

.dy-flip.is-run.is-fwd .dy-flip__sheet {
  transform: rotateY(-180deg);
  transition: transform 0.6s cubic-bezier(0.36, 0.06, 0.18, 1);
}
.dy-flip.is-run.is-bwd .dy-flip__sheet {
  transform: rotateY(180deg);
  transition: transform 0.6s cubic-bezier(0.36, 0.06, 0.18, 1);
}

.dy-flip__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: #F6F0E2;                      /* 与纸面同色：裁切图万一有缝也看不出来 */
  background-image: url("assets/diary-book.png");
  background-repeat: no-repeat;
  background-size: 277.78% 138.89%;
  box-shadow: 0 2px 16px rgba(46, 36, 18, 0.20);  /* 纸页自身的厚度感（随纸一起旋转） */
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}
.dy-flip__face--back { transform: rotateY(180deg); }
/* 纸面裁切位置：右页 / 左页 */
.dy-flip.is-fwd .dy-flip__face--front { background-position: 83.6% 42.9%; }   /* 右页 */
.dy-flip.is-fwd .dy-flip__face--back  { background-position: 14.1% 42.9%; }   /* 翻过去成左页 */
.dy-flip.is-bwd .dy-flip__face--front { background-position: 14.1% 42.9%; }   /* 左页 */
.dy-flip.is-bwd .dy-flip__face--back  { background-position: 83.6% 42.9%; }   /* 翻过去成右页 */

/* 书脊附近的内侧阴影：纸在装订线附近自然变暗 */
.dy-flip__face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, rgba(58, 46, 26, 0.13), rgba(58, 46, 26, 0) 16%);
}
.dy-flip__face--back::after {
  background: linear-gradient(to left, rgba(58, 46, 26, 0.13), rgba(58, 46, 26, 0) 16%);
}
/* 字按所在页的倾斜角度贴上去（与静态页一致） */
.dy-flip.is-fwd .dy-flip__face--front .dy-book__text { transform: rotate(-3deg); transform-origin: 50% 50%; }
.dy-flip.is-fwd .dy-flip__face--back  .dy-book__text { transform: rotate(3deg);  transform-origin: 50% 50%; }
.dy-flip.is-bwd .dy-flip__face--front .dy-book__text { transform: rotate(3deg);  transform-origin: 50% 50%; }
.dy-flip.is-bwd .dy-flip__face--back  .dy-book__text { transform: rotate(-3deg); transform-origin: 50% 50%; }

/* 明暗贴片：翻动时被离开/落下的那一侧有轻微阴影变化（只做透明度动画，不动排版） */
.dy-flip__shade { position: absolute; top: 12%; height: 72%; width: 36%; opacity: 0; pointer-events: none; }
.dy-flip__shade--l { left: 9%; background: linear-gradient(to right, rgba(28, 20, 8, 0.02), rgba(28, 20, 8, 0.17)); }
.dy-flip__shade--r { left: 53.5%; background: linear-gradient(to left, rgba(28, 20, 8, 0.02), rgba(28, 20, 8, 0.17)); }

@keyframes dyShadeRise { 0% { opacity: 0; } 32% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes dyShadeSettle { 0%, 52% { opacity: 0; } 82% { opacity: 0.9; } 100% { opacity: 0; } }
.dy-flip.is-run.is-fwd .dy-flip__shade--r { animation: dyShadeRise 0.6s cubic-bezier(0.36, 0.06, 0.18, 1) both; }
.dy-flip.is-run.is-fwd .dy-flip__shade--l { animation: dyShadeSettle 0.6s cubic-bezier(0.36, 0.06, 0.18, 1) both; }
.dy-flip.is-run.is-bwd .dy-flip__shade--l { animation: dyShadeRise 0.6s cubic-bezier(0.36, 0.06, 0.18, 1) both; }
.dy-flip.is-run.is-bwd .dy-flip__shade--r { animation: dyShadeSettle 0.6s cubic-bezier(0.36, 0.06, 0.18, 1) both; }

/* ---------- 翻页按钮：页面左右两侧的圆钮 ---------- */
.dy-turn {
  position: absolute;
  top: 50%;
  width: clamp(42px, 4.6vw, 58px);
  height: clamp(42px, 4.6vw, 58px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  z-index: 4;
  color: #2B2B30;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.68));
  box-shadow: 0 1px 2px rgba(30, 25, 15, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.72), inset 0 -8px 14px rgba(30, 25, 15, 0.05);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
  transition: transform 0.16s var(--ease), opacity 0.2s var(--ease);
  touch-action: manipulation;
}
.dy-turn:active { transform: translateY(-50%) scale(0.94); }
.dy-turn--prev { left: 1.2%; }
.dy-turn--next { right: 1.2%; }
.dy-turn svg { width: 44%; height: 44%; }
.dy-turn[hidden] { display: none; }
.dy-turn:disabled { opacity: 0.28; cursor: default; pointer-events: none; }

/* 页码（2.7.01）：贴在书本下方、页面底部居中；避让横屏安全区，只读不抢视觉 */
.dy-pageno {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(1.1%, env(safe-area-inset-bottom, 0px));
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: rgba(63, 56, 46, 0.55);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.dy-pageno[hidden] { display: none; }

/* ==========================================================================
   集控提示：后台「自定义提示」在客户端的两种落点（2.6.01）
   ========================================================================== */

/* ---------- 顶部横幅（停在首页，直到用户关掉） ---------- */
.note-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(32, 123, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(32, 123, 255, 0.16);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #2B2B30;
  animation: nbIn 0.42s var(--ease) both;
}
.note-banner[hidden] { display: none; }
@keyframes nbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.note-banner__ic {
  flex: 0 0 auto; width: 1.35rem; height: 1.35rem;
  display: grid; place-items: center;
  border-radius: 50%; background: #207BFF; color: #fff; font-size: 0.78rem; margin-top: 0.12rem;
}
.note-banner__body { flex: 1 1 auto; min-width: 0; }
.note-banner__title { margin: 0; font-weight: 600; }
.note-banner__text { margin: 0.15rem 0 0; color: rgba(43, 43, 48, 0.78); white-space: pre-wrap; word-break: break-word; }
.note-banner__act {
  flex: 0 0 auto; align-self: center;
  font-size: 0.8rem; font-weight: 600; color: #1257C7; text-decoration: none;
  padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(32, 123, 255, 0.12);
}
.note-banner__act:active { background: rgba(32, 123, 255, 0.2); }
.note-banner__x {
  flex: 0 0 auto; background: none; border: 0;
  color: rgba(43, 43, 48, 0.45); font-size: 1rem; line-height: 1;
  padding: 0.2rem 0.3rem; border-radius: 0.5rem;
}
.note-banner__x:active { background: rgba(0, 0, 0, 0.06); }

/* ---------- 通知条（从顶部滑入、停留后自动收起） ---------- */
.note-stack {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(92vw, 27rem);
  pointer-events: none;
}
.note-card {
  pointer-events: auto;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.05rem;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 18px 40px -18px rgba(20, 18, 10, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: ncIn 0.5s var(--ease) both;
}
.note-card.is-out { animation: ncOut 0.4s var(--ease) both; }
@keyframes ncIn { from { opacity: 0; transform: translateY(-14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes ncOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }
.note-card__ic {
  width: 1.4rem; height: 1.4rem; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%; background: #207BFF; color: #fff; font-size: 0.8rem; margin-top: 0.05rem;
}
.note-card__body { flex: 1 1 auto; min-width: 0; }
.note-card__title { margin: 0; font-size: 0.88rem; font-weight: 600; }
.note-card__text { margin: 0.12rem 0 0; font-size: 0.82rem; line-height: 1.55; color: rgba(43, 43, 48, 0.8); white-space: pre-wrap; word-break: break-word; }
.note-card__act { display: inline-block; margin-top: 0.5rem; font-size: 0.78rem; font-weight: 600; color: #1257C7; text-decoration: none; }

/* 分页量尺：与左页同款、藏起来的一页，只用来量「还能放下多少字」。
   高度特意比真页矮一截（64.08% = 72% × 0.89）：底部 12% 是纸的渐隐区不排字，
   也让 scrollHeight > clientHeight 成为「内容超高」的可靠信号。 */
.dy-measure { visibility: hidden !important; pointer-events: none; z-index: -1; height: 64.08% !important; }

/* ==========================================================================
   渐进模糊（真实空间模糊，不是透明度渐变）
   --------------------------------------------------------------------------
   每条采样层都是一条独立的 backdrop-filter，半径 1 → 14px 分五档。
   条带一律从「固定栏所在的那一侧」起算并逐档变短：越靠近固定栏，叠上的
   模糊档位越多、半径越大；远离的一侧只剩 1px 的一档。每条再用线性遮罩
   淡出，所以相邻档位之间是渐变的，不会出现硬边界。
   全部 pointer-events:none；固定控件都在更高层，点击与可读性不受影响。
   不支持 backdrop-filter 时整组隐藏，不留任何视觉残留。
   ========================================================================== */
.pb-sample {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(var(--pb-b));
  backdrop-filter: blur(var(--pb-b));
  /* 遮罩在 55% 处还留住 0.55 的不透明度，再往上才渐隐 ——
     纯 0%→100% 的线性太"陡"，各档的尾巴在够到固定栏之前就归零了，
     固定栏那一排背后等于没有模糊。加一个中间停靠点，尾巴才够长。 */
  -webkit-mask-image: linear-gradient(var(--pb-d), #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  mask-image: linear-gradient(var(--pb-d), #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
}
/* 五档半径整体上调（原 1/2/4/8/14）。用户要求"糊得更重"，
   所以最小的那一档也提到 2px（1px 在实机上基本看不出），
   最大一档 14→26px，靠近固定栏的那一层是真的糊成一片。 */
.pb-sample--1 { --pb-b: 2px; }
.pb-sample--2 { --pb-b: 5px; }
.pb-sample--3 { --pb-b: 10px; }
.pb-sample--4 { --pb-b: 18px; }
.pb-sample--5 { --pb-b: 26px; }

/* 对话页（和知序讨论的地方）：消息流上缘贴着固定标题栏、下缘贴着底部输入栏，
   两侧各叠一条 —— 顶部向下变模糊、底部向上变模糊，中间保持清晰。
   条带范围严格止于「标题栏下沿」与「输入栏上沿」，不会盖到任何控件。 */
.pb-band {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
}
.chat__progressive-blur {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.chat__progressive-blur .pb-band--top {
  /* 从屏幕最顶端一直渐变到消息流上沿再往下 4rem：
     实测 440x956 下 标题栏 0→106、消息流 106→786、底部栏 786→956。
     最上面最糊、往下渐清晰；标题栏本身 z-index 更高，不受影响。 */
  top: 0;
  height: calc(env(safe-area-inset-top, 0px) + 5.3rem + 4rem);
  --pb-d: to bottom;
}
.chat__progressive-blur .pb-band--bottom {
  /* 实测：.chat 的底边就是底部输入栏的上沿（786），所以这里 bottom 为 0，
     再往上取 5rem 作为渐变带，正好止于输入栏，不侵入快捷按钮与输入框。 */
  bottom: 0;
  height: 5rem;
  --pb-d: to top;
}
.chat__progressive-blur .pb-band--top .pb-sample {
  /* 锚在消息流上沿（= 标题栏下沿），不是带的顶端：
     否则最重的几档全落在没有内容的标题栏上，等于白做。 */
  top: calc(env(safe-area-inset-top, 0px) + 5.3rem);
}
.chat__progressive-blur .pb-band--bottom .pb-sample { bottom: 0; }
.chat__progressive-blur .pb-sample--1 { height: 100%; }
.chat__progressive-blur .pb-sample--2 { height: 82%; }
.chat__progressive-blur .pb-sample--3 { height: 64%; }
.chat__progressive-blur .pb-sample--4 { height: 46%; }
.chat__progressive-blur .pb-sample--5 { height: 30%; }

/* 情绪树洞顶部的模糊渐隐层：本轮按用户要求移除。
   原因也核实过 —— 树洞两屏 .th-write / .th-hole 都是 absolute + inset:0，
   落在 .treehole__scroll 内部，而 .treehole__scroll 就在返回头下面，
   所以正文永远顶在返回头下沿，不会有内容从头部底下穿过，
   这层模糊实际上没有东西可模糊。
   要恢复：把 index.html 里 .treehole__scroll 开头那五档 <i class="pb-sample"> 加回来，
   再恢复下面这段（z-index 3、height = safe-area + 5.2rem、--pb-d: to bottom）即可。
.th-progressive-blur { position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  height: calc(env(safe-area-inset-top, 0px) + 5.2rem); overflow: hidden;
  pointer-events: none; --pb-d: to bottom; }
.th-progressive-blur .pb-sample { top: 0; }
.th-progressive-blur .pb-sample--1 { height: 100%; }
.th-progressive-blur .pb-sample--2 { height: 82%; }
.th-progressive-blur .pb-sample--3 { height: 64%; }
.th-progressive-blur .pb-sample--4 { height: 46%; }
.th-progressive-blur .pb-sample--5 { height: 30%; }
*/
.th-head { position: relative; z-index: 4; }

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .chat__progressive-blur { display: none; }
}

/* 顶部带：越靠近消息流上沿越糊，往下 4rem 内渐清晰。
   带容器仍然从屏幕顶端 0 起算，所以渐变是「从列表最上面一直到屏幕顶部」。 */
.chat__progressive-blur .pb-band--top .pb-sample--1 { height: 4rem; }
.chat__progressive-blur .pb-band--top .pb-sample--2 { height: 3.3rem; }
.chat__progressive-blur .pb-band--top .pb-sample--3 { height: 2.6rem; }
.chat__progressive-blur .pb-band--top .pb-sample--4 { height: 1.85rem; }
.chat__progressive-blur .pb-band--top .pb-sample--5 { height: 1.2rem; }

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .chat__progressive-blur,
  .th-progressive-blur { display: none; }
}

/* ==========================================================================
   本轮修正（按实测 440x956：标题栏 0-106 / 消息流 106-786 / 输入栏 786-956）

   1) 之前 .chat 用 padding-top 把消息流压在标题栏下面，内容最多只能升到
      106 就被裁掉 —— 模糊带再高也只能糊到空气。改成把这段间距放进 .stream
      自己的 padding 里：初始位置一模一样，但内容可以一直滚到屏幕顶部，
      模糊才可能「从屏幕顶部开始」。
   2) 模糊层容器改为铺满整屏（向下补足底部输入栏那 170px），范围按屏幕
      顶/底计算，而不是按消息容器计算。
   3) 顶部采样层锚回带子顶端（= 屏幕顶部），因为现在那里真的有内容了。
      底部仍止于输入栏上沿 —— 输入栏是不透明的，它下面没有内容可模糊。
   ========================================================================== */
.chat { padding-top: 0; }
.stream { padding-top: calc(env(safe-area-inset-top, 0px) + 5.3rem + 0.6rem); }

.chat__progressive-blur {
  top: 0;
  bottom: calc(-1 * (8.5rem + env(safe-area-inset-bottom, 0px)));
}
.chat__progressive-blur .pb-band--top {
  top: 0;
  height: calc(env(safe-area-inset-top, 0px) + 5.3rem + 4rem);
}
.chat__progressive-blur .pb-band--top .pb-sample { top: 0; }
.chat__progressive-blur .pb-band--top .pb-sample--1 { height: 100%; }
.chat__progressive-blur .pb-band--top .pb-sample--2 { height: 70%; }
.chat__progressive-blur .pb-band--top .pb-sample--3 { height: 46%; }
.chat__progressive-blur .pb-band--top .pb-sample--4 { height: 28%; }
.chat__progressive-blur .pb-band--top .pb-sample--5 { height: 16%; }
.chat__progressive-blur .pb-band--bottom {
  bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
  /* 与顶部对称：同为 9.3rem（5.3 + 4）186px，采样层高度比例也一致，
     所以下缘贴着输入栏往上、上缘贴着对话里同样是 4 档递进。 */
  height: 9.3rem;
}

/* ==========================================================================
   底部修正：模糊要做到「屏幕最底边」，而消息原本被关在 .stage 里、到 786
   （输入框上沿）就截断了，下面 170px 根本没内容可糊。
   做法：把 .chat 提到 .app 这一层（见 index.html），让它铺满整屏；
   底部栏是透明的（.dock 自身没底色，只有胶囊和 chips 有），所以消息会从
   胶囊周围穿过去并被逐级模糊。同时把底部栏抬到 .chat 之上，保证输入框、
   快捷按钮本身始终清晰可点。
   ========================================================================== */
.dock { z-index: 6; }
.stream { padding-bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px) + 1.1rem); }
.to-bottom { bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px) + 1rem); }

.chat__progressive-blur { top: 0; bottom: 0; }
/* 底部带放大 + 让模糊真正够到「快捷栏」
   ----------------------------------------------------------------------
   底部栏实测高度 8.5rem（170px），从上到下是：
     快捷栏 .quickbar  126→170px（三个 chip 那一排）
     间距              102→126px
     输入框 .askbar     22→102px
     底部内边距          0→ 22px
   原来的 9.3rem（186px）看着比快捷栏还高，但采样层的遮罩是"从底往上渐隐"，
   算到快捷栏下沿（126px）只剩 0.67px 等效模糊 —— 那排 chip 背后等于没糊。
   现在把带子抬到 15rem（300px）：尾巴够长，126px 处约有 13px、102px 处约有
   19px，越往上越淡，到快捷栏上沿（170px）还有约 4px，再往上收干净 ——
   即「模糊铺满整个快捷栏并继续往上延伸一截」。
   多出来的部分只是渐隐的尾巴，落在消息流最下方，正好是想要的过渡。 */
.chat__progressive-blur .pb-band--bottom {
  bottom: 0;
  height: 15rem;
}

/* 顶部白色渐变保护层
   ----------------------------------------------------------------------
   顶部模糊调薄之后，光靠 blur 已经压不住往上滚的内容 —— 在顶栏背后再铺一层
   「白 → 透明」的竖向渐变，内容滚到上面就自然融进白底，标题栏永远干净。
   放在 .chat 内部（z-index:0），所以它在顶栏（.stage，z-index:1）之下、
   极光与消息流之上；顶栏本身是透明的，正好从背后透出这层白。
   高度取 safe-area + 7.2rem（144px），比标题栏（106px）多留一截缓冲。 */
.chat__progressive-blur::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(env(safe-area-inset-top, 0px) + 7.2rem);
  background: linear-gradient(
    to bottom,
    #FFFFFF 0%,
    #FFFFFF 24%,
    rgba(255, 255, 255, 0.72) 55%,
    rgba(255, 255, 255, 0.28) 82%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}
.chat__progressive-blur .pb-band--bottom .pb-sample { bottom: 0; }
.chat__progressive-blur .pb-band--bottom .pb-sample--1 { height: 100%; }
.chat__progressive-blur .pb-band--bottom .pb-sample--2 { height: 86%; }
.chat__progressive-blur .pb-band--bottom .pb-sample--3 { height: 72%; }
.chat__progressive-blur .pb-band--bottom .pb-sample--4 { height: 58%; }
.chat__progressive-blur .pb-band--bottom .pb-sample--5 { height: 44%; }

/* 弹框关闭时必须完全不接点击：它 z-index 70 且自带宽 3px 的 backdrop-filter，
   一旦因为状态残留没关干净，整屏都会被它糊住并吞掉所有点击。 */
.dlg:not(.is-on) { pointer-events: none; }

/* 关键修正：.chat 被抬到 .app 层后设了 z-index: 5，而顶栏（含话题列表按钮）
   在 .stage 里（.stage 是 z-index: 1 的层叠上下文），于是整个 .stage 被 chat
   盖住 —— 话题列表按钮和它下面的东西都点不到。
   聊天模式下 .home 本来就是 opacity:0 / visibility:hidden，所以把 chat 沉到
   .stage 之下不会露出首页；顶栏、话题抽屉（.app 直属，z-index 30）、
   底部栏（z-index 6）则全部回到 chat 之上。 */
.chat { z-index: 0; }

/* 滑不动的原因：.chat 沉到 z-index: 0 之后，.stage（z-index: 1）虽然内容
   （.home）已隐藏，但它的盒子仍然整块盖在对话区上、把所有触摸事件接走了。
   聊天模式下让 .stage 不接事件即可；顶栏按钮自身写了 pointer-events: auto，
   子元素可以越过父级的 none，所以话题列表按钮照常可点。 */
.app.is-chat .stage { pointer-events: none; }

/* ==========================================================================
   留白 3.0 · 设计系统落地（本次 OTA 的全部视觉 / 交互改动）
   --------------------------------------------------------------------------
   为什么集中写在文件末尾：
     1) 这是一次「换一套统一的值 + 补状态」的升级，不是重写。既有规则里有大量
        实测注释（玻璃降级、键盘、渐进模糊……），逐条改写会把那些约束一起打散；
     2) 末尾覆盖的优先级明确：同权重后者胜，出问题只需要看这一段。
   段落顺序：基础设施 → 导航与底栏 → 首页 → 对话 → 树洞 → 日记 → 释放空间 →
             设置与二级页 → 浮层与提示 → 引导 → 适配 / 辅助功能。
   ========================================================================== */

:root {
  /* 需要带透明度时用的 RGB 通道（CSS 不能直接给十六进制变量加 alpha） */
  --color-paper-rgb: 245, 246, 243;
  --color-surface-rgb: 252, 252, 251;
  --fs-chip: clamp(10.5px, 0.6rem, 12.5px);
}

/* --------------------------------------------------------------------------
   1. 基础：字体渲染、选区、隐藏文本工具类
   -------------------------------------------------------------------------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection {
  background: rgba(244, 162, 97, 0.24);
  color: var(--color-text-primary);
}
/* 只给辅助技术读的状态文本（视觉隐藏，不参与布局） */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 正文容器的断行与长串保护：中文按语义断、英文长串不撑破气泡 */
.msg--zhixu,
.msg--user .bubble,
.th-entry__text,
.th-echo__text,
.dy-book__text,
.dy-note,
.dlg__text,
.sp-note,
.xp-lead,
.onb__sub,
.note-banner__text,
.note-card__text,
.crisis__text {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   2. 焦点可见性
   --------------------------------------------------------------------------
   原来触屏设备上用一条 :focus { outline: none !important } 把所有焦点框都关了，
   代价是外接键盘 / 开关控制 / 读屏用户完全失去「我在哪」的提示。
   现在由 app.js 维护 html.is-pointer-nav：手指按下时加、键盘操作时摘。
     · 手指点按：不画框（避免输入框被点一下出现黑框的旧问题）
     · 键盘操作：一律画「白色内圈 + 品牌蓝外圈」，在纸面、白卡、黑色按钮上都清楚
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
/* 手指模式下：所有元素都不画 outline（包括文本输入框 —— Chrome 对输入框
   即使鼠标点按也会命中 :focus-visible，靠 :not(:focus-visible) 挡不住）。
   容器级的焦点提示（.askbar:focus-within 的蓝环）不受影响，它画在壳上。 */
html.is-pointer-nav :focus {
  outline: none !important;
}
html.is-pointer-nav input:focus,
html.is-pointer-nav textarea:focus {
  outline: none !important;
}
/* 深色填充控件：白内圈 + 蓝外圈，避免蓝环贴着蓝底看不见 */
.dlg__btn:focus-visible,
.th-submit:focus-visible,
.onb__go:focus-visible,
.rl-go:focus-visible,
.tagadd__go:focus-visible,
.dy-save:focus-visible,
.retry-btn:focus-visible,
.note-banner__x:focus-visible,
.msg-menu__item:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: -4px;
  box-shadow: 0 0 0 3px var(--color-interactive-strong);
}
/* 输入类：焦点画在「壳」上，光照旧留在输入框里 */
.askbar:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
.sp-input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.th-paper__text:focus-visible {
  outline: 2px solid rgba(194, 90, 36, 0.55);
  outline-offset: -3px;
  border-radius: 0.6rem;
}
.dy-note:focus-visible {
  outline: 2px solid var(--color-interactive-strong);
  outline-offset: 1px;
}
.rx-row:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 999px;
}
/* 自绘滑杆（色相条 / 波轮）本来就是键盘可操作的，给一个明确的内圈 */
.pick__bar:focus-visible,
.hwheel__groove:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   3. 触控热区：视觉尺寸不动，热区补到 44px
   --------------------------------------------------------------------------
   小圆钮（返回键、天气、翻页、色卡）在 360–440pt 的屏上只有 29–38px。
   用居中的伪元素把可点区域撑到 44px —— 不改布局、不改观感，也不改变
   相邻元素的间距（间距够时不会互相吃掉）。
   -------------------------------------------------------------------------- */
/* 只给「本来没有定位」的元素补 position:relative；
   已经是 absolute 的（返回键、翻页钮、回到底部）保持原位 —— 它们的伪元素
   天然以自己为参照，再加 relative 会把版式打乱。 */
.th-back,
.sp-back,
.xp-back,
.ab-back,
.dy-back,
.dy-w,
.th-echo__retry,
.tag__x,
.sp-sw:not(.sp-sw--custom) {
  position: relative;
}
.th-back::after,
.sp-back::after,
.xp-back::after,
.ab-back::after,
.rx-back::after,
.rl-sky-back::after,
.dy-back::after,
.th-echo__retry::after,
.to-bottom::after,
.tag__x::after,
.sp-sw:not(.sp-sw--custom)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, var(--tap-min));
  height: max(100%, var(--tap-min));
  transform: translate(-50%, -50%);
  border-radius: 50%;
  /* 透明但不能穿透：热区需要真实接住点击 */
  background: transparent;
}
/* 天气格与翻页钮本来就在网格里：热区不越过自己的格子 */
.dy-w::after {
  width: 100%;
  height: 100%;
  border-radius: 16%;
}
.dy-turn::after {
  width: 100%;
  height: 100%;
}

/* 列表行 / 快捷回复：直接把行高提到 44，比伪元素更稳（滚动区里不会串行） */
.topic {
  height: auto;
  min-height: var(--tap-min);
  padding: 0.5rem 0.3rem;
  font-size: var(--fs-body);
}
.topic span {
  line-height: 1.35;
}
.topiclist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero__reply {
  height: auto;
  min-height: var(--tap-min);
  padding: 0.5rem 1rem;
  font-size: clamp(12.5px, 0.68rem, 14px);
}
.retry-btn,
.stop-btn,
.th-echo__retry {
  min-height: 36px;
  padding: 0.55rem 1rem;
}

/* --------------------------------------------------------------------------
   4. 顶栏 / 抽屉 / 底栏
   -------------------------------------------------------------------------- */
/* 横屏刘海：左右让出安全区。竖屏时 env() 为 0，尺寸不变。 */
.dock {
  padding-left: max(1.8rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.8rem, env(safe-area-inset-right, 0px));
}
.th-head,
.sp-head,
.xp-head,
.rl-head,
.ab-head {
  padding-left: max(1.8rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.8rem, env(safe-area-inset-right, 0px));
}
.iconbtn--menu { left: max(0.445rem, env(safe-area-inset-left, 0px)); }

/* 液态玻璃垫层（2026-10-31）：按钮 PNG 里白圆是烤死的底色，玻璃不能挂
   整个 85pt 方形上 —— 会变成一张大方玻璃片托着小圆。所以挂在这个
   42pt 圆子的 span 上（= 白圆的位置，85pt 的一半、几何居中）。
   JS 建玻璃时才创建这个 span，不支持 WebGL 的环境里它根本不存在，
   按钮完全回退到原来的 PNG 白圆。
   span 本身永远不给底色：pending / fallback 状态下它就是透明的，
   白圆由 img 提供 —— 「降级 = 回到改之前」。 */
.iconbtn__glass {
  position: absolute;
  left: 25%;
  top: 25%;
  width: 50%;                                                /* 42pt 圆 */
  height: 50%;
  border-radius: 50%;
  pointer-events: none;                                      /* 点击仍归按钮自己 */
  z-index: 0;
}

.iconbtn img {
  position: relative;
  z-index: 1;                                                /* 墨线永远压在玻璃垫层上面 */
  width: 100%;
  height: 100%;
}

/* 顶栏标题：单行、省略号、与左侧 85pt 圆钮同一基线 */
.topbar__title {
  font-size: clamp(15px, 0.85rem, 18px);
  font-weight: 600;
  letter-spacing: 0.005em;
}

/* 抽屉：标题层级与行距重新排一遍，只强调「留白」与「新话题」两级 */
.topics__label {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}
.topics__empty,
.topiclist__empty {
  font-size: var(--fs-note);
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.scrim {
  background: var(--scrim);
}

/* 底栏：chip 的文字有下限；输入框提示色按纸面重新校过（5.2:1） */
.chip {
  height: auto;
  min-height: var(--tap-min);
  /* 中文标签比英文短，字号不必为了并排压到 10px：
     12–13px 的下限既保住可读性，三个入口在任何宽度下也都排得下。 */
  font-size: clamp(12px, 0.64rem, 13.4px);
  font-weight: 500;
  gap: 0.36rem;
}
.chip__ico {
  height: 0.9rem;
}
.chip__ico--release {
  height: 0.94rem;
}
/* 窄屏：左右边距从 36pt 收到 27pt，把宽度让给三个入口的文字 */
@media (max-width: 379px) {
  .dock {
    padding-left: max(1.35rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.35rem, env(safe-area-inset-right, 0px));
  }
}
.askbar__input {
  font-size: var(--fs-input);
  color: var(--color-text-primary);
}
.askbar__input::placeholder {
  color: var(--color-text-tertiary);
}
.dock[data-liquid-glass="webgl"].is-glass-ready .askbar__input::placeholder {
  color: #55534E;
}
/* 玻璃不可用 / 减少透明度：回到实心暖白，不是「透明了但没玻璃」 */
.dock[data-liquid-glass="fallback"] .chip,
.dock[data-liquid-glass="fallback"] .askbar {
  background: var(--chip-bg);
  box-shadow: 0 0.05rem 0.25rem rgba(40, 45, 50, 0.08);
}

/* --------------------------------------------------------------------------
   5. 首页
   -------------------------------------------------------------------------- */
.hero__greet {
  /* 15rem → 16.5rem：去掉知序形象后，问候语是首页唯一的大字。
     宽一点，中文少一次尴尬的断行（「过 / 得」这种）。 */
  max-width: 16.5rem;
  font-size: var(--fs-hero);
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.hero__greet:focus-visible {
  outline-offset: 6px;
  border-radius: 0.4rem;
}
.hero__replies {
  gap: 0.5rem;
}
.hero__reply {
  color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   6. 知序 · 对话
   --------------------------------------------------------------------------
   核心改动只有一条：让「读」这件事更舒服。
     · 正文 0.9rem（440pt 下 18px）/ 1.75 行高，比原来 +2px；
     · 用户气泡里的字改回左对齐（多行时不再右对齐）；
     · 操作栏、停止、重发、危机卡片的命中区与状态补全。
   -------------------------------------------------------------------------- */
.msg--zhixu {
  font-size: var(--fs-reading);
  line-height: 1.75;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.002em;
}
.msg--user {
  margin-bottom: 1.2rem;
}
.msg--user .bubble {
  font-size: var(--fs-body);
  line-height: 1.65;
  text-align: start;
  padding: 0.72rem 1.05rem;
  border-radius: 1.1rem;
  color: var(--color-text-primary);
}
.msg--sys {
  font-size: var(--fs-note);
  color: var(--color-text-secondary);
}
.msg--zhixu:empty::before,
.msg--zhixu:empty::after {
  background: #E6E7E2;
}

/* 反馈栏：视觉更轻，命中区已经是 44+。
   2026-10-31 再收一档：图标改小（0.72rem，与回复文字同数量级，
   对齐行业惯例的轻量行内操作），栏不再上提（负 margin 改 0.05rem），
   视觉重心落回正文底部。热区不变：伪元素 inset -0.4rem 后仍是
   约 1.6rem + 0.8rem = 2.4rem ≈ 44px（手机 rem）。 */
.fb {
  gap: 0.1rem;
  margin: 0.05rem 0 1.05rem;
}
.fb__btn {
  width: 2rem;
  height: 2rem;
  color: var(--color-text-tertiary);
}
.fb:not(.fb--th) .fb__btn {
  width: 1.6rem;
  height: 1.6rem;
}
.fb:not(.fb--th) .fb__btn .ic {
  font-size: 0.72rem;
}
.fb:not(.fb--th) .fb__btn.is-on {
  color: var(--color-text-primary);
  background: var(--color-surface-secondary);
}
.fb--th .fb__btn {
  width: 2rem;
  height: 2rem;
  background: var(--color-surface-secondary);
}
.fb--th .fb__btn.is-on {
  background: var(--color-surface-raised);
}

/* 失败与重试：这是「状态」，不是警告。深一点的字、一个清楚的按钮。 */
.msg--failed {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  border-radius: var(--r-card);
}
.msg--failed .msg__detail {
  font-size: var(--fs-note);
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.retry-btn {
  background: var(--color-surface-raised);
  color: var(--color-interactive-strong);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  font-size: var(--fs-caption);
  font-weight: 600;
}
.stop-btn {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  font-size: var(--fs-caption);
}
.to-bottom {
  width: 44px;
  height: 44px;
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-2);
}

/* 危机兜底卡片：暖棕是「有人在」的语气，不是报警色 */
.crisis {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  border-left: 0.15rem solid var(--color-brand);
  border-radius: var(--r-card);
}
.crisis__title {
  font-size: var(--fs-body);
}
.crisis__text,
.crisis__tail {
  font-size: var(--fs-note);
  line-height: 1.65;
  color: var(--color-text-secondary);
}
.crisis__item {
  min-height: var(--tap-min);
  align-items: center;
  border-radius: var(--r-control);
  background: var(--color-surface-secondary);
}
.crisis__item span {
  font-size: var(--fs-caption);
}

/* 记忆确认卡、推荐卡：统一到纸面 + 细描边，不再一层投影 */
.memask,
.rec {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.rec__txt strong {
  font-size: var(--fs-body);
}
.rec__txt em {
  font-size: var(--fs-caption);
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   7. 情绪树洞
   --------------------------------------------------------------------------
   材质减法：这一页的底是纸，控件再叠 backdrop-filter 只会在低端机上掉帧，
   视觉上也看不出差异（背景是平的）。改成实心暖白 + 一条细描边。
   -------------------------------------------------------------------------- */
.th-back,
.sp-back,
.xp-back,
.ab-back,
.rx-back,
.rl-sky-back {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--color-border-subtle),
              0 0.05rem 0.3rem rgba(60, 50, 35, 0.06);
}
.th-head__label,
.sp-head__label,
.xp-head__label,
.rl-head__label {
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}
.th-paper__text {
  font-size: clamp(15px, 0.85rem, 18px);
  line-height: 1.72;
}
.th-count {
  font-size: var(--fs-caption);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.th-ask {
  font-size: var(--fs-note);
  color: var(--color-text-secondary);
}
.th-emotions {
  gap: 0.5rem;
}
.th-emo {
  height: 44px;
  background: var(--color-surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  font-size: var(--fs-caption);
  color: var(--color-text-primary);
}
.th-emo__name {
  font-size: var(--fs-caption);
}
.th-emo.is-on {
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  box-shadow: none;
}
/* 「猜到的」情绪：用品牌棕的细圈，不靠颜色深浅表达 */
.th-emo.is-guess {
  box-shadow: inset 0 0 0 1.5px var(--color-brand);
}
.th-emo.is-guess.is-on {
  box-shadow: inset 0 0 0 1.5px var(--color-brand);
}
.th-submit {
  height: auto;
  min-height: 3rem;
  font-size: var(--fs-body);
}
.th-submit:disabled {
  background: var(--color-surface-secondary);
  color: var(--color-text-tertiary);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.th-list-title {
  font-size: var(--fs-body);
  letter-spacing: 0.005em;
}
.th-entry__meta {
  font-size: var(--fs-caption);
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.th-entry__tag {
  font-size: var(--fs-caption);
  color: var(--color-text-secondary);
  background: var(--color-surface-secondary);
}
.th-entry__text {
  font-size: var(--fs-reading);
  line-height: 1.72;
}
.th-echo {
  background: var(--color-surface-secondary);
  border-radius: var(--r-control);
}
.th-echo__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.th-echo__text {
  font-size: var(--fs-body);
  color: var(--color-text-primary);
}
.th-echo__retry {
  font-size: var(--fs-caption);
  background: rgba(0, 0, 0, 0.06);
}
.th-echo--failed .th-echo__text {
  color: var(--color-text-secondary);
}
.th-empty {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   8. 心情日记
   --------------------------------------------------------------------------
   原生壳里进日记会请求横屏，所以设计稿是横屏版式。但下面这些场景拿不到旋转：
     · 浏览器 / 桌面调试（本次验收就在浏览器里跑）
     · 分屏、自由窗口、平板，部分机型会直接忽略 orientation lock
     · 系统关掉自动旋转且 Web API 被拒绝
   旧实现在这些场景里会把右侧卡片挤成 116px 宽，正文一个字一行 —— 这次补上
   竖屏版式：书在上、今天的心情在下，整页可滚动。
   -------------------------------------------------------------------------- */
/* 横屏（设计稿版式）：只把几处像素过小的控件补到可用尺寸，不动版式 */
@media (orientation: landscape) {
  .dy-card {
    border-radius: var(--r-panel);
  }
  .dy-w {
    border-radius: 14px;
  }
  .dy-preview {
    font-size: var(--fs-caption);
  }
  .dy-note {
    font-size: clamp(12px, 0.7rem, 16px);
  }
  .dy-save {
    height: auto;
    min-height: var(--tap-min);
    padding: 0.35rem 1.05rem;
    font-size: var(--fs-caption);
  }
  .dy-head__label {
    font-size: clamp(17px, 1.1rem, 24px);
  }
}

/* --------------------------------------------------------------------------
   9. 释放空间
   --------------------------------------------------------------------------
   内容层保持安静，只做三件事：泡泡里的字更清楚、输入框的提示与焦点可见、
   小圆钮的命中区补齐。泡泡机、素材、发射规则、动效节奏都不动。
   -------------------------------------------------------------------------- */
.rx-decor__text,
.rx-bubble__text,
.rx-core__text {
  color: #2A3444;
  text-shadow: 0 0.05rem 0.2rem rgba(255, 255, 255, 0.78);
}
.rx-bubble__text,
.rx-decor__text {
  font-weight: 500;
  letter-spacing: 0.002em;
}
.rx-input {
  font-size: clamp(16px, 0.88rem, 18px);
  color: var(--color-text-primary);
}
.rx-input::placeholder {
  color: #5B6472;      /* 浅蓝面板上 ≈4.6:1；原来的 34% 透明只有 1.9:1 */
}
.rx-send:disabled {
  opacity: 0.5;
}
.rx-send {
  color: #242F42;
}
/* 泡泡本身是可点的控件（点破）：键盘焦点环给到整颗泡泡 */
.rx-bubble:focus-visible,
.rx-decor__bubble[role="button"]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   10. 设置 / 个性化体验 / 关于
   --------------------------------------------------------------------------
   内容表面回到实色纸面。设置页原来那条 backdrop-filter 覆盖了整块「背景颜色」
   分组：它既贵（大面积实时模糊），又让色卡背后的内容透上来显脏。
   -------------------------------------------------------------------------- */
.sp-title,
.xp-title {
  font-size: var(--fs-page-title);
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.sp-sec {
  margin-top: 2.15rem;
}
/* 分区眉标用品牌蓝：对比度 6.6，是「强调」不是「装饰」 */
.sp-sec__title {
  margin: 0 0 0.8rem 0.3rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.045em;
  color: var(--color-brand);
}
.sp-note {
  margin: 0.7rem 0.3rem 0;
  font-size: var(--fs-note);
  line-height: 1.65;
  color: var(--color-text-secondary);
}
.sp-group {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.sp-group--glass {
  background: var(--color-surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.sp-item {
  font-size: var(--fs-label);
  min-height: 3rem;
}
.sp-item__ic {
  color: var(--color-text-secondary);
}
.sp-item__label {
  letter-spacing: 0.002em;
}
.sp-item__chev {
  color: var(--color-text-tertiary);
}
.sp-item__text {
  font-size: var(--fs-note);
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.sp-input {
  background: var(--color-surface-secondary);
  border-radius: var(--r-field);
  font-size: var(--fs-body);
}
.sp-group .sp-input {
  background: transparent;
}
.sp-group .tagadd .sp-input {
  /* 同心圆角：外 1rem − 内边距 0.42rem */
  border-radius: calc(var(--r-card) - 0.42rem);
  background: var(--color-surface-secondary);
}
.sp-group .tagadd__go {
  border-radius: calc(var(--r-card) - 0.42rem);
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
}
/* 输入为空时「加上」是禁用的：禁用态退回浅底深字，
   不能再保留主操作的黑底 —— 否则会看起来可点、字却看不见。 */
.sp-group .tagadd__go:disabled {
  background: var(--color-surface-secondary);
  color: var(--color-text-secondary);
}
.tag {
  min-height: 2.4rem;
  font-size: var(--fs-body);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.tag__x {
  color: var(--color-text-tertiary);
  font-size: 1rem;
}
.sp-sw.is-on {
  box-shadow: 0 0 0 2px var(--color-surface-raised),
              0 0 0 4px var(--color-text-primary),
              0 0.05rem 0.3rem rgba(0, 0, 0, 0.12);
}
.pick__bar {
  box-shadow: inset 0 0 0 1px var(--color-border-subtle),
              0 0.05rem 0.3rem rgba(0, 0, 0, 0.08);
}
.hwheel__tick {
  background: rgba(11, 11, 10, 0.2);
}
.hwheel__tick--major {
  background: rgba(11, 11, 10, 0.38);
}
.hwheel__groove {
  background: linear-gradient(to bottom,
    rgba(11, 11, 10, 0.07) 0%,
    rgba(11, 11, 10, 0.03) 42%,
    rgba(255, 255, 255, 0.55) 100%);
}
.sp-note--link {
  margin-top: 0.5rem;
}
.sp-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--color-interactive-strong);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.sp-group .sp-danger,
.sp-danger,
.sp-confirm {
  min-height: var(--tap-min);
}
.sp-danger {
  color: var(--color-danger);
}
.sp-ask {
  font-size: var(--fs-note);
  color: var(--color-text-secondary);
}
.sp-item--check .sp-item__label {
  font-size: var(--fs-label);
}
.xp-desc {
  font-size: var(--fs-note);
  line-height: 1.45;
  color: var(--color-text-secondary);
}
.xp-lead {
  font-size: var(--fs-note);
  line-height: 1.7;
  color: var(--color-text-secondary);
}
.sp-check {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--color-border-strong);
}
.sp-group .mem {
  padding: 0.65rem 0;
}
.mem {
  background: transparent;
  box-shadow: none;
}
.sp-item--link:active,
.sp-item--check:active {
  background: var(--color-surface-secondary);
}

/* 关于：顶部渐隐跟着纸面走（原来是一层白，会在纸面底部留下一条白边） */
.ab::before {
  background: linear-gradient(
    to bottom,
    var(--color-paper) 0%,
    rgba(var(--color-paper-rgb), 0.9) 38%,
    rgba(var(--color-paper-rgb), 0) 100%
  );
}
.ab-ver__val {
  font-size: var(--fs-body);
}
.ab-back {
  /* 已在上面的返回键统一规则里处理材质 */
}

/* --------------------------------------------------------------------------
   11. 浮层：提示框 / 通知条 / Toast / 长按菜单
   -------------------------------------------------------------------------- */
.dlg__scrim {
  background: rgba(24, 26, 33, 0.26);
}
.dlg__card {
  border-radius: var(--r-panel);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-sheet);
  padding: 1.5rem 1.3rem 1.25rem;
}
.dlg__title {
  font-size: clamp(17px, 1rem, 22px);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.002em;
}
.dlg__text {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-height: min(46vh, 18rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* 长文案改成左对齐：一段一段读的东西，居中反而更难跟行 */
.dlg.is-long .dlg__title,
.dlg.is-long .dlg__text {
  text-align: left;
}
.dlg__btn {
  height: auto;
  min-height: 2.85rem;
  font-size: var(--fs-body);
  font-weight: 600;
}
.dlg__btn--primary {
  background: var(--color-interactive-strong);   /* 白字 5.7:1（原 #207BFF 只有 3.9:1） */
  color: #FFFFFF;
}
.dlg__btn--primary:active {
  background: var(--color-interactive-pressed);
}
.dlg__btn--danger {
  background: var(--color-danger);               /* 白字 6.6:1（原 #E5484D 为 3.3:1） */
  color: #FFFFFF;
}
.dlg__btn--danger:active {
  background: #9A1E15;
}
.dlg__btn--ghost {
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
}
.dlg__btn--ghost:active {
  background: #E7E8E3;
}

.toast {
  background: rgba(11, 11, 10, 0.88);
  font-size: var(--fs-caption);
  line-height: 1.45;
  max-width: min(82%, 22rem);
  padding: 0.55rem 0.9rem;
}
.note-banner {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  border-left: 0.15rem solid var(--color-interactive);
  border-radius: var(--r-field);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
}
.note-banner__title {
  font-size: var(--fs-body);
}
.note-banner__text {
  font-size: var(--fs-note);
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.note-banner__x {
  color: var(--color-text-secondary);
  min-width: 36px;
  min-height: 36px;
  font-size: 1.1rem;
}
.note-card {
  background: var(--color-surface-raised);
  border-radius: var(--r-field);
  box-shadow: 0 18px 40px -18px rgba(20, 18, 10, 0.28),
              inset 0 0 0 1px var(--color-border-subtle);
}
.note-card__title {
  font-size: var(--fs-body);
}
.note-card__text {
  font-size: var(--fs-note);
  color: var(--color-text-secondary);
}
.msg-menu {
  background: var(--color-surface-raised);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-sheet);
}
.msg-menu__item {
  min-height: 44px;
  font-size: var(--fs-body);
}
.msg-menu__item .ic {
  color: var(--color-text-secondary);
}
.msg-menu__item--danger {
  color: var(--color-danger);
}

/* 断网条：状态提示，不是错误警告 */
.offline {
  font-size: var(--fs-note);
}

/* --------------------------------------------------------------------------
   12. 新用户引导
   -------------------------------------------------------------------------- */
.onb__title {
  font-size: var(--fs-title);
  line-height: 1.45;
}
.ob-title--soft {
  font-size: clamp(18px, 1.16rem, 26px);
}
.ob-hello {
  font-size: var(--fs-page-title);
  line-height: 1.45;
}
.onb__sub {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--color-text-secondary);
}
.ob-said {
  font-size: var(--fs-note);
  color: var(--color-text-secondary);
}
.onb__go {
  height: auto;
  min-height: 3rem;
  font-size: var(--fs-body);
  font-weight: 500;
}
.onb__go:disabled {
  background: var(--color-surface-secondary);
  color: var(--color-text-tertiary);
}
.ob-go--quiet {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.ob-th__paper .th-paper__text {
  /* 引导里的纸条是缩小的演示（纸宽只有正文页的一半），但仍是「可读的正文」：
     393pt 屏上 0.64rem 只有 11.4px，这里抬到 12.5px 的下限。 */
  font-size: clamp(12.5px, 0.72rem, 15px);
}
/* 引导第 4 步的泡泡：文字原先是 50% 黑 + 11.8px，白泡泡上只有 ≈3.9:1。
   第一印象页更要读得清：加深到墨色、字号给一个 11.5px 下限。 */
.ob-sky .bubble {
  color: #2C3648;
  font-weight: 500;
  font-size: max(11.5px, var(--fs, 0.6rem));
}
/* 顶栏菜单按钮的焦点环：元素框是 85pt 的画布，可见的白圆只有 42pt。
   让环向内收到圆钮边上，别画成一个套着透明画布的大方框。 */
.iconbtn:focus-visible {
  border-radius: 50%;
  outline-offset: -1.06rem;
}
.ob-chat .msg--zhixu,
.ob-chat .msg--user .bubble {
  font-size: var(--fs-body);
}
.ob-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-height: 680px) {
  .ob-body {
    justify-content: flex-start;
    padding-top: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   13. 适配与辅助功能
   -------------------------------------------------------------------------- */
/* 对话区左右也吃安全区（横屏刘海） */
.stream {
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
}
/* 顶部渐隐跟着纸面走 */
.chat__progressive-blur::after {
  background: linear-gradient(
    to bottom,
    var(--color-paper) 0%,
    rgba(var(--color-paper-rgb), 0.92) 24%,
    rgba(var(--color-paper-rgb), 0.66) 55%,
    rgba(var(--color-paper-rgb), 0.26) 82%,
    rgba(var(--color-paper-rgb), 0) 100%
  );
}
/* 极矮屏：保住首页的基本呼吸，不靠压缩字号硬塞 */
@media (max-height: 620px) {
  .hero__greet { font-size: clamp(20px, 1.25rem, 26px); letter-spacing: 0; }
  .hero__replies { gap: 0.35rem; }
}
/* 减少动态效果：class 开关（JS）+ 媒体查询双保险 */
.app.is-motion-reduced .rx-bubble.is-idle,
.app.is-motion-reduced .rx-decor__drift,
.app.is-motion-reduced .rx-core.is-breathing .rx-core__inner,
.app.is-motion-reduced .dy-w.is-on,
.app.is-motion-reduced .diary.is-saved,
.app.is-motion-reduced .ob-chat .ob-msg {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .rx-bubble.is-idle,
  .rx-decor__drift,
  .rx-core.is-breathing .rx-core__inner {
    animation: none !important;
  }
}
/* 减少透明度：玻璃与所有实时模糊退成实色（苹果的无障碍设置，Web 端尽力对齐） */
@media (prefers-reduced-transparency: reduce) {
  .chip,
  .askbar {
    background: var(--chip-bg);
    box-shadow: 0 0.05rem 0.25rem rgba(40, 45, 50, 0.08);
  }
  .dock[data-liquid-glass="webgl"] .chip,
  .dock[data-liquid-glass="webgl"] .askbar,
  .to-bottom[data-liquid-glass="webgl"] {
    background: var(--chip-bg);
    box-shadow: var(--shadow-1);
  }
  .dlg__scrim,
  .note-card,
  .xp::before,
  .xp::after,
  .sp::before,
  .sp::after,
  .chat__progressive-blur,
  .dy-turn {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .dlg__scrim {
    background: rgba(24, 26, 33, 0.45);
  }
  .chat__progressive-blur {
    display: none;
  }
}
/* 提高对比度：加深次级文字与描边，并给控件一条明确的边界 */
@media (prefers-contrast: more) {
  :root {
    --color-text-secondary: #3B3935;
    --color-text-tertiary: #45433E;
    --color-border-subtle: rgba(11, 11, 10, 0.22);
    --color-border-strong: rgba(11, 11, 10, 0.4);
  }
  .chip,
  .askbar,
  .sp-group,
  .th-emo,
  .note-card,
  .dlg__card {
    box-shadow: inset 0 0 0 1px var(--color-border-strong);
  }
  .dlg__btn--primary {
    background: var(--color-interactive-pressed);
  }
}

/* --------------------------------------------------------------------------
   14. 纸面 / 暖色页面的对比度收尾
   --------------------------------------------------------------------------
   树洞的纸和日记的卡片不是纯白，原来的占位文字与「空本子」文案按白底挑的
   透明度，落到米色纸上只有 1.8–2.1:1。这一组按实际底色重新算过（括号内为
   对比度），只改颜色，不改字号与间距。
   -------------------------------------------------------------------------- */
.th-paper__text::placeholder {
  color: #6E6555;                        /* 米色纸面 4.5:1 */
}
/* 树洞的「Done writing」是这个页面的唯一主操作：改成宣纸墨色实心键，
   和首页「发起新话题」、引导页主按钮同一语义；禁用态保持可读。 */
.th-write .th-submit {
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  font-weight: 500;
  box-shadow: 0 0.12rem 0.4rem rgba(30, 24, 16, 0.18);
}
.th-write .th-submit:disabled {
  background: #F1E7D7;
  color: #6F6555;                        /* 4.97:1 —— 禁用但要读得清 */
  box-shadow: none;
}
.th-paper__text {
  font-size: clamp(15px, 0.88rem, 18px);
}
.dy-empty {
  color: #6B6153;                        /* 书页上 ≈4.9:1（原 0.4 透明度 ≈2.4:1） */
}
.dy-preview {
  color: #6B6153;                        /* 米色卡片上 5.3:1 */
}
.dy-note::placeholder {
  color: #6E5F47;                        /* 5.2:1（原 0.55 透明度只有 1.8:1） */
}
.dy-save:disabled {
  opacity: 1;
  background: rgba(63, 56, 46, 0.10);
  color: #6B6153;
}
/* 复制按钮：内联 SVG 图标 / 44px 热区（伪元素在基础规则里已给）。
   尺寸用 0.72rem —— 与赞 / 踩字形（.ic 0.72rem）同大，三个图标才齐；
   之前写死 15px，rem 变大的宽屏上它会比旁边两颗小一整圈。 */
.fb__btn--copy svg {
  width: 0.72rem;
  height: 0.72rem;
  display: block;
}
.fb__btn--copy {
  margin-right: 0.15rem;
}

/* --------------------------------------------------------------------------
   15. 触控热区补齐（第二批）
   --------------------------------------------------------------------------
   这些控件只在特定状态出现（失败重发、停止、搜索取消、话题确认、通知关闭、
   记忆删除、时段/温度滑杆），前面按页面走查时没被覆盖到。同样是「视觉不变、
   热区 44」的原则：能加高度的加高度，圆形小钮用伪元素扩。
   -------------------------------------------------------------------------- */
.retry-btn,
.stop-btn,
.topic__btn,
.note-banner__x,
.note-banner__act,
.tagadd__go {
  min-height: var(--tap-min);
}
.topic__btn {
  padding: 0 0.6rem;
  font-size: var(--fs-caption);
}
.note-banner__act {
  display: inline-flex;
  align-items: center;
}
.note-banner__x {
  min-width: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mem__del {
  position: relative;
}
.mem__del::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tap-min);
  height: var(--tap-min);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
/* 横向滑杆（色相 / 温度）：手指要拖得住的不是 30px 高的凹槽，是 44px 的带 */
.hwheel__groove::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  bottom: -0.45rem;
  border-radius: var(--r-pill);
}
/* 翻页钮：竖屏从 40px 补到 44px（横屏本来就是 44+） */
.dy-turn {
  width: clamp(44px, 4.6vw, 58px);
  height: clamp(44px, 4.6vw, 58px);
}


/* --------------------------------------------------------------------------
   16. 滚动边缘：设置 / 个性化体验
   --------------------------------------------------------------------------
   这两页的滚动体是 absolute inset:0，内容会从固定的返回头底下穿过去。
   原来只靠两条 backdrop-filter 压（模糊但不遮色），滚到底时正文会压在
   「Settings」标题上。这里在返回头这一层再铺一条纸面渐变：
   顶部完全不透明，到头部下沿再化开 —— 内容在标题区域「消失」而不是叠上去。
   -------------------------------------------------------------------------- */
.sp-head::before,
.xp-head::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * (env(safe-area-inset-top, 0px) + 1.2rem));
  bottom: -1.15rem;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--color-paper) 0%,
    var(--color-paper) 72%,
    rgba(var(--color-paper-rgb), 0.9) 88%,
    rgba(var(--color-paper-rgb), 0) 100%
  );
}
/* 深色/彩色背景页面（关于页自带渐变，个性化体验用的是纸面） */
.xp-head::before {
  background: linear-gradient(
    to bottom,
    var(--color-paper) 0%,
    rgba(var(--color-paper-rgb), 0.94) 62%,
    rgba(var(--color-paper-rgb), 0) 100%
  );
}

/* ==========================================================================
   留白 3.0 · 蓝色主题（统一收口）
   --------------------------------------------------------------------------
   主色由 :root 的 --color-interactive / --color-interactive-strong /
   --color-brand / --color-focus / --accent / --bubble / --bg 负责；
   设置里的「背景颜色」可选雾蓝 / 晚霞 / 薄荷 / 紫藤，或自己调色相。
   旧规则里写死的蓝不再需要逐条覆盖；素材 PNG 一张都没动。
   ========================================================================== */
:root {
  --color-paper-rgb: 245, 246, 243;
}

/* 首页：知序形象移除后，问候语成为第一眼；去掉为角色图留的上间距 */
.hero__greet {
  margin-top: 0;
}

/* ==========================================================================
   心情日记 · 竖屏（3.0 原始版式）
   --------------------------------------------------------------------------
   B 阶段的状态：这就是当时的竖屏日记版式。手机在原生侧被锁成竖屏，
   进入日记时由 MainActivity 的 ScreenBridge 请求横屏。
   ========================================================================== */
@media (orientation: portrait) {
  .diary {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .dy-stage {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: calc(env(safe-area-inset-top, 0px) + 1.35rem)
             1.5rem
             calc(env(safe-area-inset-bottom, 0px) + 2rem);
    gap: 0;
  }
  .dy-left {
    height: auto;
    width: 100%;
  }
  .dy-head {
    position: static;
    height: auto;
    padding: 0 0 0.35rem;
    gap: 0.6rem;
  }
  .dy-back {
    width: 40px;
    height: 40px;
  }
  .dy-back .ic {
    font-size: 18px;
  }
  .dy-head__label {
    font-size: clamp(17px, 1.15rem, 22px);
  }
  .dy-book {
    position: relative;
    inset: auto;
    margin-top: 0.55rem;
    height: auto;
  }
  .dy-book__fit {
    width: 100%;
    height: auto;
    aspect-ratio: 2240 / 1252;
  }
  .dy-book__text {
    font-size: clamp(10px, 2.15cqw, 14px);
  }
  .dy-turn {
    width: 40px;
    height: 40px;
  }
  .dy-turn--prev { left: -0.35rem; }
  .dy-turn--next { right: -0.35rem; }
  .dy-pageno {
    position: static;
    margin-top: 0.35rem;
  }
  .dy-card {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    margin-top: 1.25rem;
    padding: 1.05rem 1rem 1rem;
    border-radius: var(--r-panel);
  }
  .dy-weathers {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.42rem;
  }
  .dy-preview {
    margin-top: 0.5rem;
    font-size: var(--fs-caption);
  }
  .dy-note {
    flex: 0 0 auto;
    min-height: 7.2rem;
    margin-top: 0.7rem;
    padding: 0.8rem 0.85rem;
    border-radius: 1rem;
    font-size: var(--fs-body);
  }
  .dy-save {
    position: static;
    width: 100%;
    height: auto;
    min-height: var(--tap-min);
    margin-top: 0.9rem;
    font-size: var(--fs-body);
  }
}

/* 320–379pt 的窄屏：6 列天气会挤成 27px。竖屏下退回 3×2，热区才够。 */
@media (orientation: portrait) and (max-width: 379px) {
  .dy-weathers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (orientation: portrait) {
  /* 竖屏时左侧栏不要抢剩余高度：否则书和卡片之间会多出一大片空白 */
  .dy-left {
    flex: 0 0 auto;
  }
  .dy-book__text {
    font-size: clamp(11.5px, 2.5cqw, 16px);
  }
}


/* ==========================================================================
   Apple HIG · 中号 Typography
   --------------------------------------------------------------------------
   按 HIG「中号」表：大标题 33/40、标题1 27/33、标题2 21/26、标题3 19/24、
   Headline 16/21 Semibold、Body 16/21、Callout 15/20、Subhead 14/19、
   Footnote 12/16、Caption 11/13。字号直接用 px；强调粗细用 600/700。
   系统字体（PingFang / HarmonyOS Sans / Noto）替换原来的标题品牌字；
   日记本内页、树洞纸面这类「实体纸面」的书写字体保留。
   ========================================================================== */
:root {
  --brand: var(--font-body);
  --fs-large-title: 33px;
  --lh-large-title: 40px;
  --fs-title1: 27px;
  --lh-title1: 33px;
  --fs-title2: 21px;
  --lh-title2: 26px;
  --fs-title3: 19px;
  --lh-title3: 24px;
  --fs-headline: 16px;
  --lh-headline: 21px;
  --fs-body-hig: 16px;
  --lh-body-hig: 21px;
  --fs-callout: 15px;
  --lh-callout: 20px;
  --fs-subhead: 14px;
  --lh-subhead: 19px;
  --fs-footnote: 12px;
  --lh-footnote: 16px;
  --fs-caption1: 11px;
  --lh-caption1: 13px;
  --fs-caption2: 11px;
  --lh-caption2: 13px;

  /* 兼容旧 token：组件不用逐个改类名就能拿到 HIG 字号 */
  --fs-page-title: 33px;
  --fs-hero: 33px;
  --fs-title: 27px;
  --fs-reading: 16px;
  --fs-body: 16px;
  --fs-label: 16px;
  --fs-input: 16px;
  --fs-note: 12px;
  --fs-eyebrow: 12px;
  --fs-caption: 11px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 21px;
}
button,
input,
textarea,
select {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 21px;
}
strong,
b {
  font-weight: 600;
}

/* 大标题 · Large Title */
.hero__greet,
.sp-title,
.th-title,
.rl-title,
.rx-title,
.ab-title,
.dy-head__label,
.ob-hello {
  font-family: var(--brand);
  font-size: 33px;
  line-height: 40px;
  font-weight: 400;
  letter-spacing: 0;
}

/* 标题 1 · Title 1 */
.onb__title {
  font-family: var(--brand);
  font-size: 27px;
  line-height: 33px;
  font-weight: 400;
  letter-spacing: 0;
}

/* 标题 2 · Title 2 */
.dlg__title {
  font-family: var(--brand);
  font-size: 21px;
  line-height: 26px;
  font-weight: 400;
}

/* Headline · 顶栏标题 / 主按钮 / 分区强调 */
.topbar__title,
.onb__go,
.th-submit,
.dy-save,
.tagadd__go,
.settings,
.dlg__btn,
.note-banner__act {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 21px;
  font-weight: 600;
}

/* 顶栏标题的 line-height 不是字阶，是布局：这层 4.25rem 行框负责把单行标题
   和左侧 85pt 圆钮垂直居中（基础规则里就是这么排的）。上面的 Headline
   行高 21px 会把它盖掉，标题于是贴到顶栏最上沿 —— 只给标题这一处
   还原布局行高，Headline 的字阶对其它元素照常生效。 */
.topbar__title {
  line-height: 4.25rem;
}

/* Body · 正文 */
.sp-item,
.sp-item__label,
.sp-item__value,
.sp-item--check .sp-item__label,
.sp-link,
.sp-danger,
.sp-preview,
.topic,
.topic__title,
.rx-input,
.rx-bubble__text,
.dy-note,
.askbar,
.bubble,
.msg--user .bubble,
.msg--zhixu,
.onb__sub,
.ob-said,
.ob-chat,
.ob-chat .msg--user .bubble,
.dlg__body,
.dlg__text,
.dlg__p,
#dlgBody {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 21px;
  font-weight: 400;
}

/* Callout · 引导说明 / 次要按钮 */
.onb__sub,
.ob-said,
.toast {
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
}

/* Subhead · 首页快捷回应 / 快捷栏 / 搜索取消 */
.hero__reply,
.th-emo,
.chip,
.tag,
.topics__empty,
.topiclist__empty,
.chat__empty {
  font-size: 14px;
  line-height: 19px;
  font-weight: 400;
}
.hero__reply { font-size: 15px; line-height: 20px; }

/* Footnote · 分区眉标 / 说明 / 日期 */
.sp-sec__title,
.sp-note,
.topic__date,
.topic__group,
.note-banner,
.rl-sky-hint,
.rl-done,
.ob-note,
.ab-foot {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}
.sp-sec__title,
.note-banner__act {
  font-weight: 600;
}

/* Caption 1 · 页码 / 计数 / 时间 */
.dy-pageno,
.th-count,
.msg__time,
.msg__meta {
  font-size: 11px;
  line-height: 13px;
  font-weight: 400;
}

/* 设置页的分区眉标保持 Footnote 强调 */
.sp-sec__title { font-size: 12px; line-height: 16px; font-weight: 600; }

/* 让浏览器原生控件字号一致，避免 iOS 聚焦缩放 */
input,
textarea { font-size: 16px; }

/* ==========================================================================
   集控提示 2.0（2026-11-01）
   --------------------------------------------------------------------------
   旧版是一条蓝底通栏 + 一个圆点，通知条是普通白卡。现在统一成「留白」
   自己的玻璃卡：小圆角图标、eyebrow、正文、深色胶囊按钮；横幅浮在顶栏
   下方，通知条从顶部滑入并带一条 7 秒自动收起进度条。
   仍沿用旧 JS 的类名与显隐逻辑，只改外观。
   ========================================================================== */
.note-banner {
  position: absolute;
  z-index: 11;
  top: calc(env(safe-area-inset-top, 0px) + 8.15rem);
  left: 0;
  right: 0;
  width: calc(100% - 2.4rem);
  max-width: 22rem;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.85rem;
  border: 0;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 1.1rem 2.6rem -1rem rgba(28, 32, 44, 0.26),
              inset 0 1px 0 rgba(255, 255, 255, 0.95),
              inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  color: var(--color-text-primary);
  font-size: 0.78rem;
  line-height: 1.55;
  pointer-events: auto;
  transform-origin: top center;
  animation: noteBannerIn 0.45s var(--ease) both;
}
.note-banner[hidden] { display: none; }
.note-banner__ic,
.note-card__ic {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.58rem;
  background-color: var(--accent, #207BFF);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(0, 0, 0, 0.12));
  color: #FFFFFF;
  box-shadow: 0 0.35rem 0.9rem -0.28rem rgba(28, 32, 44, 0.38),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.note-banner__ic svg,
.note-card__ic svg { width: 0.95rem; height: 0.95rem; display: block; }
.note-banner__body { flex: 1 1 auto; min-width: 0; }
.note-banner__eyebrow,
.note-card__eyebrow {
  margin: 0 0 0.12rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.note-banner__title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary);
}
.note-banner__text {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-banner__act {
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: var(--color-text-primary);
  color: #FFFFFF;
  font-size: 0.66rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.note-banner__act::after {
  content: '→';
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0.8;
}
.note-banner__act:active { opacity: 0.82; }
.note-banner__x {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  min-width: 0;
  min-height: 0;
  margin: -0.08rem -0.12rem 0 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  line-height: 1;
}
.note-banner__x:active { background: rgba(0, 0, 0, 0.06); }

/* — 通知条：顶部玻璃卡 + 自动收起进度 — */
.note-stack {
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  width: min(92vw, 24rem);
  gap: 0.5rem;
}
.note-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.85rem 1rem;
  overflow: hidden;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 1.2rem 2.8rem -1rem rgba(20, 18, 10, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.95),
              inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  animation: noteCardIn 0.5s var(--ease) both;
  pointer-events: auto;
}
.note-card.is-out { animation: noteCardOut 0.32s var(--ease) both; }
.note-card__body { flex: 1 1 auto; min-width: 0; padding-right: 1.15rem; }
.note-card__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary);
}
.note-card__text {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-card__act {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  margin-top: 0.55rem;
  padding: 0.36rem 0.66rem;
  border-radius: 999px;
  background: var(--color-text-primary);
  color: #FFFFFF;
  font-size: 0.64rem;
  font-weight: 600;
  text-decoration: none;
}
.note-card__act::after {
  content: '→';
  font-size: 0.74rem;
  line-height: 1;
  opacity: 0.8;
}
.note-card__x {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-tertiary);
  font-size: 0.74rem;
  line-height: 1;
}
.note-card__x:active { background: rgba(0, 0, 0, 0.06); }
.note-card__timer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent, #207BFF);
  transform-origin: left;
  animation: noteTimer 7s linear forwards;
}

@keyframes noteBannerIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes noteCardIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes noteCardOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-10px) scale(0.98); }
}
@keyframes noteTimer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .note-banner,
  .note-card,
  .note-card.is-out,
  .note-card__timer { animation: none; }
  .note-card__timer { display: none; }
}

/* 布局验收：常驻话题列、方向提示、释放空间的全宽底色。 */
.app.has-wide-topics, .app.is-release { width: 100%; }
.app.has-wide-topics {
  --topics-width: clamp(225px, 25vw, 310px);
  --workspace-start: 0px;
}
.app.has-expanded-topics { --workspace-start: var(--topics-width); }
.app.has-wide-topics :is(.chat,.treehole,.diary,.release,.sp,.ab,.xp,.gl,.aurora) {
  inset-inline-start: var(--workspace-start);
  transition-property: inset-inline-start, transform, opacity, visibility;
  transition-duration: var(--dur-3), var(--push-dur), var(--dur-3), 0s;
  transition-delay: 0s; /* 不继承移动页退场时的延迟隐藏 */
}
.app.has-wide-topics .stage {
  margin-inline-start: var(--workspace-start);
  transition: margin-inline-start var(--dur-3) var(--ease);
}
.app.has-wide-topics .dock {
  left: calc(var(--workspace-start) / 2);
  width: calc(100% - var(--workspace-start));
  transition-property: left, width, transform, visibility;
  transition-duration: var(--dur-3), var(--dur-3), var(--push-dur), 0s;
}
.app.has-wide-topics .scrim, .app.has-wide-topics #menuBtn { display: none; }
.app.has-wide-topics .topics {
  width: var(--topics-width);
  border-radius: 0;
  border-inline-end: 1px solid rgba(26, 43, 68, .12);
  background: #f4f6fa;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: transform var(--dur-3) var(--ease);
}
.app.has-expanded-topics .topics { transform: translateX(0); }
.app.has-wide-topics .topics__toolbar {
  padding-block-start: calc(max(8px, env(safe-area-inset-top, 0px)) + 44px + 10px);
}
.wide-topics-toggle:not([hidden]) {
  position: absolute;
  inset-block-start: max(8px, env(safe-area-inset-top, 0px));
  inset-inline-start: max(8px, env(safe-area-inset-left, 0px));
  z-index: 32;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.84);
  color: #263248;
}
.wide-topics-toggle:hover { background: #e8edf8; }
.wide-topics-toggle:focus-visible, .orientation-card button:focus-visible {
  outline: 2px solid var(--color-interactive-strong, #3156a7);
  outline-offset: 2px;
}
.orientation-gate:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px))
           max(12px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  background: var(--bg);
}
.app.is-orientation-gated > :not(.orientation-gate),
.app.is-orientation-gated > :not(.orientation-gate) * { visibility: hidden !important; }
.orientation-card {
  width: min(100%, 400px);
  padding: clamp(14px, 5vw, 30px);
  border-radius: 24px;
  border: 1px solid rgba(27,49,83,.14);
  background: rgba(255,255,255,.92);
  color: #202c40;
  text-align: center;
}
.orientation-card h2 { margin: 4px 0 6px; font-size: clamp(20px, 5vw, 30px); line-height: 1.2; }
.orientation-card p { margin: 0; color: #45546a; font-size: 15px; }
.orientation-card button {
  min-height: 44px;
  margin-top: 14px;
  padding-inline: 18px;
  border-radius: 100px;
  background: #243951;
  color: #fff;
  font-size: 15px;
}

.rx-panel {
  inset: auto 0 0;
  min-height: 23.57%;
  display: flex;
  align-items: stretch;
  z-index: auto;
  pointer-events: none;
}
.rx-panel__card { position: relative; inset: auto; width: 100%; display: flex; align-items: end; }
.rx-panel__bg { position: absolute; inset: 0; }
.rx-panel::after {
  inset: auto 0 0;
  height: min(64px, 46%);
  z-index: 1;
  -webkit-mask-image: none;
  mask-image: none;
}
.rx-panel__inner {
  position: relative;
  inset: auto;
  z-index: 7;
  width: min(80%, 520px);
  max-width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 18px);
  margin-inline: auto;
  display: grid;
  gap: clamp(6px, 1.1dvh, 12px);
  padding-top: clamp(15px, 3.4dvh, 36px);
  padding-bottom: max(12px, min(5.3dvh, 42px), calc(env(safe-area-inset-bottom, 0px) + 9px));
}
.rx-panel__title {
  position: static;
  width: min(53%, 250px);
  margin-inline-start: 1.4%;
}
.rx-row {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 54px;
  height: clamp(54px, 7dvh, 66px);
}
.rx-row__bg { position: absolute; inset: 0; height: 100%; }
.rx-input {
  width: auto;
  left: max(11px, 3.8%);
  right: 60px;
  pointer-events: auto;
}
.rx-send {
  right: max(5px, 2.4%);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(44px, 5dvh, 49px);
  height: auto;
  pointer-events: auto;
}
.rx-send:active { transform: translateY(-50%) scale(.94); }
.rx-decor__bubble { width: min(var(--size), 32dvh, 250px); }
.rx-machine { width: min(52.83%, 31dvh, 260px); }
@media (min-width: 610px) {
  .rx-decor__bubble { left: clamp(1.5%, var(--x), calc(98.5% - min(var(--size), 32dvh, 250px))); }
  .rx-machine { left: auto; right: max(8%, env(safe-area-inset-right, 0px)); bottom: max(20%, 118px); }
}
@media (prefers-reduced-motion: reduce) {
  .app.has-wide-topics :is(.stage,.dock,.topics,.chat,.treehole,.diary,.release,.sp,.ab,.xp,.gl,.aurora) { transition-duration: 0.01ms; }
}

/* 在原生/WebKit 的 resize 事件抵达前，竖屏帧也不画手机日记。 */
@media (orientation: portrait) {
  .app.is-phone-layout .diary { visibility: hidden !important; pointer-events: none !important; }
}

/* 014 · 删除离场层：只在删除时存在，继承所在页面的层叠与裁切。 */
.card-delete {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.card-delete__piece,
.card-delete__art,
.card-delete__rim,
.card-delete__defs {
  position: absolute;
  top: 0;
  left: 0;
}

.card-delete__snapshot {
  width: 100%;
  height: 100%;
  margin: 0;
}

.card-delete__snapshot,
.card-delete__snapshot * {
  animation: none !important;
  transition: none !important;
  pointer-events: none !important;
}

.card-delete__art { overflow: visible; }
.card-delete__rim { overflow: hidden; }

.card-delete-neighbor {
  filter: var(--card-delete-heat) drop-shadow(0 0 7px rgb(255 153 59 /
    calc(var(--card-delete-light, 0) * var(--card-delete-light-strength, 0))));
}

@media (prefers-color-scheme: dark) {
  .card-delete-neighbor {
    filter: var(--card-delete-heat) drop-shadow(0 0 6px rgb(255 176 96 /
      calc(var(--card-delete-light, 0) * var(--card-delete-light-strength, 0) * 0.5)));
  }
}

.stream .is-restored,
.stream .is-restored .chunk { animation: none; }
