/* 聊明天 — 温暖纸笺
 *
 * Visual thesis: 暖米白纸感底 + 深墨字 + 朱砂主 accent + 灰青陪伴色。
 * 安静像一封手写信，聊天区更轻，适合长期咨询和日常陪伴。
 *
 * Interaction: 所有按钮 active:scale-0.97；input focus 180ms 过渡到灰青；
 * 错误一次性微 shake（160ms）。
 *
 * 适配：iPhone Safari + Android Chrome，360px 起。
 */

/* 自托管 web 字体（subset，墙内外都本地直出，不依赖 Google Fonts）。
   字符集与生成见 scripts/subset-web-fonts.sh。Noto Serif SC 缺字时逐字
   回落系统宋体，不会破。字体按 immutable 长缓存，URL 的 `?v=1781076309` 由
   服务端替换为静态资源最大 mtime——重新 subset 后版本前移、旧缓存失效。 */
@font-face {
  font-family: "Inter";
  src: url("/static/inter-subset.woff2?v=1781076309") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("/static/noto-serif-sc-subset.woff2?v=1781076309") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light; /* 原生控件（checkbox/scrollbar/autofill）按主题渲染 */
  /* 色板——OKLCH 等价值见行尾注释，浏览器兼容用 hex */
  --paper: #faf7f0;          /* oklch(96.5% 0.012 80) 页底纸色 */
  --card: #fffefb;           /* oklch(99.5% 0.005 85) 卡比页亮一档 */
  --ink: #1f1b16;            /* oklch(20% 0.008 65) 深墨正文 */
  --ink-soft: #6b6358;       /* oklch(48% 0.012 70) 次文 / label */
  --ink-faint: #9b9489;      /* oklch(64% 0.012 70) 提示 / meta */
  --rule: #e8e2d5;           /* oklch(90% 0.012 80) 边线 */
  --rule-soft: #f0ebde;      /* oklch(93% 0.010 80) 更淡的分隔 */
  --cinnabar: #c8472c;       /* 朱砂—唯一 accent */
  --cinnabar-deep: #b33d24;  /* hover/press */
  --cinnabar-mute: #e2a89a;  /* disabled */
  --cinnabar-wash: #f7e8e2;  /* 极淡纸染—错误底 / 高亮底 */
  --sage: #6f8f84;           /* 灰青—聊天陪伴色，降低朱砂压迫感 */
  --sage-deep: #5f8176;      /* 灰青 hover/press */
  --sage-line: #cbd9d2;      /* 用户气泡边线 */
  --sage-wash: #edf3ee;      /* 用户气泡底 / 轻提示 */
  --warning: #a8392a;        /* 错误文（比朱砂深一档） */
  --seal-ink: #fffefb;       /* 朱砂/灰青底上的反白字，两主题恒定 */
  --overlay: rgb(31 27 22 / 0.45);       /* modal 遮罩 */
  --bar-wash: rgb(250 247 240 / 0.92);   /* 输入条半透明纸底 */

  /* 字体栈——标题用宋体气质，正文用 system sans 保证移动可读。
     Inter / Noto Serif SC 自托管（见顶部 @font-face）：拉丁字形走 Inter
     （可变 opsz），CJK 逐字回落到 PingFang / 宋体。 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
    "STSong", "SimSun", "Source Serif Pro", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 度量 */
  --radius: 8px;             /* input / button / card 一致 */
  --radius-pill: 999px;      /* 仅聊天 bubble / 输入条 */
  --press-scale: 0.97;       /* 按下缩放（克制，纸笺感） */
  --press-ms: 100ms;
  --focus-ms: 180ms;

  /* 阴影—纸感浮起，不是 SaaS 卡 */
  --shadow-card: 0 1px 3px rgb(31 27 22 / 0.04),
    0 8px 24px rgb(31 27 22 / 0.04);
  --shadow-modal: 0 4px 12px rgb(31 27 22 / 0.08),
    0 24px 48px rgb(31 27 22 / 0.12);
}

