:root {
  /* ---- 纸面与底色 ---- */
  --bg: #f7f3ec;
  --card: #fffdf9;
  --surface: #ffffff;          /* 输入框、按钮等纯白面 */
  --surface-sunken: #efe9dd;   /* 代码块、图片占位 */
  --accent-tint: #fdf5e6;      /* 激活态浅底 */
  --stage: #161514;            /* 视频区深底 */

  /* ---- 文字（由深到浅）---- */
  --ink: #34302a;              /* 标题 */
  --ink-body: #423b31;         /* 正文 */
  --ink-soft: #7d7466;         /* 次要说明 */
  --ink-mute: #9a8f7e;         /* 最弱：空状态、调试信息 */
  --on-dark: #ffffff;          /* 深色底上的文字 */

  /* ---- 主色 ---- */
  --accent: #a8803f;
  --accent-ink: #fffdf9;
  --border: #e6ddcc;
  --danger: #c0542f;
  --success: #409664;

  /* ---- 语义色（半透明覆盖）---- */
  --accent-scrim: rgba(168, 128, 63, .86);   /* 用户字幕底 */
  --badge-on: rgba(64, 150, 100, .88);
  --badge-busy: rgba(168, 128, 63, .92);
  --glow-seal: drop-shadow(0 4px 10px rgba(181, 67, 47, .20));

  /* ---- 覆盖层 ---- */
  --overlay: rgba(30, 26, 20, .45);
  --scrim: rgba(0, 0, 0, .62);        /* 角标底 */
  --scrim-soft: rgba(0, 0, 0, .55);   /* 同样用于角标 */
  --sub-bg: rgba(255, 255, 255, .96); /* 字幕底：白底 */
  --sub-ink: #2a2620;                 /* 字幕字：深墨 */

  /* ---- 阴影与发光 ---- */
  --shadow-sm: 0 1px 3px rgba(60, 50, 35, .18);
  --shadow-md: 0 2px 10px rgba(60, 50, 35, .10);
  --shadow-card: 0 10px 34px rgba(60, 50, 35, .12);
  --shadow-modal: 0 12px 40px rgba(40, 32, 20, .28);
  --glow-accent: 0 3px 12px rgba(168, 128, 63, .30);
  --glow-danger: 0 3px 12px rgba(192, 84, 47, .30);

  /* ---- 尺寸与安全区 ---- */
  --radius: 12px;
  --radius-lg: 16px;
  --tap: 44px;                 /* 最小触摸目标（iOS HIG / Material 都建议 ≥44px） */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

/* ★ `hidden` 属性必须**永远**能藏住东西。
 *
 * 浏览器给 [hidden] 的默认样式是 `display: none`，但它**优先级最低** ——
 * 只要元素自己写了 `display: inline-block / flex / block`，`hidden` 就失效了：
 * JS 里 `el.hidden = true` 明明生效（属性确实加上了，读 `.hidden` 也是 true），
 * 屏幕上却照样显示。**断言查属性会过，用户看得见**。
 *
 * 这个坑在本文件里已经单独补过 11 次（见 .modal[hidden]、.sub[hidden] 等），
 * 每次都是"新加一个带 display 的元素 + 用 hidden 控制显隐"时又踩一遍。
 * 「media-link 在 source_url 为空时不该显示」就是这么漏的 ——
 * 断言过了（属性为 true），截图里那个链接还在。
 *
 * 逐条补是打地鼠，所以这里用一条 !important 的全局规则一次性消掉整类问题。
 * 注意：JS 里 `el.hidden = false` 会**移除属性**，不存在"想显示却被藏住"的情况；
 * 真要靠 CSS 覆盖 hidden 的地方本来就是这个 bug。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  /* 四边都留安全区：顶栏避开刘海/灵动岛，底部避开 Home 指示条 */
  padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right))
           calc(10px + var(--safe-bottom)) calc(12px + var(--safe-left));
  gap: 10px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-seal {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.brand-text { min-width: 0; }
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .5px;
}
.place-label {
  margin: 1px 0 0;
  padding: 0;
  max-width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-label::after { content: ' ▾'; opacity: .65; }
.icon-btn {
  flex: none;
  width: 44px; height: 44px;      /* 触摸目标 ≥44px */
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn:active { transform: scale(.92); background: var(--accent-tint); }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn.active { border-color: var(--accent); background: var(--accent-tint); }

/* ---------- 设置面板 ---------- */
.settings {
  flex: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.settings[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-inline { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--ink-soft); }
.field .val { color: var(--accent); font-weight: 600; }
.field select,
.field input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
}
.field input[type="range"] { accent-color: var(--accent); width: 100%; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.hint { grid-column: 1 / -1; margin: 0; font-size: 11px; color: var(--ink-soft); }

/* ---------- 画面舞台 ---------- */
.stage {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--stage);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* 空状态：不要把整块做成「没加载出来的黑」。
   暖色渐变 + 暗角 + 一枚极淡的印章水印，让它看起来是刻意留白。 */
.stage-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('icons/seal.png') center 56% / 46% no-repeat;
  opacity: .07;
  pointer-events: none;
}
/* 摄像头的取景框：**必须按比例完整显示**（object-fit: contain），不能裁也不能拉。
 *
 * ★★ 2026-10-02 改（用户报「手机端画面异常的拉直了」）。改前是 `cover`：
 *   · 手机竖屏时容器（约 390x844）比 4:3 的画面"高得多"，cover 会以高为准放大，
 *     横向裁掉大半 —— 用户以为自己正对着的东西在画面里，其实早被裁掉了；
 *   · RTC 那条更糟：SDK 收到 renderMode 后会把 object-fit 写成**内联样式**
 *     （见 web/rtc-call.js tryPreview 的注释与 vendor 里的 _getObjectFitFromRenderMode），
 *     内联样式盖过这条规则，而当时传的是 RENDER_MODE_FILL → `fill` = **拉伸变形**，
 *     也就是用户看到的"拉直"。
 *   现在两处一起改：SDK 侧改传 FIT(=contain)，CSS 侧兜底也写成 contain。
 *   取舍：宁可上下留黑边，也不要让取景范围骗人 —— 智能体收到的是**完整那一帧**，
 *   用户看到的必须就是它。 */
.stage video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
/* 空状态：本身就是「开启摄像头」的入口，整块可点 */
.stage-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border: 0;
  /* 暖色渐变打底 + 四角压暗，避免「一大块死黑」 */
  background:
    radial-gradient(125% 95% at 50% 34%, transparent 38%, rgba(0, 0, 0, .58) 100%),
    linear-gradient(168deg, #35302a 0%, #241f19 46%, #14110e 100%);
  font: inherit;
  color: var(--ink-mute);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stage-placeholder[hidden] { display: none; }

.ph-art {
  width: 104px;
  height: 104px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: .8;
  transition: transform .18s ease;
  animation: ph-breathe 3.6s ease-in-out infinite;
}
.ph-art circle { stroke-width: 1.8; }

@keyframes ph-breathe {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .95; transform: scale(1.045); }
}

.stage-placeholder:active .ph-art { transform: scale(.95); }
.ph-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .6px;
}
.ph-hint { font-size: 12.5px; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .ph-art { animation: none; opacity: .8; }
}

.badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  gap: 6px;
}
.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--scrim-soft);
  color: var(--on-dark);
  font-size: 11px;
  backdrop-filter: blur(4px);
}
.badge.on { background: var(--badge-on); }
.badge.busy { background: var(--badge-busy); }
.badge[hidden] { display: none; }

