:root {
  --brand: #c94e22;
  --brand-dark: #a83f1b;
  --bg: #f8f7f4;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #999999;
  --border: #eeeeee;
  --line: #e9e1d8;
  --chat-font: 15px;
  --ai-bubble: #f3ede9;
  --ai-text-muted: #8a857f;
  --avatar-bg: #e8e2db;
  --code-bg: #f0eae4;
  --code-fg: #b23b2e;
  --pre-bg: #f5f2ef;
  --ink: #1d1d1d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  overflow-x: hidden;   /* 防横向溢出：内容被挤宽时不往右变形/出现横向滚动 */
  max-width: 100%;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
  color: #fff;
}
/* 顶栏全站渲染：移动端非首页隐藏它（导航走底部 tabbar），首页保留品牌栏；桌面端全站显示 → 任意页都有三页导航 */
@media (max-width: 899.98px) {
  .topbar { display: none; }
}
body.on-home .topbar { display: block; }
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: none; gap: 24px; }
.nav-links a { color: #fff; font-size: 15px; text-decoration: none; opacity: 0.9; }
.nav-links a.active { opacity: 1; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.phone { font-size: 13px; opacity: 0.9; }
.logout { color: #fff; font-size: 13px; text-decoration: none; opacity: 0.9; }

/* 主容器 */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--brand);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title-row .card-title { margin-bottom: 0; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand);
  background: #fff;
}
textarea { resize: vertical; }

/* 重点强调的「选题 / 内容」框 */
.field.focus-field {
  border: 1.5px solid var(--brand);
  border-radius: 10px;
  padding: 12px;
  background: rgba(201, 78, 34, 0.04);
}
.field.focus-field label { color: var(--brand); font-weight: 600; }
.field.focus-field textarea { background: #fff; min-height: 118px; }

.radio-row { display: flex; gap: 20px; padding: 4px 0; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text); margin: 0; }
.radio-row input[type="radio"] { accent-color: var(--brand); width: auto; }

/* 内容类型 × 推广平台：两级横排 tab */
.tab-group { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.tab-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line, #e3dcd3);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab-chip:hover { border-color: var(--brand); color: var(--brand); }
.tab-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 按钮 */
.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }

.btn-send {
  flex-shrink: 0;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-copy {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
}

.btn-del {
  background: none;
  color: #c0392b;
  border: none;
  font-size: 13px;
  cursor: pointer;
  /* 原来 2px 4px → 手机上实测命中区 34×21（历史卡片右上角）。它旁边没有别的东西，
     但「删除」是个**破坏性**操作：点不准的代价是误删，比点不到更糟。撑到 ~28px 高。 */
  padding: 6px 8px;
  border-radius: 6px;
}

.btn-mini {
  color: var(--brand);
  font-size: 13px;
  text-decoration: none;
  /* 4px 8px → 手机上 27px 高。这一排（编辑/删除/去对聊…）是「我的」页唯一的操作入口，
     手指够得着的下限约 28px（Apple 建议 44，但那是整屏只有一个主按钮时的标准）。 */
  padding: 6px 10px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  margin-left: 6px;
}
.btn-mini-del { color: #c0392b; border-color: #c0392b; }
.btn-mini-plain { color: #6f5c4b; border-color: #d8cabc; background: #faf6f0; }

.btn-plain {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
}

.code-row { display: flex; gap: 10px; }
.loc-row { display: flex; gap: 10px; }
.loc-row input { flex: 1; }
.loc-row .btn-send { padding: 10px 16px; }

/* 上传产品/门店图 */
.up-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.up-thumb {
  position: relative;
  width: 82px; height: 82px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line, #eee);
}
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  background: rgba(0,0,0,0.55); color: #fff; border-radius: 50%;
  font-size: 15px; cursor: pointer; user-select: none;
}
.up-row { display: flex; align-items: center; gap: 12px; }

/* 继续修改（续写）输入行 */
/* 豆包式输入条 pill */
.revise-row {
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 24px;
  padding: 5px 10px;
}
.revise-row input {
  flex: 1; min-width: 0; padding: 9px 4px; font-size: 15px;
  border: none; background: transparent; color: var(--text);
  outline: none; font-family: inherit;
}
.revise-row input:focus { border: none; background: transparent; }
.bar-btn {
  flex-shrink: 0; width: 38px; height: 38px; border: none; background: transparent;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #5f5f5f;
}
.bar-btn:hover { background: #f2f2f2; }
.bar-btn svg { width: 22px; height: 22px; fill: currentColor; }
.bar-send { background: var(--brand); color: #fff; }
.bar-send:hover { background: var(--brand); }
.bar-send svg { fill: #fff; }
.bar-send:disabled { opacity: 0.4; cursor: not-allowed; }
/* 「每次问 / 自动」模式胶囊（B6，2026-10-12）：输入条最左边那颗两态小键。
   刻意不复用 .bar-btn —— 那是 38×38 的圆形图标按钮，这是带字的小胶囊。 */
.ui-mode-pill {
  flex-shrink: 0; height: 30px; min-width: 62px; padding: 0 11px; margin-right: 2px;
  text-align: center; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 15px; background: transparent;
  color: #5f5f5f; font-size: 12px; font-family: inherit; line-height: 28px;
  cursor: pointer; white-space: nowrap;
}
.ui-mode-pill:hover { background: #f2f2f2; }
.ui-mode-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ui-mode-pill.on:hover { background: var(--brand); }
.bar-plus svg { fill: #5f5f5f; }
/* 语音「按住说话」条 */
.voice-bar {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-top: 8px; height: 50px; font-size: 15px; font-weight: 600;
  background: #fff; border: 1px solid var(--brand); border-radius: 25px;
  color: var(--brand); cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.voice-bar:active { background: #fdf0e8; }
.voice-bar.recording { background: #fdf0e8; border-color: #e0392b; color: #e0392b; }
.voice-kb { position: absolute; right: 12px; border: none; background: transparent; font-size: 18px; cursor: pointer; }
/* 更多功能弹层（+ 号） */
.more-mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.16); }
.more-menu {
  position: fixed; left: 12px; right: 12px; bottom: 92px; z-index: 41;
  background: #fff; border-radius: 16px; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.more-menu .fn-chip { margin: 0; }
#reviseLog { margin-top: 10px; }
#reviseLog div { margin-top: 4px; }

/* 底部标签栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  height: 56px;
  z-index: 10;
}
.tabbar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  text-decoration: none;
  font-size: 15px;
}
.tabbar a.active { color: var(--brand); font-weight: 700; }
/* 闪电 C 位中心圆（不超出导航栏，避免盖住输入框；用猫掌图标） */
.tabbar a.tabbar-center { flex-direction: column; justify-content: center; gap: 1px; }
.tabbar-orb {
  width: 38px; height: 38px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--brand, #c94e22);
  color: #fff;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}
.tabbar a.active .tabbar-orb { background: #a83e19; }
.tabbar-orb-lab { font-size: 11px; margin-top: 1px; }

/* 首页：闪电能力 · 多行展开（不横向滑动） */
.cap-card {
  background: #fff;
  border: 1px solid var(--line, #e3dcd3);
  border-radius: 18px;
  padding: 10px 8px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  margin-bottom: 8px;
}
.cap-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 2px;
}
.cap-chip {
  width: 100%; box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fdf6f0;
  color: var(--text);
  border: 1px solid var(--line, #e3dcd3);
  border-radius: 999px;
  padding: 9px 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
}
.cap-chip:hover { border-color: var(--brand); color: var(--brand); }
.cap-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cap-emoji { font-size: 15px; }

/* 写文案页左上角三条杠（历史抽屉） */
.app-menu {
  position: fixed;
  top: 66px; left: 14px;
  z-index: 20;
  width: 40px; height: 40px;
  background: #fdf6f0; color: var(--text);
  border: 1px solid var(--line, #e3dcd3); border-radius: 10px;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.app-menu:hover { border-color: var(--brand); color: var(--brand); }
.hist-item { padding: 12px; border: 1px solid #f0eae4; border-radius: 12px; margin-bottom: 10px; background: #fff; }
.hist-item-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.hist-item-del { cursor: pointer; font-size: 16px; padding: 0 4px; color: var(--muted); }
.hist-item-del:hover { color: #e0524a; }
.hist-item-prod { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 6px; }
.hist-item-hook { font-size: 13px; color: #6b6560; margin-top: 4px; line-height: 1.5; }
.hist-item-actions { display: flex; gap: 8px; margin-top: 10px; }
.hist-item-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f0eae4; }
.hist-row { display: flex; gap: 8px; font-size: 13px; margin: 4px 0; }
.hist-label { flex: none; width: 78px; color: var(--muted); }
.hist-val { flex: 1; color: var(--text); word-break: break-word; white-space: pre-wrap; line-height: 1.5; }
.hist-script { font-variant-ligatures: none; }

/* 写文案双模式切换 */
.mode-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px;
  background: #f2ede7;
  border-radius: 999px;
}
.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
}
.mode-btn.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* agent 写文案卡 */
.copy-card { cursor: pointer; color: var(--brand); font-weight: 600; }
.copy-card:hover { border-color: var(--brand); }

/* 提示 */
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }
.empty a { color: var(--brand); }

/* 登录页 */
.login-body { background: var(--brand); min-height: 100vh; }
.login-box {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 24px;
  background: var(--bg);
  border-radius: 16px;
  margin-top: 12vh;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.login-logo { font-size: 28px; font-weight: 800; color: var(--brand); text-align: center; letter-spacing: 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login-back { display: inline-block; color: var(--brand); font-size: 14px; text-decoration: none; margin-bottom: 8px; }

/* 登录方式切换 */
.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.login-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.login-tab.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* 结果区 */
.result-text { white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.script-text { white-space: pre-wrap; line-height: 1.8; font-size: 15px; }
.result-tags { white-space: pre-wrap; line-height: 1.7; font-size: 15px; color: var(--brand); margin-top: 2px; }
.hist-tags { color: var(--brand); line-height: 1.6; margin-top: 2px; }
.ai-badge { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 16px; }

/* 生成进度分步 */
.prog {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
}
.prog-step {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s;
}
.prog-step.on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}
.prog-arrow { color: var(--muted); font-style: normal; font-size: 13px; }

/* 结果区操作栏：一键复制全部 / 换个思路重写 */
.result-bar { display: flex; gap: 12px; margin-bottom: 14px; }
.ver-badge {
  align-self: center;
  color: var(--brand);
  background: rgba(201, 78, 34, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  flex: 0 0 auto;
  margin-right: auto;
}
.result-bar .btn-copy { margin-top: 0; flex: 1; text-align: center; background: var(--brand); border-color: var(--brand); color: #fff; padding: 11px 14px; border-radius: 10px; font-size: 15px; }
.result-bar .btn-copy:last-child { background: #fff; color: var(--brand); }

/* 历史 */
.hist-item { margin-bottom: 12px; }
.hist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hist-time { color: var(--muted); font-size: 12px; }
.hist-product { font-weight: 600; font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-preview { color: #555; font-size: 14px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-toggle { margin-top: 8px; }
.hist-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eee; }
.hist-row { margin-bottom: 10px; }
.hist-row .btn-copy { margin-top: 2px; }
.hist-label { color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.hist-val { color: #222; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.hist-row-script .hist-val { line-height: 1.8; }

/* 超长字段二次折叠展开（历史详情里的产品/提示词等） */
.hist-clamp.clamped { max-height: 104px; overflow: hidden; }
.hist-clamp.clamped.expanded { max-height: none; overflow: visible; }
.hist-clamp-toggle { margin-top: 6px; }

/* 商家列表 */
.merchant-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.merchant-item:last-child { border-bottom: none; }
.merchant-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.merchant-info { flex: 1; min-width: 0; }
.merchant-name { font-weight: 600; font-size: 15px; }
.merchant-preview { color: #555; font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-toggle { flex-shrink: 0; margin-top: 2px; }
.merchant-ops { margin-top: 6px; display: flex; gap: 8px; }
.merchant-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eee; }
.merchant-row { margin-bottom: 8px; }
.merchant-row .hist-val { color: #222; font-size: 14px; line-height: 1.6; }

/* 访客记录（管理员） */
.rec-list { display: flex; flex-direction: column; }
.rec-row { display: grid; grid-template-columns: 1.4fr 0.6fr 1fr 1fr; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--border); color: #222; text-decoration: none; align-items: center; font-size: 14px; }
.rec-row.rec-head { color: var(--muted); font-size: 12px; padding-bottom: 6px; }
.rec-row:not(.rec-head):active { background: rgba(201, 78, 34, 0.06); }
.rec-phone { font-weight: 600; }
.rec-cnt { color: var(--brand); text-align: center; }
.rec-active, .rec-time { color: #555; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; }

/* 弹层 */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.form-panel {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px 24px;
}
.form-panel h3 { margin: 0 0 16px; color: var(--brand); font-size: 17px; }
.form-ops { display: flex; gap: 12px; margin-top: 16px; }
.form-ops .btn-primary { flex: 1; }

/* 商家画像提示条：没建过画像时提醒去建 */
.merchant-hint {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(201, 78, 34, 0.08); border: 1px solid rgba(201, 78, 34, 0.22);
  color: #a0441f; font-size: 13px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.merchant-hint-close {
  flex: none; background: transparent; border: none; color: inherit;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; margin-left: auto;
}

/* 闪电拿不准反问弹窗 */
.ask-q { font-size: 15px; font-weight: 700; color: #222; line-height: 1.5; margin: 4px 0 10px; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt {
  background: #fff; color: var(--brand); border: 1px solid var(--brand);
  border-radius: 20px; padding: 8px 16px; font-size: 14px; cursor: pointer;
}
.ask-opt:active { background: var(--brand); color: #fff; }
.ask-opt.sel { background: var(--brand); color: #fff; }
.ask-item + .ask-item { border-top: 1px solid #f0f0f0; margin-top: 12px; padding-top: 14px; }
.ask-custom {
  width: 100%; box-sizing: border-box; margin-top: 10px;
  border: 1px solid #ddd; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-family: inherit;
}
.ask-custom:focus { outline: none; border-color: var(--brand); }

/* 意见反馈（管理员收集） */
.fb-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.fb-item:last-child { border-bottom: none; }
.fb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.fb-phone { font-weight: 600; color: #222; font-size: 15px; }
.fb-time { color: var(--muted); font-size: 13px; }
.fb-content { font-size: 15px; color: #333; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.fb-contact { margin-top: 6px; font-size: 13px; color: var(--brand); }

/* 未登录提醒弹窗 */
#loginMask { align-items: center; }
.auth-box {
  width: 86%;
  max-width: 340px;
  background: #fff;
  border-radius: 16px;
  padding: 26px 20px 22px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.auth-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.auth-desc { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 20px; }
.auth-ops { display: flex; gap: 12px; }
.auth-ops .btn-primary, .auth-ops .btn-plain { flex: 1; }

/* Toast */
#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 80vw;
  text-align: center;
}
#toast.show { opacity: 1; }

/* 响应式栅格：手机单列，桌面双栏 */
.form-grid { display: block; }
.hist-grid { display: block; }
.card-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .tabbar { display: none; }
  .container { max-width: 960px; }
  /* 桌面有顶栏(52px 粘顶) + 无底部导航：聊天页占满剩余高度，底部留 16px，不整页滚动 */
  .chat-page { height: calc(100dvh - 68px); }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .form-grid .card { margin-bottom: 0; }
  .hist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .hist-grid .card { margin-bottom: 0; }
}