/* 夜里的信纸——暗色 token 覆盖。data-theme 由 theme.js 在 head 同步
   设置（localStorage 优先，否则跟随系统），CSS 只认这一个开关。
   烛下暖墨：底色保持纸的暖棕调；朱砂按钮底不变，hover 在暗底改提亮；
   sage 提亮一档保证气泡边线/文字可读。 */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191512;          /* 暖黑棕，烛光下的信纸 */
  --card: #211c17;
  --ink: #ece5d8;
  --ink-soft: #a39a8c;
  --ink-faint: #6e665b;
  --rule: #383127;
  --rule-soft: #2d2720;
  --cinnabar-deep: #d65a3d;  /* 暗底 hover 提亮而非加深 */
  --cinnabar-mute: #6e3a2c;
  --cinnabar-wash: #3a241d;
  --sage: #8aa89c;
  --sage-deep: #9ab8ab;
  --sage-line: #3a4a43;
  --sage-wash: #232b27;
  --warning: #e07a64;
  --overlay: rgb(0 0 0 / 0.55);
  --bar-wash: rgb(25 21 18 / 0.92);
  --shadow-card: 0 1px 3px rgb(0 0 0 / 0.3),
    0 8px 24px rgb(0 0 0 / 0.3);
  --shadow-modal: 0 4px 12px rgb(0 0 0 / 0.4),
    0 24px 48px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  /* 轻纸纹—靠 SVG noise 即可，不依赖 backdrop-filter */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

/* ---------- 全站签名细节 ---------- */

/* 选中文字：朱砂淡染——纸上划重点的感觉 */
::selection {
  background: var(--cinnabar-wash);
  color: var(--ink);
}

/* 滚动条：细轨 + 边线色，融进纸面（默认系统灰太突兀） */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* 键盘焦点统一 sage 系 ring（与 input focus 同语言），盖掉浏览器默认
   蓝圈。朱砂主按钮用同色系 ring，避免红绿撞色 */
.btn-icon:focus-visible,
.btn-send:focus-visible,
.btn-send-msg:focus-visible,
.btn-fu:focus-visible,
.btn-close:focus-visible,
.empty-suggestion:focus-visible,
.msg-followup:focus-visible,
.msg-revert:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(111 143 132 / 0.25);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(200 71 44 / 0.28);
}

/* 盖章反馈：完成型动作（设定保存成功 / 登录成功）右上角落一枚章，
   1s 自然淡出。失败 / 发送 / 加载不用——章只对应"落定" */
#seal-flash {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(20px + env(safe-area-inset-right));
  z-index: 300;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: var(--seal-ink);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgb(255 254 251 / 0.35),
    0 2px 6px rgb(31 27 22 / 0.15);
  pointer-events: none;
  animation: seal-flash 1050ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes seal-flash {
  0% {
    opacity: 0;
    transform: rotate(-2.5deg) scale(1.4);
  }
  18% {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(-2.5deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #seal-flash {
    animation: seal-flash-static 1050ms step-end forwards;
  }
}

@keyframes seal-flash-static {
  0% {
    opacity: 1;
    transform: rotate(-2.5deg);
  }
  100% {
    opacity: 0;
  }
}

/* ---------- 顶栏 ---------- */

.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: transparent;     /* 不再用白底切，让纸面贯通 */
  border-bottom: 1px solid var(--rule-soft);
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.topbar .brand-link {
  text-decoration: none;
  color: inherit;
}

/* topbar 品牌章：与 welcome 落款印章同语言（替代旧聊天气泡 icon；
   favicon 仍是 icon.svg，品牌资产替换另行处理） */
.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background: var(--cinnabar);
  color: var(--seal-ink);
  font-size: 15px;
  font-weight: 500;
  border-radius: 5px;
  transform: rotate(-2.5deg);
  box-shadow: inset 0 0 0 1px rgb(255 254 251 / 0.35);
}

/* 添福缘按钮：紧挨品牌名右侧，纸笺风格 — 朱砂"福"字 SVG，
   无背景，hover/active 轻微反馈。点击热区 36x36 保证移动端可点 */
.topbar .btn-fu {
  background-color: transparent;
  border: none;
  padding: 0;
  margin-left: 2px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease;
}

