/* IBM Plex Sans（拉丁字母和数字，可变字重一个文件）放在自己服务器上：不再等谷歌字体，名字一打开就是对的字形。SIL OFL 1.1 授权 */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin.woff2?v=YUhZTcDZHZ) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* 传话 — 共用样式。风格：Framed sheet（框式纸面），一层淡淡的云灰蓝外框 + 一张白色纸面，无阴影。
   配色取自主人的湖景照片：云的灰白做外框，湖水的蓝做唯一的强调色，只用在“我方”的东西上（自己的气泡、传递环、
   选中和焦点、数据），其余是偏冷的中性色。整体要淡、清新，不炫。
   栅格：访客页 400px 身份栏 + 纸面（右、上、下内缩 8px）；后台 228px 侧栏 + 纸面，纸面内 344px 列表 | 对话 | 320px 详情。 */
:root {
  --ground: #eff3f6;          /* 外框：云的灰白，带一点天空的蓝 */
  --surface: #ffffff;
  --raised: #f5f7f9;
  --active: #e4ebf1;
  --border: #e3e9ee;
  --rule: #eef2f5;
  --control: #ccd5dd;
  --text: #18212a;
  --muted: #56626d;
  --faint: #67737e;
  --accent: #3f6b8e;          /* 湖水蓝，白底上 5.6:1 */
  --accent-pale: #e8f0f7;     /* 我方气泡、选中态的浅色 */
  --accent-ink: #ffffff;
  --primary: #22303c; --primary-ink: #ffffff;
  --positive: #2b7a52; --negative: #c4242a; --warning: #92400e;
  --pill-positive-bg: #e1f5e9; --pill-positive-ink: #0c3a22;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #e9eef2; --pill-neutral-ink: #34404a;
  --primary-hover: #374755; --control-hover: #aebbc6; --focus-ring: rgba(63, 107, 142, .16);
  --avatar-l: 88%; --avatar-s: 66%; --avatar-ink: #26323c; --wave: #aab8c4; --drop: rgba(232, 240, 247, .95);
  --ext-pdf: #fbe6e4; --ext-pdf-ink: #831c1e; --ext-doc: #e3ecf6; --ext-doc-ink: #1d4e89;
  --ext-xls: #e2f3e8; --ext-xls-ink: #0f5132; --ext-zip: #f5eedb; --ext-zip-ink: #6b4a0c;
  --ext-ppt: #f9ebe0; --ext-ppt-ink: #7a3410; --ext-vid: #eae9f5; --ext-vid-ink: #3c3a70;
  --burn: #b5401c; --burn-pale: #fcefe9; --sched: #7a520b; --sched-pale: #f7f1e2;
  --tag-l: 93%; --tag-ink-l: 27%; --panel-soft: #f9fbfc; --chart-1: #3f6b8e; --chart-2: #7d9150; --chart-3: #a8700c; --chart-muted: #d6dee5; --grid: #ebf0f4; --axis-ink: #56626d; --ink: #18212a;

  --font: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;   /* 只给大标题和开场白 */
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-title: 22px; --fs-section: 16px; --fs-kpi: 28px; --fs-body: 14px; --fs-small: 12px;

  --radius-card: 8px; --radius-control: 6px; --radius-sheet: 16px; --sheet-inset: 8px;
  --gap: 24px; --pad: 24px; --control-height: 32px; --row-height: 48px;
  --sidebar-width: 228px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --t-press: 120ms; --t-hover: 180ms; --t-ui: 240ms;
}