.subtitles {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.subtitles[hidden] { display: none; }
.sub {
  align-self: flex-start;
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 12px;
  /* 白底黑字：户外强光下对比度最高，比半透明黑底可靠得多 */
  background: var(--sub-bg);
  color: var(--sub-ink);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: .2px;
  border-left: 3px solid var(--ink-mute);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .26);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  white-space: pre-wrap;
  word-break: break-word;
}
.sub-ai { border-left-color: var(--accent); }
.sub-user { border-left-color: var(--ink-mute); }
.sub[hidden] { display: none; }

/* ---------- 语音状态指示（听你说 / 思考中 / 说话中）---------- */
.status-pill {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: var(--scrim-soft);
  color: var(--on-dark);
  font-size: 12.5px;
  letter-spacing: .4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status-pill[hidden] { display: none; }
.status-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.status-pill.listening .dot { animation: st-breathe 1.4s ease-in-out infinite; }
.status-pill.thinking .dot {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: var(--accent);
  width: 9px; height: 9px;
  animation: st-spin .7s linear infinite;
}
.status-pill.speaking .dot { animation: st-talk .8s ease-in-out infinite; }
@keyframes st-breathe {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-talk {
  0%, 100% { transform: scaleY(.6); }
  50%      { transform: scaleY(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .status-pill .dot { animation: none !important; }
}

/* ---------- 识别条 ---------- */
.vision-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
/* 默认整条隐藏，只有调试模式或需要提示时才出现（display:flex 会盖掉 [hidden]，必须显式写） */
.vision-bar[hidden] { display: none; }
.vision-bar img {
  flex: none;
  width: 56px; height: 42px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.vision-status {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-height: 42px;
  overflow: hidden;
}

/* ---------- 对话区 ---------- */
.chat {
  flex: 1 1 auto;
  min-height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 0;
}
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.bubble {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 12px;
  line-height: 1.6;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 3px;
}
.msg.assistant .bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.refs { margin-top: 4px; font-size: 11.5px; color: var(--ink-soft); max-width: 84%; }

/* ---------- 输入区 ---------- */
.composer {
  flex: none;
  display: flex;
  gap: 8px;
}
.composer input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  color: var(--ink);
}
.composer button {
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- 底部控制 ---------- */
.controls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 2px 0;
}
.ctrl-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.ctrl-btn svg { width: 22px; height: 22px; display: block; }
.ctrl-btn:active { transform: scale(.92); }
.ctrl-btn:disabled { opacity: .45; cursor: not-allowed; }
.ctrl-btn.active { border-color: var(--accent); background: var(--accent-tint); }

/* 「收进手账」：收下瞬间闪一下给反馈；右上角小数标显示已收几张 */
.ctrl-btn { position: relative; }
.keep-count {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@keyframes keep-flash {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 var(--accent-scrim); }
  45%  { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(168,128,63,0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(168,128,63,0); }
}
.ctrl-btn.just-kept { animation: keep-flash .42s ease-out; }
@media (prefers-reduced-motion: reduce) { .ctrl-btn.just-kept { animation: none; } }

.call-btn {
  min-width: 168px;
  height: 50px;
  padding: 0 26px;
  border: none;
  border-radius: 25px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: var(--glow-accent);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.call-btn:active { transform: translateY(1px) scale(.985); }
.call-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.call-btn.active { background: var(--danger); box-shadow: var(--glow-danger); }

/* 底栏两个方式按钮（2026-09-30）：语音+识图 / 视频。
   两个都要显眼、但一眼能区分 —— 视频那个用描边款（同一个强调色的"次级"表达），
   免得两个实心按钮长得一样、用户点错。 */
.controls .call-btn { min-width: 132px; padding: 0 20px; }
.call-btn-alt {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
.call-btn-alt.active { background: var(--danger); color: var(--accent-ink); border-color: var(--danger); }

.voice-debug {
  flex: none;
  font-size: 11px;
  color: var(--ink-mute);
  font-family: Consolas, monospace;
  min-height: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ===== 两个独立的全屏模式页（2026-10-01 用户要求：参考豆包，语音与视频各自一页）=====
   做法：给主舞台加一个类就整屏（不动 DOM —— <video> 与 RTC 的 renderDom 都已经在
   #stage 里，搬节点会让 vision.js / SDK 的绑定变复杂）。 */
.stage.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
  background: #0b0a0c;
}
.stage.is-fullscreen video { object-fit: contain; background: #000; }
/* ★ RTC 的本地预览是 SDK 自己建的 <video>，它会把 object-fit 写成**内联样式**
   （`this._videoDom.style.objectFit = …`，取值由 renderMode 决定）。内联样式只能在
   CSS 里用 !important 压住 —— 这一条是"比例永不失真"的最后一道保险：
   即使以后有人再把 renderMode 改回 FILL，画面也不会被拉伸变形。
   想裁剪请改 renderMode（代码里说清了为什么不该裁），不要在样式里悄悄裁。 */
#rtc-stage-video video { object-fit: contain !important; background: #000; }
/* 悬浮圆形控件（豆包那种：半透明、圆、压在画面上） */
.mode-page-bar {
  position: absolute;
  left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.mode-btn-round {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .17);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform .12s ease, background .15s ease;
}
.mode-btn-round:active { transform: scale(.94); }
.mode-btn-round.is-primary { background: #fff; color: #111; }
.mode-btn-round.mode-x {
  position: absolute;
  right: 14px;
  top: max(14px, env(safe-area-inset-top));
  width: 44px; height: 44px;
  font-size: 17px;
  background: rgba(0, 0, 0, .38);
}
.mode-hint {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 74px);
  z-index: 9;
  text-align: center;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
  pointer-events: none;
}

/* ===== 「游记 / 手账」的靠前页面（2026-10-01 用户要求：做一个靠前的页面将二者分开）=====
   顶栏那两个图标长得像，与其让用户猜，不如点进去先选。 */
.content-page {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 10, 16, .62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.content-card-wrap {
  position: relative;
  width: min(94vw, 520px);
  background: var(--surface, #fff);
  color: var(--ink, #222);
  border-radius: 16px;
  padding: 18px 16px 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
}
.content-head { margin: 0 0 12px; padding-right: 34px; }
.content-title { display: block; font-size: 17px; }
.content-sub { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft, #666); }
.content-close {
  position: absolute; right: 10px; top: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; cursor: pointer; font: inherit; font-size: 15px;
  background: transparent; color: var(--ink-soft, #666);
}
.content-item {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  margin: 0 0 10px; padding: 13px 13px;
  border: 1px solid var(--border, #e6e2dc); border-radius: 13px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.content-item:active { transform: scale(.995); }
.content-glyph { font-size: 26px; line-height: 1.1; }
.content-text { display: block; flex: 1; }
.content-item-title { display: block; font-size: 15.5px; font-weight: 700; }
.content-tag {
  float: right; font-size: 11.5px; font-weight: 400; color: var(--accent, #b3542f);
}
.content-item-desc {
  display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.6;
  color: var(--ink-soft, #666);
}

/* 顶栏多了「对话历史」之后，窄屏上会挤。
   让账号名先让位（它本来就只是个标识，不是操作）。 */
@media (max-width: 400px) {
  .topbar-actions { gap: 5px; }
  .user-chip { max-width: 58px; padding: 7px 8px; }
}

/* 更窄的屏（390px 这一档）：5 个 44px 图标 + 账号名已经挤满了。
   实测再加任何东西都会把最右边的「设置」挤出屏幕（被 .app 裁掉一半），
   所以这里把账号按钮收起来 —— 它不是消失，退出登录在「设置」面板里有。 */
@media (max-width: 430px) {
  .topbar-actions { gap: 4px; }
  .user-chip { display: none; }
  .place-label { max-width: 96px; }
}

.user-chip {
  max-width: 96px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 登录 ---------- */
.auth {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.auth[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.auth-card h2 { margin: 0; font-size: 18px; font-weight: 600; }
.auth-sub { margin: -6px 0 4px; font-size: 12.5px; color: var(--ink-soft); }
.auth-card input {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
}
.auth-card .call-btn { min-width: 0; width: 100%; }
.auth-card .ghost-btn { width: 100%; }
.auth-seal {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 2px;
  filter: var(--glow-seal);
}
.auth-error { margin: 0; min-height: 16px; font-size: 12.5px; color: var(--danger); }

/* ---------- 知识库管理 ---------- */
.admin-app { max-width: 920px; }
.tabs {
  flex: none;
  display: flex;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--accent-ink); }

.kb-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.kb-panel[hidden] { display: none; }
.kb-panel h3 {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.kb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-row select, .kb-row input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
}
.kb-hint { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.kb-hint code { background: var(--surface-sunken); padding: 1px 5px; border-radius: 4px; }
.kb-status { flex: none; margin: 0; font-size: 12.5px; color: var(--accent); min-height: 16px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }

.kb-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kb-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.kb-item-title { font-weight: 600; font-size: 14px; }
.kb-item-meta { font-size: 11.5px; color: var(--ink-soft); }
.kb-item-body { font-size: 13px; line-height: 1.6; color: var(--ink-body); max-height: 84px; overflow: hidden; }
.kb-item-actions { display: flex; gap: 6px; }
.mini-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}
.mini-btn.danger { color: var(--danger); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea, .form-grid select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
}
.kb-panel textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}
.ghost-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 游记弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 84vh;
  background: var(--card);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-body);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* 游记弹层：内容自带行内样式（要能原样粘进公众号），这里只清掉父级干扰 */
#journal-content { white-space: normal; padding: 0; font-size: 15px; }
#journal-content a { color: inherit; }
.modal-foot { flex-wrap: wrap; }

/* 游记版式选择器：靠左（其余按钮靠右），窄屏会换行到第一行 */
.journal-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.journal-theme select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  max-width: 9.5em;
}

/* ---------- 对话历史 ---------- */
#history-body { white-space: normal; padding: 8px 10px 16px; }
.conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.conv-row:hover { background: var(--accent-tint); }
.conv-main { flex: 1; min-width: 0; }
.conv-title {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta { margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.conv-del {
  flex: none;
  font-size: 12px;
  color: var(--danger);
  padding: 4px 8px;
  border-radius: 8px;
}
.conv-del:hover { background: rgba(192, 84, 47, .12); }
.conv-detail {
  margin: 2px 8px 14px;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface-sunken);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.7;
}
.conv-msg { margin: 0 0 10px; }
.conv-msg:last-child { margin-bottom: 0; }
.conv-msg.user { color: var(--accent); }
.conv-msg.ai { color: var(--ink-body); }

/* 对话记录 / 我的游记 两个页签。
   游记以前生成完就找不回来了 —— 后端一直有列表接口，只是界面上没入口。 */
.hist-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.hist-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hist-tab:hover { background: var(--accent-tint); }
.hist-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.hist-journal-tools { margin-top: 12px; display: flex; gap: 8px; }
.settings-links { display: flex; gap: 8px; }
.settings-links .ghost-btn { flex: 1; text-align: center; text-decoration: none; line-height: 1.6; }
/* ---------- 面板里的标签页（讲解点 / 资讯）---------- */
.modal-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.modal-tab {
  padding: 9px 12px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.modal-tab:hover { color: var(--accent); }
/* ---------- 讲解点面板 ---------- */
/* modal-body 默认是 pre-wrap，列表要按普通流排版 */
#points-body { white-space: normal; padding: 10px 10px 16px; }
.points-empty { margin: 14px 8px; font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); }
.points-progress { margin: 6px 12px 10px; font-size: 12.5px; color: var(--ink-soft); }
.points-group {
  margin: 16px 12px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .6px;
}
.point-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}
.point-row:hover { background: var(--accent-tint); }
.point-row:active { transform: scale(.985); }
.point-title { flex: 1; min-width: 0; }
.point-go { flex: none; font-size: 12px; color: var(--accent); white-space: nowrap; }
.point-row.heard .point-title { color: var(--ink-soft); }
.point-row.heard .point-title::before { content: '✓ '; color: var(--accent); }
.point-row.heard .point-go { color: var(--ink-mute); }

/* ---------- 讲解点的配图 ----------
   图放标题前面：用户站在现场，第一眼要确认的是「我眼前这东西
   和词条里讲的是不是同一个」—— 图比文字快。
   图**只出现一次**：早先版本在行内缩略图下面又放了一条含同一张图的「配图带」，
   同一张图相距 60px 出现两遍，看着像渲染 bug（断言全绿，只有截图上能看出来）。
   署名单独一行小字：CC BY / CC BY-SA 要求署名，这不是可选项。 */
.point-item { display: flex; align-items: flex-start; gap: 8px; }
.point-text { flex: 1; min-width: 0; }
.point-thumb-btn {
  flex: none;
  width: 76px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--accent-tint);
  cursor: zoom-in;
}
.point-thumb-btn:active { transform: scale(.97); }
.point-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.point-thumb-broken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  color: var(--ink-mute);
}
/* 署名和标题在同一个 .point-text 里，左边缘天然对齐（不写死 margin 去凑）。
 * padding-left 必须和 .point-row 的保持一致 —— 差 4px 就是"看着有点歪、
 * 说不上哪不对"的那种排版问题，只有量出来（或盯着图看很久）才发现。 */
.point-credit {
  margin: -2px 0 8px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-mute);
}
.point-src { color: var(--accent); text-decoration: none; }
.point-src:hover { text-decoration: underline; }
/* 有缩略图时标题不用再留一份左内边距（图已经隔开了）；署名跟着一起收窄 */
.point-thumb-btn + .point-text .point-row,
.point-thumb-btn + .point-text .point-credit { padding-left: 4px; }

/* 大图查看 */
.media-card { max-width: 560px; }
.media-img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
  background: var(--accent-tint);
}
.media-cap { margin: 10px 2px 4px; font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.media-credit { margin: 0 2px; font-size: 12px; color: var(--ink-soft); }
.media-link { display: inline-block; margin: 6px 2px 0; font-size: 12px; color: var(--accent); }
.media-note {
  margin: 12px 2px 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-mute);
}

/* ---------- 资讯面板（会过期的那类信息）----------
   视觉上刻意和讲解点区分：讲解点是「点一下听」，资讯是「读一眼再决定」，
   所以用卡片而不是单行按钮，并且每条都带状态标记。 */
#notices-body { white-space: normal; padding: 10px 10px 16px; }
.notice-group { display: flex; align-items: center; justify-content: space-between; }
.notice-group-toggle { cursor: pointer; }
.notice-toggle { font-size: 12px; font-weight: 400; color: var(--accent); }
.notice-hint {
  margin: 2px 12px 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.notice-row {
  margin: 0 4px 8px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--card);
  border-left: 3px solid var(--line);
}
.notice-active { border-left-color: #2f8f5b; }
.notice-fresh { border-left-color: #2f8f5b; }
.notice-upcoming { border-left-color: #3b7dd8; }
.notice-stale { border-left-color: #c98a1b; }
.notice-expired { border-left-color: var(--ink-mute); opacity: .78; }
.notice-head { display: flex; align-items: baseline; gap: 8px; }
.notice-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.notice-flag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  background: var(--accent-tint);
  color: var(--ink-soft);
}
.notice-flag-active { background: #e3f3e9; color: #1f6b43; }
.notice-flag-fresh { background: #e3f3e9; color: #1f6b43; }
.notice-flag-upcoming { background: #e6effb; color: #2b5ea8; }
.notice-flag-stale { background: #fbf1dc; color: #8a5c05; }
.notice-flag-expired { background: var(--accent-tint); color: var(--ink-mute); }
.notice-meta { margin-top: 3px; font-size: 11.5px; color: var(--ink-mute); }
.notice-meta-warn { color: #8a5c05; }
.notice-text { margin: 6px 0 0; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.notice-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
}
.notice-src { flex: 1; min-width: 0; color: var(--ink-mute); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-src:hover { text-decoration: underline; }
.notice-ask {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
}
.notice-ask:hover { background: var(--accent-tint); }
.notice-note {
  margin: 14px 12px 2px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-mute);
}
/* 出处旁边的时效标记：答案里引了过期资料，用户要能一眼看出来 */
.ref-flag {
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10.5px;
  background: #fbf1dc;
  color: #8a5c05;
}
.ref-expired { background: var(--accent-tint); color: var(--ink-mute); }

/* ---------- 账号与数据 ---------- */
.account-note {
  margin: 10px 2px 2px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.account-note.err { color: #b3261e; }
.account-note.ok { color: #1f6b43; }
.account-note.danger { color: #b3261e; }
.danger-btn { color: #b3261e; border-color: rgba(179, 38, 30, .35); }
.danger-btn:hover { background: rgba(179, 38, 30, .08); }
.link-btn {
  margin-top: 8px;
  padding: 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { opacity: .8; }
/* 重置码要一眼看清、方便抄：等宽 + 大字 + 可选中 */
.reset-code {
  font-family: Consolas, monospace;
  font-size: 19px;
  letter-spacing: 1.5px;
  color: var(--ink);
  user-select: all;
  margin: 6px 0;
}
#account-body { white-space: normal; padding: 12px 12px 4px; }
#account-body input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  box-sizing: border-box;
}

/* ---------- 夜间模式 ----------
   有了 token 体系，深色只需要重映射一遍变量，不用重写任何组件样式。 */
:root[data-theme="dark"] {
  --bg: #14120e;
  --card: #1d1a15;
  --surface: #262119;
  --surface-sunken: #2a2419;
  --accent-tint: #302818;
  --stage: #0b0a09;

  --ink: #f3ece0;
  --ink-body: #ded5c4;
  --ink-soft: #a79c88;
  --ink-mute: #8b8271;

  --accent: #d8b06a;
  --accent-ink: #1b1710;
  --border: #3a3324;
  --danger: #d9734d;
  --success: #57ab7c;

  --overlay: rgba(0, 0, 0, .66);
  --sub-bg: rgba(22, 20, 16, .95);
  --sub-ink: #f3ece0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-card: 0 10px 34px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, .6);
}
/* 深色下纯白输入框会刺眼，用略深的纸面 */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { color-scheme: dark; }
.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.ghost-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 次级按钮与用户标签：统一的按下反馈 + 过渡 */
.ghost-btn, .mini-btn, .user-chip {
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.ghost-btn:not(:disabled):active,
.mini-btn:not(:disabled):active,
.user-chip:active { transform: scale(.96); }
.user-chip { min-height: 40px; }

@media (max-width: 560px) {
  .settings { grid-template-columns: 1fr; }
  .call-btn { min-width: 140px; }

  /* 竖屏上 4:3 那块太占地方，压扁一点；空状态内容同步缩小 */
  .stage { aspect-ratio: 3 / 2; }
  .ph-art { width: 74px; height: 74px; }
  .ph-title { font-size: 14px; }
  .ph-hint { font-size: 12px; }

  /* 通话中进入沉浸模式：视频铺满，收起聊天列表与输入框。
     消息照常写入会话，只是通话时不显示 —— 挂断后完整记录还在聊天里。 */
  body.in-call .chat,
  body.in-call .composer,
  body.in-call .settings { display: none; }
  body.in-call .stage {
    flex: 1 1 auto;
    aspect-ratio: auto;
    min-height: 0;
  }
}


/* ===== 视频页的对话气泡（微信式：左=它，右=我）2026-10-01 ===== */
.mode-chat {
  position: absolute;
  left: 12px; right: 12px;
  top: 22%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 92px);
  overflow-y: auto;
  z-index: 8;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;      /* 新消息贴底，往上长 */
  gap: 8px;
  padding: 2px 2px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 顶部渐隐：滚上去的旧消息自然淡出（参考图那种层次感） */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 100%);
}
.mode-chat::-webkit-scrollbar { display: none; }
.mode-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.62;
  word-break: break-word;
  white-space: pre-wrap;
  color: #fff;
  background: rgba(18, 16, 20, .58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  align-self: flex-start;          /* 左：它 */
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.mode-bubble.me {
  align-self: flex-end;            /* 右：我（A 方案下暂时用不到） */
  background: rgba(176, 84, 47, .82);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 6px;
}
.mode-bubble.pending { opacity: .85; }
/* 越旧的越淡（参考图里上面那几行是灰的） */
.mode-bubble:not(:last-child) { opacity: .72; }
.mode-bubble.pending::after {
  content: '…';
  opacity: .55;
}


/* ============================================================
   手机端排布修订（2026-10-01 用户实机反馈）
   问题：① 顶栏五个图标大小/重量不匀、左上角「通用闲聊（」被图标切掉；
        ② 底栏两个圆按钮（✨ 讲解 / 📷 收进手账）与两个胶囊不同高不同色；
        ③ 多余的摄像头开关在手机上**画出来了**（属性上是 hidden，被 .ctrl-btn 的 display 覆盖）；
        ④ 语音模式的字幕挤在下半部，且被底栏按钮压住（参考豆包：占中部、上下留白）。
   这里的规则放在 .mode-chat 之后，同权重时后写的胜出，便于与旧规则共存/回退。
   ============================================================ */

/* ① 顶栏：标题可收缩、超长省略号，绝不与图标重叠 */
.topbar { gap: 8px; }
.brand { min-width: 0; flex: 1 1 auto; }
.brand-text { min-width: 0; overflow: hidden; }
.brand h1 { white-space: nowrap; }
.place-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { flex: 0 0 auto; }

/* ② 顶栏图标统一视觉重量：同盒同尺寸（原来每个 svg 各写各的，看着不齐） */
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 22px; height: 22px; }

/* ③ 底栏里标记 hidden 的按钮必须真的不显示。
      #cam-btn 在 HTML 上是 hidden，但 .ctrl-btn 设了 display，把它画了出来 ——
      手机上最右那个相机按钮就是它（用户：「中间那个摄像头开关可以去掉」）。 */
.controls .ctrl-btn[hidden] { display: none !important; }

/* ④ 底栏对齐：两个胶囊与两个圆按钮同高、同中线 */
.controls { display: flex; align-items: center; gap: 10px; }
.call-btn, .ctrl-btn { height: 46px; }
.ctrl-btn { width: 46px; height: 46px; border-radius: 50%; }

/* ⑤ 字幕：抬到底栏之上、垂直居中、卡片式（不再被 🎤/📷/字 压住） */
.subtitles {
  bottom: calc(46px + max(14px, env(safe-area-inset-bottom)) + 26px);
  max-height: 46vh;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 0 12px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 88%, transparent 100%);
}
.sub { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.6; }
.sub-ai { align-self: flex-start; background: rgba(30, 28, 26, .78); color: #f5efe6; }
.sub-user { align-self: flex-end; background: rgba(196, 120, 60, .86); color: #fff; }

/* ⑥ 视频模式的聊天区同样抬到底栏之上并居中（原来贴底、内容挤在下半部） */
.mode-chat {
  bottom: calc(46px + max(14px, env(safe-area-inset-bottom)) + 92px);
  justify-content: center;
  padding: 0 4px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

/* ===== 清掉旧版遗留（2026-10-01 用户指出）=====
   整屏模式下隐藏改造前的旧控件：
   · #rtc-stop（「结束视频通话」药丸）—— 压在悬浮控件下，点了没反应；
   · #rtc-flip（旧切换按钮）—— 悬浮条里已有 ⟳；
   · #rtc-status（旧状态条）—— 已有气泡，重复。
   保留 DOM（mode-pages 的 stopVideo / flipCamera 还要点它们）。 */
.stage.is-fullscreen #rtc-stop,
.stage.is-fullscreen #rtc-flip,
.stage.is-fullscreen #rtc-status { display: none !important; }


/* ===== 麦克风/摄像头「已关闭」态（画一道斜杠，像豆包那样）2026-10-01 ===== */
.mode-btn-round.is-off {
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .55);
}
.mode-btn-round.is-off::after {
  content: '';
  position: absolute;
  width: 34px; height: 2px;
  background: #ff4d4f;
  border-radius: 2px;
  transform: rotate(-45deg);
}
.mode-btn-round { position: relative; }          /* 给斜杠定位 */
/* 开关的一句小提示 */
.mode-toast {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 150px);
  z-index: 10;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}


/* 「切回这段」按钮（与「删除」并列，2026-10-01） */
.conv-use {
  flex: none;
  align-self: center;
  margin-right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #fff;
  background: var(--accent, #b3542f);
  cursor: pointer;
  white-space: nowrap;
}
.conv-use:active { transform: scale(.97); }


/* 「＋ 开始新对话」（2026-10-03）：放在历史面板顶部，和「切回这段」互补 */
.conv-new {
  display: block;
  width: calc(100% - 24px);
  margin: 10px 12px 4px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(179, 84, 47, .55);
  background: rgba(179, 84, 47, .08);
  color: var(--accent, #b3542f);
  font-size: 14px;
  cursor: pointer;
}
.conv-new:active { transform: scale(.99); }