.topbar .btn-fu:hover {
  background-color: var(--rule-soft);
}

.topbar .btn-fu:active {
  transform: scale(var(--press-scale));
  background-color: var(--rule);
}

.topbar .btn-fu .fu-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.topbar .actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* 顶栏式小按钮基础样式。全局作用域：welcome 浮动主题钮等
   topbar 之外的入口也要用；topbar 专属的只剩移动端挤压规则 */
.btn-icon {
  background-color: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius);
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
}

.btn-icon:hover {
  color: var(--ink);
  background-color: var(--rule-soft);
}

.btn-icon:active {
  transform: scale(var(--press-scale));
  background-color: var(--rule);
}

/* topbar 右组：登录态 actions + 日夜切换钮。包成一个子元素，
   space-between 才能保持 brand 左 / 操作区右 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 日夜切换：线条月/日图标，按当前主题显隐 */
.btn-theme {
  display: inline-flex;
  align-items: center;
}

/* welcome/login 态 topbar 整条隐藏时的日夜切换入口。fixed 挂
   viewport 右上（与 topbar padding 对齐）；z-index 盖过 login
   overlay(50)，让登录卡打开时也能切 */
.btn-theme-floating {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 60;
}

/* chat 态 topbar 在场（自带切换钮），浮动入口退场 */
body:has(#topbar:not(.hidden)) .btn-theme-floating {
  display: none;
}

.btn-theme svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-theme .icon-sun {
  display: none;
}

[data-theme="dark"] .btn-theme .icon-moon {
  display: none;
}

[data-theme="dark"] .btn-theme .icon-sun {
  display: block;
}

/* 相处设定入口：未设置态（onboardingPending）带朱砂小圆点提示 */
.topbar .btn-icon.attn::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--cinnabar);
  vertical-align: 2px;
}

/* ---------- 容器 + 居中 ---------- */

/* main 不再限宽——welcome / login / chat 各自控宽：
 * - welcome 是 flex center 整屏，.welcome-inner 内部限 440px
 * - login modal overlay 全屏覆盖，.login-card 居中限 420px
 * - chat 桌面宽屏读着舒服，单独限 880px（移动端 fill）
 */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

/* ---------- 欢迎页 ----------
 *
 * 首屏单 CTA，未登录用户先看品牌主张再进登录。
 * 视觉上沿用登录卡的"现代纸笺"——但更大字、更多留白、无卡，
 * 让品牌主张直接落在纸面上。
 */

.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  min-height: 0;
}

.welcome-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.welcome-title {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1.15;
}

/* 落款印章：手写信的签名时刻。开场动效最后"盖"下来（seal-stamp），
   内描边模拟印泥边缘 */
.welcome-title::after {
  content: "聊";
  display: block;
  width: 38px;
  height: 38px;
  margin: 22px auto 0;
  background: var(--cinnabar);
  color: var(--seal-ink);
  font-size: 21px;
  font-weight: 500;
  line-height: 38px;
  letter-spacing: 0;
  border-radius: 6px;
  transform: rotate(-2.5deg);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 254 251 / 0.35),
    0 1px 2px rgb(31 27 22 / 0.12);
  animation: seal-stamp 380ms cubic-bezier(0.22, 1, 0.36, 1) 620ms backwards;
}

/* 开场编排：标题 → tagline → 印章 → CTA 错峰浮现。backwards 只管
   delay 期间的 from 帧，结束后恢复自然样式——不锁 transform，
   :active 缩放不受影响 */