:root[data-theme="dark"] {
  --ground: #0f1113; --surface: #171a1d; --raised: #1f2327; --active: #29313a;
  --border: #252a30; --rule: #1f2327; --control: #434c56;
  --text: #eef2f5; --muted: #b3bdc6; --faint: #96a0aa;
  --accent: #93bcdc; --accent-pale: #1f2f3d; --accent-ink: #0f1113;
  --primary: #eef2f5; --primary-ink: #0f1113; --primary-hover: #d5dde3; --control-hover: #5d6873; --focus-ring: rgba(147, 188, 220, .22);
  --positive: #6cc69a; --negative: #ef7d7d; --warning: #e6b75e;
  --pill-positive-bg: #18291f; --pill-positive-ink: #6cc69a; --pill-negative-bg: #311c1e; --pill-negative-ink: #ef7d7d;
  --pill-warning-bg: #2c2517; --pill-warning-ink: #e6b75e; --pill-neutral-bg: #29313a; --pill-neutral-ink: #e6ecf0;
  --avatar-l: 30%; --avatar-s: 38%; --avatar-ink: #eef2f5; --wave: #5f6a75; --drop: rgba(31, 47, 61, .95);
  --ext-pdf: #3b2022; --ext-pdf-ink: #f2aaa7; --ext-doc: #1f2b3b; --ext-doc-ink: #a8c4e8; --ext-xls: #1a2f22; --ext-xls-ink: #97d3ad;
  --ext-zip: #33291a; --ext-zip-ink: #e4c684; --ext-ppt: #392519; --ext-ppt-ink: #efb793; --ext-vid: #24263a; --ext-vid-ink: #b8bce4;
  --burn: #f09b80; --burn-pale: #3a231b; --sched: #e4c684; --sched-pale: #2e2818;
  --tag-l: 25%; --tag-ink-l: 86%; --panel-soft: #1a1e21; --chart-1: #93bcdc; --chart-2: #a9bb83; --chart-3: #e4c684; --chart-muted: #3d454e; --grid: #252a30; --axis-ink: #b3bdc6; --ink: #eef2f5;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f1113; --surface: #171a1d; --raised: #1f2327; --active: #29313a;
    --border: #252a30; --rule: #1f2327; --control: #434c56;
    --text: #eef2f5; --muted: #b3bdc6; --faint: #96a0aa;
    --accent: #93bcdc; --accent-pale: #1f2f3d; --accent-ink: #0f1113;
    --primary: #eef2f5; --primary-ink: #0f1113; --primary-hover: #d5dde3; --control-hover: #5d6873; --focus-ring: rgba(147, 188, 220, .22);
    --positive: #6cc69a; --negative: #ef7d7d; --warning: #e6b75e;
    --pill-positive-bg: #18291f; --pill-positive-ink: #6cc69a; --pill-negative-bg: #311c1e; --pill-negative-ink: #ef7d7d;
    --pill-warning-bg: #2c2517; --pill-warning-ink: #e6b75e; --pill-neutral-bg: #29313a; --pill-neutral-ink: #e6ecf0;
    --avatar-l: 30%; --avatar-s: 38%; --avatar-ink: #eef2f5; --wave: #5f6a75; --drop: rgba(31, 47, 61, .95);
    --ext-pdf: #3b2022; --ext-pdf-ink: #f2aaa7; --ext-doc: #1f2b3b; --ext-doc-ink: #a8c4e8; --ext-xls: #1a2f22; --ext-xls-ink: #97d3ad;
    --ext-zip: #33291a; --ext-zip-ink: #e4c684; --ext-ppt: #392519; --ext-ppt-ink: #efb793; --ext-vid: #24263a; --ext-vid-ink: #b8bce4;
    --burn: #f09b80; --burn-pale: #3a231b; --sched: #e4c684; --sched-pale: #2e2818;
    --tag-l: 25%; --tag-ink-l: 86%; --panel-soft: #1a1e21; --chart-1: #93bcdc; --chart-2: #a9bb83; --chart-3: #e4c684; --chart-muted: #3d454e; --grid: #252a30; --axis-ink: #b3bdc6; --ink: #eef2f5;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/22px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 10px; height: 32px; font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; }
.brand svg { width: 24px; height: 24px; flex: none; }

/* ---------- 控件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out), opacity var(--t-hover) ease; }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.danger { color: var(--negative); }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.field { display: grid; gap: 8px; }
.field > label, .field > .label { font-weight: 500; }
.field .hint { color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); transition: border-color var(--t-hover) ease; }
textarea.input { height: auto; padding: 9px 12px; line-height: 22px; resize: vertical; }
.input:hover { border-color: var(--control-hover); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.input::placeholder { color: var(--faint); }
.switch { appearance: none; flex: none; width: 32px; height: 20px; margin: 0; border-radius: 999px; background: var(--control); position: relative; cursor: pointer; transition: background-color var(--t-ui) ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-ui) var(--ease-out); }
.switch:checked { background: var(--positive); } .switch:checked::after { transform: translateX(12px); }
.pill { display: inline-flex; flex: none; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.error-text { color: var(--negative); font-size: var(--fs-small); }

/* ---------- 头像：每个人一个稳定的浅色 ---------- */
.avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-weight: 600; font-size: 14px; color: var(--avatar-ink); background: hsl(var(--h, 190) var(--avatar-s, 62%) var(--avatar-l)); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 20px; height: 20px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

/* ---------- 纸面 ---------- */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet); min-width: 0; min-height: 0; overflow: hidden; }