.welcome-title {
  animation: rise-in 480ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.welcome-tagline {
  animation: rise-in 480ms cubic-bezier(0.16, 1, 0.3, 1) 140ms backwards;
}

.welcome-sub {
  animation: rise-in 480ms cubic-bezier(0.16, 1, 0.3, 1) 220ms backwards;
}

.welcome .btn-primary {
  animation: rise-in 480ms cubic-bezier(0.16, 1, 0.3, 1) 340ms backwards;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes seal-stamp {
  from {
    opacity: 0;
    transform: rotate(-2.5deg) scale(1.5);
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-title,
  .welcome-title::after,
  .welcome-tagline,
  .welcome-sub,
  .welcome .btn-primary {
    animation: none;
  }
}

.welcome-tagline {
  margin: 28px 0 10px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* 信息句：告诉新访客这是什么——氛围句（tagline）之下、决定（CTA）之上 */
.welcome-sub {
  margin: 0 0 36px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.welcome .btn-primary {
  display: inline-block;
  width: auto;
  min-width: 200px;
  padding: 14px 36px;
}

@media (max-width: 480px) {
  .welcome {
    padding: 32px 20px;
  }
  .welcome-title {
    font-size: 36px;
  }
  .welcome-tagline {
    font-size: 15px;
    margin: 22px 0 28px;
  }
}

/* ---------- 登录 modal ----------
 *
 * 浮层覆盖在 welcome 之上：背景半透墨色，卡居中。
 * 关闭：右上角按钮 / 点 overlay 背景 / Esc 键。
 */

.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  z-index: 50;
  /* 四边都按 safe-area 兜底：横屏 / 刘海机型还有左右切口 */
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  /* 短屏 / 软键盘弹起：overlay 内能滚动，避免 modal 卡溢出无法
   * 访问底部按钮。dvh 让 iOS 软键盘弹起时 viewport 缩小后 modal
   * 不会被键盘遮一半。 */
  overflow-y: auto;
  animation: overlay-fade 160ms ease-out;
}

@keyframes overlay-fade {
  from { background: transparent; }
  to { background: var(--overlay); }
}

.login-overlay .login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  /* 防止内容比视口高（短屏 + 键盘 / 大字体）时溢出无法访问。
   * dvh 优先（新 iOS 软键盘弹起会缩 viewport），vh 兜底。 */
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 36px 28px 32px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  animation: card-rise 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@supports not (height: 100dvh) {
  .login-overlay .login-card {
    max-height: calc(100vh - 40px);
  }
}

@keyframes card-rise {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-card .btn-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  font-family: inherit;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
}

.login-card .btn-close:hover {
  color: var(--ink);
  background: var(--rule-soft);
}

.login-card .btn-close:active {
  transform: scale(var(--press-scale));
  background: var(--rule);
}

@media (max-width: 480px) {
  .login-overlay .login-card {
    padding: 28px 22px 24px;
    border-radius: 10px;
  }
  .login-card .btn-close {
    top: 8px;
    right: 10px;
  }
}

.login-card h1 {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}

/* 朱砂印记——welcome 落款印章的迷你版（同倾角），登录卡与门面同语言 */
.login-card h1::after {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 12px;
  background-color: var(--cinnabar);
  border-radius: 2px;
  transform: rotate(-2.5deg);
}

.login-card p.lead {
  margin: 18px 0 28px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: none;
}

.input,
.input-code {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;        /* >= 16px 防 iOS Safari 自动缩放 */
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--paper); /* 输入框比卡更深一点，回到纸底 */
  color: var(--ink);
  outline: none;
  min-height: 44px;
  transition:
    border-color var(--focus-ms) ease,
    background-color var(--focus-ms) ease;
}

.input::placeholder,
.input-code::placeholder {
  color: var(--ink-soft);
}

/* focus 统一 sage 系（同 composer）——朱砂留给"决定"（按钮/勾选），
   输入态是陪伴色 */
.input:focus,
.input-code:focus {
  border-color: var(--sage);
  background-color: var(--card);  /* focus 时回到卡底，更亮 */
  box-shadow: 0 0 0 3px rgb(111 143 132 / 0.14);
}

.input-code {
  letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: left;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .input,
.field-row .input-code {
  flex: 1;
}

.btn-send {
  flex-shrink: 0;
  padding: 0 16px;
  min-height: 44px;
  background-color: transparent;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  font-family: inherit;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
  white-space: nowrap;
}

.btn-send:hover:not(:disabled) {
  background-color: var(--cinnabar-wash);
}

.btn-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--cinnabar-mute);
  color: var(--cinnabar-mute);
}

.btn-send:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 24px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--cinnabar);
  cursor: pointer;
}

/* 协议链接用墨色下划线（链接本义），朱砂只留给登录卡里真正的
   决定：发送验证码、勾选、登录 */
.checkbox-row a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--focus-ms) ease;
}

.checkbox-row a:hover {
  color: var(--ink);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;       /* 中文宽字距，主按钮 */
  background-color: var(--cinnabar);
  color: var(--seal-ink);           /* 反白偏暖，更纸感 */
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--cinnabar-deep);
}

.btn-primary:disabled {
  background-color: var(--cinnabar-mute);
  cursor: not-allowed;
}

.btn-primary:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.error {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--cinnabar-wash);
  color: var(--warning);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  animation: shake 160ms ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.hint {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 聊天页 ---------- */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* 桌面端中央居中：720px——user 右 / assistant 左的对读距离更亲密
   * （880px 时视线横跨太远）。移动端 fill 屏宽。 */
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 4px;
  -webkit-overflow-scrolling: touch;
}

/* 历史拉取中：弱网下消息区不留盲区（composer 同时是禁用态） */
.history-loading-hint {
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* 空状态引导：登录后 history 拉完没消息时显示。用第一条助手气泡建立
   陪伴感，再给三条低压力开口建议。主聊天与设定视图共用。
   三段错峰浮现（rise-in 定义在 welcome 段）。 */
.empty-state {
  max-width: 560px;
  margin: 24px 0 0;
  padding: 18px 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.empty-state .empty-intro {
  animation: rise-in 360ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.empty-state .empty-prompt {
  animation: rise-in 360ms cubic-bezier(0.16, 1, 0.3, 1) 100ms backwards;
}

.empty-state .empty-suggestions {
  animation: rise-in 360ms cubic-bezier(0.16, 1, 0.3, 1) 180ms backwards;
}

@media (prefers-reduced-motion: reduce) {
  .empty-state .empty-intro,
  .empty-state .empty-prompt,
  .empty-state .empty-suggestions {
    animation: none;
  }
}

.empty-intro {
  display: inline-block;
  max-width: 90%;
  margin: 0 0 16px;
  padding: 13px 16px;
  background: var(--card);
  border-radius: 14px 14px 14px 4px;
  box-shadow: var(--shadow-card);
  font-size: 15px;
  color: var(--ink-soft);
}

.empty-prompt {
  margin: 2px 0 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.empty-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.empty-suggestion {
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition:
    transform var(--press-ms) ease,
    border-color var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
}

.empty-suggestion:hover {
  border-color: var(--sage);
  background: var(--sage-wash);
  color: var(--ink);
}

.empty-suggestion:active {
  transform: scale(var(--press-scale));
}

/* 日期落款分隔：跨自然日时的信纸落款「五月廿三 · 夜」。
   宋体小字居中，像信纸换页的日期题头 */
.msg-date-seal {
  margin: 26px 0 10px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* 新消息入场：只有刚 push 的消息带 .msg-enter（justAdded 标记，渲染
   一次即清），历史加载/重渲染不闪 */
.msg-enter {
  animation: rise-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .msg-enter {
    animation: none;
  }
}

.msg {
  margin: 8px 0;
  display: flex;
  /* column 排列：bubble + meta + 撤回按钮 自然垂直堆叠。
   * 用 align-items 决定每行子元素的横向对齐（user 靠右、assistant 靠左）。
   * 之前是 row + justify-content，撤回按钮会和 bubble 并排到旁边而非下方，
   * Copilot review 指出 align-self: flex-end 在 row 容器里管的是 cross axis
   * 不会让按钮换行到 bubble 下面。 */
  flex-direction: column;
}

.msg.user {
  align-items: flex-end;
}

.msg.assistant {
  align-items: flex-start;
}

.msg .bubble {
  position: relative;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 保存失败角标：气泡右上角，朱砂圆点 + ! 字，hover 弹原生 tooltip
   （title 属性）。不占行，对话流保持紧凑 */
.msg .msg-warn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--cinnabar);
  color: var(--seal-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  box-shadow: 0 1px 2px rgb(31 27 22 / 0.18);
  user-select: none;
}

.msg.user .bubble {
  max-width: 78%;
  background-color: var(--sage-wash);
  color: var(--ink);
  border: 1px solid var(--sage-line);
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 2px rgb(79 111 101 / 0.10);
}

.msg.assistant .bubble {
  max-width: 90%;
  background: var(--card);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-card);
}

.msg .meta {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 2px 8px 0;
}

/* 引用回复（v1）：抄微信样式 —— 新消息 bubble 在上为主体，引用紧贴
   下方一张轻量小卡片，单行内联展示，超过 2 行省略。颜色统一比正文淡
   一档（--ink-soft）。 */
.msg-quote-card {
  max-width: 78%;
  margin-top: 4px;
  padding: 6px 10px;
  background-color: var(--rule-soft);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  /* 超过 2 行省略，避免大段引用把对话流挤散。
     -webkit-line-clamp 在 WebKit/Blink + Firefox 132+ 支持，老 Firefox
     退化到 max-height 硬截（无 … 但不溢出）。1.5 * 2 行 = 3em 兜底 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 3em;
  word-break: break-word;
}

.msg-quote-label {
  color: var(--ink-soft);
  margin-right: 2px;
}

.msg-quote-text {
  white-space: pre-wrap;
}

/* 消息菜单（点击 bubble 弹出）：浮在 bubble 下方，"引用 / 复制"两项。
   fixed 定位由 JS 算好相对 anchor 的位置。 */
.msg-menu {
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow-modal);
  padding: 4px;
  display: flex;
  gap: 2px;
  z-index: 50;
  font-size: 14px;
}

.msg-menu-btn {
  background-color: transparent;
  border: none;
  color: var(--ink);
  font: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color var(--press-ms) ease,
    transform var(--press-ms) ease;
}

.msg-menu-btn:hover {
  background-color: var(--rule-soft);
}

.msg-menu-btn:active {
  background-color: var(--rule);
  transform: scale(var(--press-scale));
}

/* 撤回按钮：附在最后一条 user 消息下（仅 chatting 期间显示）。
 * user message 靠右气泡，撤回按钮也右对齐贴在气泡下方。
 * 低调灰色文字按钮，避免抢镜 user 消息本身。 */
.msg-revert {
  align-self: flex-end;
  margin: 6px 4px 0 0;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
}

.msg-revert:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--card);
}

.msg-revert:active {
  transform: scale(0.96);
}

.typing-bubble {
  display: inline-flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-card);
}

/* 快捷追问按钮托盘：附在 assistant bubble 下方。row + wrap 让移动端
 * 自然换行；max-width 跟 .bubble 同（78%）避免横向把 assistant 撑得比
 * 主气泡还宽。低调样式，不抢正文。 */
.msg-followups {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 78%;
  margin: 6px 0 0 0;
}

.msg-followup {
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft, var(--ink));
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms, transform 80ms;
  /* 长项允许在按钮内部换行（保险，单条 30 字撞窄屏不至于撑爆） */
  white-space: normal;
  text-align: left;
}