/* ---------- 对话流 ---------- */
/* 对话流和输入框收在一条 760px 的居中阅读列里，宽屏上不再把两边的气泡拉得很远 */
:root { --col: 760px; }
.stream { overflow-y: auto; overscroll-behavior: contain; padding: 28px max(var(--pad), calc((100% - var(--col)) / 2)) 12px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; }
.day { align-self: center; margin: 20px 0 6px; padding: 2px 10px; border-radius: 999px; background: var(--raised); font-size: var(--fs-small); color: var(--muted); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(560px, 78%); }
.msg.new { animation: rise var(--t-ui) var(--ease-out); }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg + .msg.same { margin-top: -2px; }
.msg:not(.same) { margin-top: 14px; }
.who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: var(--fs-small); color: var(--muted); }
.who b { color: var(--text); font-weight: 500; }
.bubble { padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--raised); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 15px; line-height: 24px; }
.mine .bubble { border-radius: 14px 4px 14px 14px; background: var(--accent-pale); }
.same .bubble { border-radius: 14px; }
.bubble a { color: var(--accent); }
.recalled { padding: 6px 0; color: var(--faint); font-size: var(--fs-small); }
.attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.msg > .attachments:first-child, .who + .attachments { margin-top: 0; }
.mine .attachments { align-items: flex-end; }
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), 112px); gap: 4px; }
.gallery.one { grid-template-columns: minmax(0, 320px); }
.gallery button { padding: 0; border: 0; background: var(--raised); border-radius: 6px; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; transition: opacity var(--t-hover) ease; }
.gallery.one button { aspect-ratio: auto; max-height: 360px; }
.gallery button:hover { opacity: .9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery.one img { height: auto; max-height: 360px; }
/* 还没轮到下载的图：只显示灰色占位框，不露出替代文字 */
.gallery img:not([src]) { visibility: hidden; }
/* 单张图知道比例时：框子先按比例撑好，图片铺满框子 */
.gallery.one button[style*="aspect-ratio"] { max-height: 360px; }
.gallery.one button[style*="aspect-ratio"] img { height: 100%; max-height: none; }
.file-card { display: flex; align-items: center; gap: 12px; width: 300px; max-width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; transition: border-color var(--t-hover) ease; }
.file-card:hover { border-color: var(--control); }
.ext { display: grid; place-items: center; flex: none; width: 36px; height: 44px; border-radius: 4px; background: var(--active); color: var(--pill-neutral-ink); font: 600 11px/1 var(--font); text-transform: uppercase; }
.ext[data-k="pdf"] { background: var(--ext-pdf); color: var(--ext-pdf-ink); }
.ext[data-k="doc"] { background: var(--ext-doc); color: var(--ext-doc-ink); }
.ext[data-k="xls"] { background: var(--ext-xls); color: var(--ext-xls-ink); }
.ext[data-k="zip"] { background: var(--ext-zip); color: var(--ext-zip-ink); }
.ext[data-k="ppt"] { background: var(--ext-ppt); color: var(--ext-ppt-ink); }
.ext[data-k="vid"] { background: var(--ext-vid); color: var(--ext-vid-ink); }
.ext svg { width: 16px; height: 16px; }
.file-card .fname { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fmeta { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.file-card > span:nth-child(2) { min-width: 0; flex: 1; }
.file-card svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.voice { display: flex; align-items: center; gap: 10px; width: 260px; max-width: 100%; height: 44px; padding: 0 12px 0 6px; border-radius: 8px; background: var(--raised); }
.mine .voice { background: var(--accent-pale); }
.voice .play { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; flex: none; transition: transform var(--t-press) var(--ease-out); }
.voice .play:active { transform: scale(.94); }
.voice .play svg { width: 14px; height: 14px; }
.voice .bars { flex: 1; display: flex; align-items: center; gap: 2px; height: 24px; cursor: pointer; }
.voice .bars i { flex: 1; border-radius: 1px; background: var(--wave); min-height: 3px; transition: background-color 80ms linear; }
.voice .bars i.on { background: var(--text); }
.voice .dur { font-size: var(--fs-small); color: var(--muted); min-width: 34px; text-align: right; }
.meta-line { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: var(--fs-small); line-height: 18px; color: var(--faint); }
.meta-line button { padding: 0; border: 0; background: none; color: var(--muted); font-size: var(--fs-small); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.meta-line .read { color: var(--accent); }

/* ---------- 输入框 ---------- */
.composer { position: relative; width: min(var(--col), calc(100% - 2 * var(--pad))); margin: 8px auto var(--pad); border: 1px solid var(--control); border-radius: 14px; background: var(--surface); transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.composer textarea { display: block; width: 100%; min-height: 72px; max-height: 240px; padding: 14px 16px 4px; border: 0; background: transparent; resize: none; outline: none; font-size: 15px; line-height: 24px; }
.composer textarea::placeholder { color: var(--faint); }
.tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 12px 0; }
.chip { position: relative; display: flex; align-items: center; gap: 8px; height: 56px; max-width: 220px; padding: 0 28px 0 4px; border-radius: 6px; background: var(--raised); font-size: var(--fs-small); line-height: 16px; }
.chip.img { width: 56px; padding: 0; }
.chip.img img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; }
.chip .ext { width: 32px; height: 40px; }
.chip .cname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .csize { color: var(--muted); }
.chip .x { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(19, 20, 22, .72); color: #fff; cursor: pointer; }
.chip .x svg { width: 10px; height: 10px; }
.chip .bar { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.7); overflow: hidden; }
.chip.img .bar { left: 4px; right: 4px; }
.chip .bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width 120ms linear; }
.chip.failed { outline: 1px solid var(--negative); }
/* 照片缩略块上的进度字：读取中 / 压缩中 / 37% */
.chip .pct { position: absolute; left: 0; right: 0; top: 0; bottom: 8px; display: grid; place-items: center; border-radius: 6px; background: rgba(19, 20, 22, .42); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 10px 10px; }
.toolbar [data-act="send"] { height: 36px; padding: 0 16px; border-radius: 10px; }
.toolbar .spacer { flex: 1; }
.toolbar .hint { margin-right: 10px; font-size: var(--fs-small); color: var(--faint); }
.recording { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--negative); font-size: var(--fs-small); font-weight: 500; }
.recording .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--negative); animation: blink 1s steps(2) infinite; }
.recording .level { width: 64px; height: 4px; border-radius: 2px; background: var(--active); overflow: hidden; }
.recording .level i { display: block; height: 100%; width: var(--l, 0%); background: var(--negative); transition: width 80ms linear; }
.drop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; border-radius: inherit; background: var(--drop); color: var(--accent); font-weight: 600; font-size: 15px; pointer-events: none; }