.msg-followup:hover {
  color: var(--ink);
  border-color: var(--rule);
  background: var(--bg, var(--card));
}

.msg-followup:active {
  transform: scale(0.97);
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: blink 1.4s infinite both;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.composer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bar-wash);
  border-top: 1px solid var(--rule-soft);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

.composer textarea {
  flex: 1;
  resize: none;
  padding: 12px 18px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  max-height: 120px;
  min-height: 48px;
  box-shadow: 0 1px 2px rgb(31 27 22 / 0.04);
  transition:
    border-color var(--focus-ms) ease,
    box-shadow var(--focus-ms) ease,
    background-color var(--focus-ms) ease;
}

.composer textarea::placeholder {
  color: var(--ink-soft);
}

.composer textarea:focus {
  border-color: var(--sage);
  background: var(--card);
  box-shadow:
    0 1px 2px rgb(31 27 22 / 0.05),
    0 0 0 3px rgb(111 143 132 / 0.14);
}

.btn-send-msg {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: var(--sage);
  color: var(--seal-ink);
  border: none;
  border-radius: 18px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease;
}

.btn-send-msg:disabled {
  background-color: var(--rule);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.btn-send-msg:hover:not(:disabled) {
  background-color: var(--sage-deep);
}

.btn-send-msg:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.banner {
  padding: 10px 16px;
  background: var(--cinnabar-wash);
  color: var(--warning);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
  text-align: center;
}

/* ---------- 打赏弹层 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  /* 入场与 login modal 同节奏（keyframes 在 login 段定义） */
  animation: overlay-fade 160ms ease-out;
}

.modal {
  animation: card-rise 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal {
    animation: none;
  }
}

.modal {
  background: var(--card);
  border-radius: 12px;
  padding: 28px 24px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-modal);
}

.modal h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.modal p {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-soft);
}

.modal img.qr {
  width: 220px;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

/* 打赏文案——比默认 .modal p 略大、行距更松，呼应 "现代纸笺" 排版气质 */
.modal p.tip-blessing {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.modal .btn-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background-color: transparent;
  border: none;
  font-size: 22px;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
}

.modal .btn-close:hover {
  color: var(--ink);
  background-color: var(--rule-soft);
}

.modal .btn-close:active {
  transform: scale(var(--press-scale));
  background-color: var(--rule);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .btn-icon:active,
  .topbar .btn-fu:active,
  .btn-send:active:not(:disabled),
  .btn-primary:active:not(:disabled),
  .btn-send-msg:active:not(:disabled),
  .empty-suggestion:active,
  .msg-menu-btn:active,
  .modal .btn-close:active,
  .msg-followup:active {
    transform: none;
  }
}

/* ---------- 静态文档页 ---------- */

article.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

article.doc h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

article.doc h1::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin: 14px 0 0;
  background: var(--cinnabar);
  border-radius: 1px;
}

article.doc h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  margin: 32px 0 12px;
  color: var(--ink);
}

article.doc blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--cinnabar-wash);
  color: var(--warning);
  border-left: 2px solid var(--cinnabar);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}

article.doc ul {
  padding-left: 22px;
}

article.doc li {
  margin: 4px 0;
}

article.doc a {
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--focus-ms) ease;
}

article.doc a:hover {
  border-bottom-color: var(--cinnabar);
}

/* ---------- util ---------- */

.hidden {
  display: none !important;
}

/* ---------- 小屏顶栏挤压防护（<= 380px） ---------- */

@media (max-width: 380px) {
  #phone-tag {
    display: none !important;
  }
  .topbar {
    padding: 12px 14px;
  }
  .topbar .btn-icon {
    padding: 6px 8px;
    font-size: 13px;
  }
  .topbar .brand {
    font-size: 17px;
  }
  .topbar .actions {
    flex-shrink: 1;
    min-width: 0;
  }
  .topbar .brand {
    flex-shrink: 0;
  }
}

/* ---------- 相处设定全屏视图 ---------- */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200; /* 盖过打赏 modal（z100）和 login（z50） */
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  animation: fade-in 200ms ease-out;
}

/* 入场过场：整页 fade + 头/设定墙/对话三段轻浮现 */
.settings-head {
  animation: rise-in 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.settings-bubbles {
  animation: rise-in 320ms cubic-bezier(0.16, 1, 0.3, 1) 40ms backwards;
}

#settings-chat {
  animation: rise-in 320ms cubic-bezier(0.16, 1, 0.3, 1) 80ms backwards;
}

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

@media (prefers-reduced-motion: reduce) {
  .settings-overlay,
  .settings-head,
  .settings-bubbles,
  #settings-chat {
    animation: none;
  }
}

.settings-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 720px; /* 与 .chat-area 对齐 */
  margin: 0 auto;
  padding: 12px 20px 8px;
}

.settings-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.settings-close {
  background: transparent;
  border: none;
  font-size: 22px;
  font-family: inherit;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  transition:
    transform var(--press-ms) ease,
    background-color var(--press-ms) ease,
    color var(--press-ms) ease;
}

.settings-close:hover {
  color: var(--ink);
  background-color: var(--rule-soft);
}