/* ---------- 看图 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: 56px 1fr 56px; background: rgba(12, 14, 15, .94); color: #fff; animation: fade var(--t-ui) ease; }
.lightbox header, .lightbox footer { display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.lightbox header .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #c9cdcf; }
.lightbox footer { justify-content: center; color: #c9cdcf; font-size: 13px; }
.lightbox .stage { display: grid; place-items: center; min-height: 0; padding: 0 64px; }
.lightbox .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .icon-btn { color: #e8eaeb; }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.lightbox .nav.prev { left: 12px; } .lightbox .nav.next { right: 12px; }

/* ---------- 提示 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: rise var(--t-ui) var(--ease-out); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- 二期：引用、阅后即焚、定时、正在输入、视频、弹出菜单、标签 ---------- */
.icon-btn.sm { width: 24px; height: 24px; } .icon-btn.sm svg { width: 14px; height: 14px; }
.quote-bar { display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 6px 6px 6px 10px; border-radius: 6px; background: var(--raised); color: var(--muted); font-size: 13px; }
.quote-bar > svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.quote-bar .qtext { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote { display: block; max-width: 100%; margin-bottom: 4px; padding: 4px 10px; border: 0; border-left: 2px solid var(--control); border-radius: 0 4px 4px 0; background: transparent; color: var(--muted); font-size: 13px; line-height: 20px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine .quote { border-left: 0; border-right: 2px solid var(--control); border-radius: 4px 0 0 4px; text-align: right; }
.quote:hover { color: var(--text); }
.msg.flash .bubble, .msg.flash .gallery, .msg.flash .voice { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.meta-line .act { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; opacity: 0; transition: opacity var(--t-hover) ease; }
.meta-line .act svg { width: 13px; height: 13px; }
.msg:hover .act, .msg:focus-within .act { opacity: 1; }
@media (hover: none) { .meta-line .act { opacity: 1; } }
.meta-line .burn, .meta-line .sched { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.meta-line .burn { color: var(--burn); } .meta-line .sched { color: var(--sched); }
.meta-line .burn svg, .meta-line .sched svg, .recalled svg { width: 13px; height: 13px; }
.recalled { display: inline-flex; align-items: center; gap: 6px; }
.msg.pending .bubble, .msg.pending .attachments { opacity: .62; }
.sealed { display: flex; align-items: center; gap: 12px; width: 280px; max-width: 100%; padding: 12px 14px; border: 0; border-radius: 8px; background: var(--burn-pale); color: var(--burn); text-align: left; cursor: pointer; transition: transform var(--t-press) var(--ease-out); }
.sealed:active { transform: scale(.98); }
.sealed > svg { width: 20px; height: 20px; flex: none; }
.sealed > span { flex: 1; min-width: 0; }
.sealed b { display: block; font-weight: 600; }
.sealed span span { display: block; color: var(--text); font-size: 12px; line-height: 18px; opacity: .8; }
video.clip { width: 320px; max-width: 100%; max-height: 360px; border-radius: 6px; background: #000; }
.typing { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--raised); color: var(--muted); font-size: 12px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: bounce 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.typing span { margin-left: 6px; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 14px 0; font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.check input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.toolbar .sep { width: 1px; height: 18px; margin: 0 6px; background: var(--border); }
.opt { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.opt svg { width: 15px; height: 15px; }
.opt:hover { background: var(--raised); color: var(--text); }
.opt[data-act="burn"][aria-pressed="true"] { background: var(--burn-pale); color: var(--burn); }
.opt[data-act="schedule"][aria-pressed="true"] { background: var(--sched-pale); color: var(--sched); }
.pop-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; min-width: 240px; max-width: min(340px, 80vw); padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .14); display: grid; gap: 2px; animation: rise var(--t-ui) var(--ease-out); }
.menu > button { padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; line-height: 20px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu > button:hover, .menu > button:focus-visible { background: var(--raised); }
.menu-empty { padding: 8px 10px; color: var(--muted); }
.menu.sched { gap: 10px; padding: 14px; min-width: 280px; }
.menu.sched label { font-weight: 500; }
.sched-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-quick .btn { height: 28px; padding: 0 10px; font-size: 13px; font-weight: 400; }
.sched-acts { display: flex; justify-content: flex-end; gap: 8px; }
.is-recording .opt, .is-recording .sep, .is-recording [data-act="image"], .is-recording [data-act="file"], .is-recording .pop-wrap { display: none; }
.tag { display: inline-flex; flex: none; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: hsl(var(--h) 40% var(--tag-l)); color: hsl(var(--h) 45% var(--tag-ink-l)); font-size: 12px; font-weight: 500; white-space: nowrap; }
.meta-line { flex-wrap: wrap; row-gap: 0; }
.meta-line > * { white-space: nowrap; }
.mine .meta-line { justify-content: flex-end; }

/* ---------- 动效：一个签名动作（头像外的传递环），其余是入场、反馈和状态 ----------
   只用 transform 和 opacity；系统开了“减少动态效果”时，上面的全局规则会把它们全部停掉，内容照常显示。 */
.orbit { position: relative; display: inline-grid; place-items: center; }
.orbit > .ring { position: absolute; inset: -14%; width: 128%; height: 128%; max-width: none; pointer-events: none; overflow: visible; }
.orbit > .ring circle { vector-effect: non-scaling-stroke; }
.orbit > .ring .track { fill: none; stroke: var(--accent); stroke-opacity: .5; stroke-width: 1.2; stroke-dasharray: 2 6; }
.orbit > .ring * { transform-box: view-box; }
.orbit > .ring .arc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 64 400; transform-origin: 50% 50%; animation: spin 9s linear infinite; }
.orbit > .ring .spark { fill: var(--accent); transform-origin: 50% 50%; animation: spin 9s linear infinite; }
.orbit > .ring .slow { transform-origin: 50% 50%; animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 在线、实时这样的状态点：一圈向外散开的脉冲 */
.pulse { position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(3); opacity: 0; } }
/* 页面载入时分层入场：标题、文字、卡片依次上升 */
.reveal { opacity: 0; animation: reveal 1s var(--ease-soft) forwards; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
/* 自己刚发出的消息从输入框方向升上来 */
.msg.new.mine { animation: sent .7s var(--ease-soft); transform-origin: 100% 100%; }
@keyframes sent { 0% { opacity: 0; transform: translateY(40px) rotate(-2.5deg) scale(.94); } 60% { opacity: 1; transform: translateY(-3px) rotate(.4deg); } 100% { opacity: 1; transform: none; } }
.msg.new:not(.mine) { animation: received .5s var(--ease-out); }
@keyframes received { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
/* 卡片和按钮的悬停、按下 */
.topics button:hover, .panel-hover:hover { transform: translateY(-2px); }
.btn.primary svg { transition: transform var(--t-hover) var(--ease-out); }
.btn.primary:hover svg { transform: translateX(2px); }
/* 列表里有新消息的那一行闪一下 */
.trow.bump { animation: bump 1.4s var(--ease-out); }
@keyframes bump { 0% { background: var(--accent-pale); } 100% { background: transparent; } }
.trow .badge { animation: pop .35s var(--ease-out); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
/* 柱状图从底部长出来 */
.chart.grow svg rect { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .8s var(--ease-out) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }

/* 发送时，一张对折的小纸条从发送按钮飞进对话里：传话这件事本身 */
.flying-note { position: fixed; z-index: 70; width: 30px; height: 30px; pointer-events: none; will-change: transform, opacity; }
.flying-note svg { width: 100%; height: 100%; }
/* 开场白一个字一个字写出来；光标是一条细细的竖线，写完就消失 */
.typing-cursor::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
/* 封面照片：很慢地推近、再缓缓退回，像湖面上的风 */
.cover img { animation: drift 24s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes drift { from { transform: scale(1.08) translate3d(-1.5%, 0, 0); } to { transform: scale(1.0) translate3d(1%, -1%, 0); } }

/* ---------- 三期：同意公开、漂流瓶、回答墙、通用对话框 ---------- */
.consent { display: flex; gap: 8px; align-items: flex-start; margin: 2px 16px 2px; color: var(--muted); font-size: 13px; line-height: 20px; }
.consent input { margin-top: 3px; flex: none; }
.consent.off { opacity: .5; }
.opt[data-act="drift"][aria-pressed="true"] { background: var(--accent-pale); color: var(--accent); }
.meta-line .drift, .meta-line .pub { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--accent); }
.meta-line .drift svg, .meta-line .pub svg { width: 13px; height: 13px; }
.meta-line .act-strong { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--accent-pale); color: var(--accent); font-weight: 500; text-decoration: none; }
.meta-line .act-strong svg { width: 13px; height: 13px; }
.meta-line .act-strong:hover { background: var(--active); }
/* 回答墙：一问一答的卡片，问题用衬线字，回答压在一块浅湖蓝上 */
.qa { display: grid; gap: 12px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.qa + .qa { margin-top: 12px; }
.qa .q-meta { color: var(--muted); font-size: var(--fs-small); }
.qa .q { font-family: var(--serif); font-size: 17px; line-height: 28px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qa .a { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 16px; border-radius: 10px; background: var(--accent-pale); }
.qa .a .avatar { width: 28px; height: 28px; font-size: 12px; }
.qa .a b { font-weight: 600; font-size: 13px; }
.qa .a b span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.qa .a p { margin-top: 4px; font-size: 15px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--raised); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; }
.seg button .n { margin-left: 4px; color: var(--faint); }
dialog.dlg { width: min(520px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.18); color: var(--text); background: var(--surface); }
dialog.dlg::backdrop { background: rgba(15, 20, 26, .42); }
dialog.dlg[open] { animation: rise var(--t-ui) var(--ease-out); }
dialog.dlg h2 { font-size: 20px; line-height: 28px; font-weight: 600; margin-bottom: 6px; }
dialog.dlg > p { color: var(--muted); margin-bottom: 18px; line-height: 22px; }
dialog.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
dialog.dlg .btn { height: 36px; }

.meta-line .held { color: var(--pill-warning-ink); font-weight: 500; }

/* ---------- 设备兼容 ----------
   手机：去掉点按时的灰色闪块和老 WebView 的点击延迟；输入框 16px，iOS 聚焦时不会自动放大页面；
   刘海屏和底部横条：顶栏、输入框、提示条都让出安全区。 */
button, a, label, .trow, .topics button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 860px) {
  .input, input, select, textarea, .composer textarea { font-size: 16px; }
  .m-top { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)) !important; }
  .composer { margin-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
  .lightbox { grid-template-rows: calc(56px + env(safe-area-inset-top)) 1fr calc(56px + env(safe-area-inset-bottom)); }
  .lightbox header { padding-top: env(safe-area-inset-top); }
  .lightbox .stage { padding: 0 8px; }
  .lightbox .nav { display: none; }   /* 手机上左右滑动切换 */
}
@media (max-width: 360px) {
  .toolbar { gap: 0; padding: 6px 6px 8px; }
  .toolbar .icon-btn { width: 30px; }
  .toolbar [data-act="send"] { padding: 0 12px; }
}
/* 不支持 <dialog> 的老浏览器（部分安卓 WebView）：用固定定位的层代替 */
dialog.dlg-fallback[open] { position: fixed; top: 50%; left: 50%; z-index: 80; transform: translate(-50%, -50%); max-height: 90vh; overflow: auto; }
.dlg-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(15, 20, 26, .42); }

/* ---------- 四期：动态、分享图、主人入口、标签墨线 ---------- */
/* 标签：白色的选中块在三个标签之间滑动 */
.seg { position: relative; }
.seg-ink { position: absolute; top: 3px; left: 3px; height: 30px; width: 0; border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: transform 380ms var(--ease-soft), width 380ms var(--ease-soft); }
.seg button { position: relative; z-index: 1; }
.seg button[aria-pressed="true"] { background: transparent; }
.new-dot { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--negative); vertical-align: 1px; animation: pop .4s var(--ease-out); }
.owner-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out); }
.owner-pill svg { width: 15px; height: 15px; }
.owner-pill b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 18px; text-align: center; }
.owner-pill:active { transform: scale(.97); }
/* 开场白下面的动态预告 */
.teaser { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.teaser:hover { border-color: var(--accent); }
.teaser img, .teaser .t-ic { width: 52px; height: 52px; flex: none; border-radius: 10px; object-fit: cover; background: var(--accent-pale); display: grid; place-items: center; color: var(--accent); }
.teaser .t-ic svg { width: 22px; height: 22px; }
.teaser .t-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.teaser .t-txt span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teaser > svg { width: 16px; height: 16px; color: var(--faint); flex: none; transition: transform var(--t-hover) var(--ease-out); }
.teaser:hover > svg { transform: translateX(3px); color: var(--accent); }
/* 动态卡片 */
.post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 20px 0; }
.post + .post { border-top: 1px solid var(--rule); }
.post > .avatar { width: 44px; height: 44px; }
.post header { display: flex; align-items: center; gap: 8px; }
.post header b { font-weight: 600; color: var(--accent); }
.pin-tag { height: 20px; padding: 0 7px; border-radius: 4px; background: var(--accent-pale); color: var(--accent); font-size: 11px; line-height: 20px; }
.post-text { margin-top: 6px; font-size: 15px; line-height: 25px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-text a { color: var(--accent); }
.post-grid { display: grid; gap: 4px; margin-top: 10px; max-width: 420px; }
.post-grid.one { grid-template-columns: minmax(0, 300px); }
.post-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; }
.post-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-grid button { padding: 0; border: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--raised); cursor: zoom-in; }
.post-grid.one button { aspect-ratio: auto; max-height: 360px; }
/* 不认 aspect-ratio 的旧内核（部分国产浏览器的老版本）：缩略图给固定高度，不会塌成 0 */
@supports not (aspect-ratio: 1) { .gallery button, .post-grid button { height: 110px; } .gallery.one button, .post-grid.one button { height: 240px; } }
.post-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-soft); }
.post-grid button:hover img { transform: scale(1.04); }
.post .clip { margin-top: 10px; }
.post-meta { display: flex; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.post-meta span { display: inline-flex; align-items: center; gap: 3px; }
.post-meta svg { width: 12px; height: 12px; }
.post-acts { display: flex; gap: 4px; margin: 8px 0 0 -8px; }
.pa { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.pa svg { width: 17px; height: 17px; }
.pa:hover { background: var(--raised); color: var(--text); }
.pa.like.on { color: #d9466b; }
.cmts { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--raised); font-size: 14px; line-height: 21px; }
.cmts b { color: var(--accent); font-weight: 500; margin-right: 6px; }
.cmts li.by-owner b { color: var(--text); }
.cmts li span { overflow-wrap: anywhere; }
.cmts li { animation: rise var(--t-ui) var(--ease-out); }
.cmt-form { display: flex; gap: 8px; margin-top: 8px; }
.cmt-form .input { height: 36px; }
.spark-dot { position: fixed; z-index: 75; width: 5px; height: 5px; border-radius: 50%; background: #d9466b; pointer-events: none; }
.wall-empty { padding: 18px; border: 1px dashed var(--control); border-radius: 10px; color: var(--muted); }
.quote.post-ref { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.quote.post-ref svg { width: 13px; height: 13px; flex: none; }
/* 回答墙卡片的分享按钮 */
.qa-share { justify-self: start; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; transition: color var(--t-hover) ease, border-color var(--t-hover) ease; }
.qa-share svg { width: 13px; height: 13px; }
.qa-share:hover { color: var(--accent); border-color: var(--accent); }
.share-view .stage img { max-height: calc(100vh - 140px); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); animation: share-in 520ms var(--ease-soft); }
@keyframes share-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .owner-pill span { display: none; }
  .post { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .post > .avatar { width: 38px; height: 38px; }
}
.ash { position: fixed; z-index: 70; width: 4px; height: 4px; border-radius: 1px; pointer-events: none; outline: 1px solid var(--burn); outline-offset: -1px; }
/* 刚点了发送、服务器还没回话的那条：稍淡一点，下面写“发送中…” */
.msg:has(.meta-line .sending) .bubble { opacity: .72; }
.meta-line .sending { color: var(--muted); }