.settings-close:active {
  transform: scale(var(--press-scale));
}

/* 上区偏好气泡：纸卡浮起（与 empty-intro / fallback 同语言），可滚，
   给下区对话留主空间 */
.settings-bubbles {
  flex-shrink: 0;
  width: calc(100% - 40px);
  max-width: 680px; /* chat-area 720 减两侧 20px padding */
  margin: 2px auto 6px;
  max-height: 36vh;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

/* label 与 chip 行基线对齐（profile-label 的 8px padding 是为 modal
   input 行高设计的，chip 行更矮） */
.settings-bubbles .profile-label {
  padding-top: 3px;
}

.settings-bubbles .profile-row {
  margin-bottom: 12px;
}

.settings-bubbles .profile-row:last-child {
  margin-bottom: 0;
}

/* focus ring 与 input 同套 sage 系，盖掉浏览器默认蓝圈 */
.settings-close:focus-visible,
.settings-chip-btn:focus-visible,
.settings-bubbles .profile-chip-x:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(111 143 132 / 0.25);
}

.settings-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* 称呼气泡是 button（可点击改）：常驻 sage 边 + ✎ 后缀标明可编辑
   （note chip 无边框无 ✎，区分"可改"与"可删"） */
.settings-chip-btn {
  font-family: inherit;
  cursor: pointer;
  border-color: var(--sage-line);
  transition:
    border-color var(--press-ms) ease,
    background-color var(--press-ms) ease;
}

.settings-chip-btn::after {
  content: "✎";
  margin-left: 5px;
  font-size: 12px;
  color: var(--sage);
}

.settings-chip-btn:hover:not(:disabled) {
  border-color: var(--sage);
  background: var(--sage-wash);
}

.settings-chip-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.settings-nick-input {
  max-width: 240px;
}

.profile-chip-x:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* LLM 不可用时的降级快捷表单（消息流里以卡片呈现） */
.settings-fallback {
  max-width: 420px;
  margin: 8px 0;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

/* 救急表单不用主 CTA 重量：收窄、不全宽 */
.settings-fallback .btn-primary {
  width: auto;
  min-height: 40px;
  padding: 8px 28px;
}

/* 个性化 chip / 行样式（设定视图与 fallback 表单使用） */
.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.profile-label {
  flex: 0 0 40px;
  color: var(--ink-soft);
  font-size: 14px;
  padding-top: 8px;
}
.profile-nick-input,
.profile-add-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
}
.profile-nick-input:focus,
.profile-add-input:focus {
  outline: none;
  border-color: var(--sage);
}
.profile-notes-row .profile-notes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage-wash);
  border: 1px solid var(--sage-line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--ink);
}
.profile-chip-x {
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}
.profile-chip-x:hover {
  color: var(--warning);
}
.profile-error {
  color: var(--warning);
  font-size: 13px;
  margin-bottom: 12px;
}

/* 备案页脚：法规要求首页展示 ICP 号。钉在 welcome 落地页底部，
   极淡、不抢视觉。绝对定位避免扰乱 .welcome-inner 的居中。 */
.welcome {
  position: relative;
}
.site-beian {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
}
.beian-link {
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
}
.beian-link:hover {
  color: var(--ink-soft);
}
/* 公安备案号未配置（env 空 → token 替换为空串）时整条隐藏 */
.site-beian a:empty {
  display: none;
}

/* 首页理念：CTA 下方安静的小字块。淡色、限宽、克制，立产品调性不抢 CTA。 */
.welcome-manifesto {
  margin: 36px auto 0;
  max-width: 30em;
  padding-top: 26px;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.9;
  text-align: center;
}
.welcome-manifesto p {
  margin: 0 0 10px;
}
.welcome-manifesto-coda {
  margin: 16px 0 0;
  text-align: center;
  color: var(--cinnabar);
  letter-spacing: 0.08em;
}
/* 矮屏（横屏手机）藏起理念，避免与底部备案 footer 挤压重叠 */
@media (max-height: 640px) {
  .welcome-manifesto {
    display: none;
  }
}
