:root{
  /* ===== 品牌紫（PRD 主色，整体压深一档，同色系不换色相） ===== */
  --brand-a:#5b54cf;
  --brand-b:#4a3fb0;
  --grad:linear-gradient(135deg,#5b54cf 0%,#4a3fb0 100%);
  --grad-btn:linear-gradient(135deg,#5b54cf 0%,#5b54cf 100%);
  /* CTA 主按钮：同色系最深档，白字对比度 ≥7:1，满足 WCAG AA */
  --grad-cta:linear-gradient(135deg,#4a3fb0 0%,#3d2f99 100%);
  --brand-soft:#eef0fe;

  /* 兼容旧引用（对话页/分享卡片沿用名） */
  --c-primary:var(--brand-a);
  --c-primary-hover:var(--brand-b);
  --c-primary-soft:var(--brand-soft);
  --c-violet:var(--brand-b);

  /* 三专家代表色（具名大佬，抽象头像，合规禁真实照片） */
  --e-jobs:#6d5ef0;
  --e-musk:#0e7490;
  --e-leijun:#e03131;
  /* 旧匿名三人格别名，保留兼容（对话页专家默认左边框色） */
  --e-reason:var(--e-jobs);
  --e-practical:var(--e-musk);
  --e-empathy:var(--e-leijun);

  /* 中性色阶 */
  --n-0:#ffffff; --n-50:#f6f7fb; --n-100:#eef0f5; --n-200:#e2e5ee;
  --n-300:#cdd2e0; --n-400:#9aa1b4; --n-500:#6b7283; --n-600:#4b5163;
  --n-700:#363c4d; --n-800:#232838; --n-900:#141824;

  --text:#1f2433; --text-2:#565f73; --border:#e4e7f0;
  --surface:#ffffff; --bg:#f6f7fb;

  /* 微信绿（首页/对话点缀，PRD 要求用户气泡为绿，对话页气泡见 .msg.user） */
  --wx-green:#95EC69;

  /* 阴影 */
  --sh-sm:0 1px 2px rgba(20,24,40,.05);
  --sh-md:0 6px 18px rgba(79,70,229,.08),0 2px 6px rgba(20,24,40,.05);
  --sh-lg:0 16px 40px rgba(79,70,229,.16);

  /* 圆角 / 间距 / 字号 */
  --r-sm:12px; --r-md:16px; --r-lg:22px; --r-xl:24px; --r-pill:999px;
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:20px; --s-6:24px; --s-8:32px;
  --fs-12:12px; --fs-13:13px; --fs-14:14px; --fs-15:15px; --fs-16:16px; --fs-17:17px;
  --fs-18:18px; --fs-20:20px; --fs-24:24px; --fs-28:28px; --fs-32:32px;
  --tap:48px;

  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
}

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

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  background-image:
    radial-gradient(720px 420px at 12% -6%, rgba(102, 126, 234, .10), transparent 60%),
    radial-gradient(620px 420px at 92% 4%, rgba(118, 75, 162, .08), transparent 60%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.view { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ===================== 首页容器 ===================== */
.home { padding: 0; }
.phone {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  padding: 0 var(--s-4) calc(env(safe-area-inset-bottom, 0) + var(--s-6));
  display: flex; flex-direction: column;
  background-image:
    radial-gradient(720px 420px at 12% -6%, rgba(102, 126, 234, .08), transparent 60%),
    radial-gradient(620px 420px at 92% 4%, rgba(118, 75, 162, .06), transparent 60%);
}

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: var(--s-5) 0 var(--s-2); }
.brand { display: flex; align-items: center; gap: var(--s-2); }
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-size: 20px; font-weight: 800; background: var(--grad);
  box-shadow: 0 6px 16px rgba(102, 126, 234, .34), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.logo img { width: 100%; height: 100%; display: block; border-radius: 12px; }
.wordmark { font-size: var(--fs-18); font-weight: 800; letter-spacing: .3px; line-height: 1.1; }
.wordmark small { display: block; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); letter-spacing: .5px; }
.icon-btn {
  width: var(--tap); height: var(--tap); border: none; background: transparent;
  border-radius: var(--r-pill); color: var(--n-600); font-size: 20px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s ease;
}
.icon-btn:hover { background: var(--n-100); }
.icon-btn:active { background: var(--n-200); }

main { flex: 1; display: flex; flex-direction: column; padding: var(--s-3) 0 var(--s-2); animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Hero */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); align-self: flex-start;
  font-size: var(--fs-13); color: var(--brand-b); font-weight: 700;
  background: var(--brand-soft); padding: 6px 13px; border-radius: var(--r-pill); margin-bottom: var(--s-4);
}
.experts { display: inline-flex; gap: 5px; margin-left: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.j { background: var(--e-jobs); } .dot.m { background: var(--e-musk); } .dot.l { background: var(--e-leijun); }
h1 { font-size: var(--fs-28); line-height: 1.32; margin: 0 0 var(--s-3); letter-spacing: .2px; font-weight: 800; }
h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: var(--fs-16); color: var(--text-2); margin: 0 0 var(--s-5); max-width: 36ch; }

/* 专家预览（病毒钩子 + 合规标注） */
.cast { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5);
  background: linear-gradient(180deg,#fff,#fcfcff); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4); box-shadow: var(--sh-sm); }
.cast .avs { display: inline-flex; flex: 0 0 auto; }
.cast .avs .av { margin-left: -10px; }
.cast .avs .av:first-child { margin-left: 0; }
.cast .cast-txt { font-size: var(--fs-13); color: var(--text-2); line-height: 1.5; min-width: 0; }
.cast .cast-txt b { color: var(--text); font-weight: 700; }
.cast .cast-txt .tag { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700;
  color: var(--brand-b); background: var(--brand-soft); padding: 2px 8px; border-radius: var(--r-pill); }

/* 抽象头像（具名大佬 + 抽象图标，合规） */
.av { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 2px 6px rgba(20,24,40,.14); }
.av svg { width: 22px; height: 22px; display: block; }
/* 头像改用独立 SVG 资源（assets/avatars/<key>.svg，自带渐变+高光+投影）；
   此处渐变仅作 <img> 加载失败时的兜底底色，投影由 SVG 自带，避免双重投影 */
.av-img { display: block; width: 100%; height: 100%; }
.av.jobs { background: linear-gradient(135deg,#7c6cf5,#5b54cf); box-shadow: none; }
.av.musk { background: linear-gradient(135deg,#22b8d6,#0e7490); box-shadow: none; }
.av.leijun { background: linear-gradient(135deg,#ff8a8a,#e03131); box-shadow: none; }

/* 核心输入卡 */
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--sh-md); transition: border-color .2s ease, box-shadow .2s ease; }
.card:focus-within { border-color: var(--brand-a); box-shadow: 0 0 0 4px var(--brand-soft), var(--sh-lg); }
.field-label { font-size: var(--fs-13); font-weight: 700; color: var(--text-2); margin-bottom: var(--s-2); display: block; }
.topic-input { width: 100%; border: none; outline: none; resize: none; font: inherit; font-size: var(--fs-17);
  line-height: 1.6; color: var(--text); background: transparent; min-height: 76px; }
.topic-input::placeholder { color: var(--n-400); }
.field-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-3); gap: var(--s-3); }
.counter { font-size: var(--fs-12); color: var(--n-500); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hint { font-size: var(--fs-12); color: var(--n-500); margin: var(--s-3) 2px 0; display: flex; align-items: center; gap: 6px; }

.btn {
  appearance: none; border: none; cursor: pointer; font: inherit; font-weight: 700;
  border-radius: var(--r-md); min-height: var(--tap); padding: 0 var(--s-5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.btn-primary { width: 100%; color: #fff; background: var(--grad-cta); font-size: var(--fs-16);
  box-shadow: 0 8px 22px rgba(91, 84, 207, .38); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(74, 63, 176, .5); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* 区块通用 */
.section { margin-top: var(--s-6); }
.section-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.section-h h2 { font-size: var(--fs-14); font-weight: 700; color: var(--text-2); margin: 0; letter-spacing: .3px; }
.section-h a { font-size: var(--fs-13); color: var(--brand-b); text-decoration: none; font-weight: 700; }
.section-h a:active { opacity: .7; }

/* 热门话题 pill（容器 id=capsules，按钮 class= capsule，data-topic 由 app.js 读取） */
.capsules, .chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.capsule, .chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--n-700);
  font-size: var(--fs-14); padding: 10px 15px; border-radius: var(--r-pill); cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--sh-sm); transition: all .15s ease; font-weight: 600;
}
.capsule:hover, .chip:hover { border-color: var(--brand-a); color: var(--brand-b);
  box-shadow: 0 4px 12px rgba(102, 126, 234, .16); transform: translateY(-1px); }
.capsule:active, .chip:active { background: var(--brand-soft); transform: translateY(0); }

/* 示例对话预览（展示产出形态，降低认知门槛） */
.sample { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md);
  padding: var(--s-4); box-shadow: var(--sh-sm); }
.sample .s-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.sample .s-head span { font-size: var(--fs-12); font-weight: 700; color: var(--n-500); letter-spacing: .4px; }
.sample .s-head em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--brand-b);
  background: var(--brand-soft); padding: 2px 8px; border-radius: var(--r-pill); }
.sbub { display: flex; gap: var(--s-2); align-items: flex-start; margin-bottom: var(--s-3); }
.sbub .av { width: 30px; height: 30px; border-radius: 10px; flex: 0 0 auto; }
.sbub .av svg { width: 16px; height: 16px; }
.sbub .stxt { max-width: 78%; font-size: var(--fs-14); line-height: 1.55; padding: 9px 12px;
  background: var(--n-50); border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
.sbub.user { flex-direction: row-reverse; }
.sbub.user .stxt { background: var(--grad-btn); color: #fff; border: none; }

/* 三步说明 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s-3); text-align: center; box-shadow: var(--sh-sm); }
.step .n { width: 30px; height: 30px; margin: 0 auto var(--s-2); border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-13); font-weight: 800; color: #fff; background: var(--grad);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .22); }
/* 三步状态色：1 品牌紫(起点) · 2 鲜绿(进行中) · 3 鲜橙(收获启发)，统一高级渐变 + 白字 */
.steps .step:nth-child(2) .n { background: linear-gradient(135deg,#10b981 0%,#047857 100%); }
.steps .step:nth-child(3) .n { background: linear-gradient(135deg,#f97316 0%,#c2410c 100%); }
.step p { margin: 0; font-size: var(--fs-12); color: var(--text-2); line-height: 1.45; }

/* 信任条 */
.trust { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-6);
  justify-content: center; flex-wrap: wrap; }
.trust .avs { display: inline-flex; }
.trust .avs .av { width: 28px; height: 28px; border-radius: 9px; margin-left: -8px; border: 2px solid var(--bg); }
.trust .avs .av:first-child { margin-left: 0; }
.trust .avs .av svg { width: 15px; height: 15px; }
.trust .txt { font-size: var(--fs-13); color: var(--text-2); }
.trust .txt b { color: var(--text); }

.home-footer { margin-top: var(--s-6); text-align: center; }
.disclaimer { font-size: var(--fs-12); color: var(--n-500); letter-spacing: .2px; margin: 0; line-height: 1.5; }

/* ===================== 对话页 ===================== */
.chat { background: var(--bg); }
.chat-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 var(--s-3);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(20, 24, 40, .04);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.header-btn {
  border: none; background: transparent; cursor: pointer; font-size: 26px; color: var(--n-600);
  line-height: 1; padding: 6px 10px; border-radius: 50%;
  min-width: var(--tap); min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, box-shadow .15s ease;
}
.header-btn:hover { background: var(--n-100); }
.header-btn:active { background: var(--n-200); }
.header-btn.share {
  font-size: 12.5px; font-weight: 700; color: var(--brand-b);
  background: var(--brand-soft); border: 1px solid rgba(91, 84, 207, .18);
  border-radius: var(--r-pill); padding: 7px 13px; gap: 5px;
  min-height: 34px; min-width: auto;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.header-btn.share .share-ico { width: 15px; height: 15px; flex: 0 0 auto; }
.header-btn.share:hover { background: #e3e6fd; border-color: rgba(91, 84, 207, .34); box-shadow: 0 2px 10px rgba(91, 84, 207, .16); }
.header-btn.share:active { transform: translateY(1px); box-shadow: none; }
.header-btn.share:disabled { opacity: .55; }
.header-title { font-size: var(--fs-16); font-weight: 600; color: var(--text); }

.chat-messages { flex: 1; padding: var(--s-4) var(--s-4) var(--s-3); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chat-disclaimer {
  text-align: center; font-size: var(--fs-12); color: var(--n-400); line-height: 1.5;
  padding: var(--s-3) var(--s-4) var(--s-2);
}

/* 聊天页底栏（生成可行性方案） */
.chat-actionbar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-3) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(246,247,251,0) 0%, var(--bg) 42%);
  border-top: 1px solid var(--border);
}
.btn-feas {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px; height: 46px; border: none; cursor: pointer;
  font-size: var(--fs-15); font-weight: 700; color: #fff;
  background: var(--grad-cta);
  border-radius: var(--r-pill);
  box-shadow: 0 6px 16px rgba(74,63,176,.30), inset 0 0 0 1px rgba(255,255,255,.16);
  transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-feas .feas-ico { width: 18px; height: 18px; display: inline-flex; }
.btn-feas .feas-ico svg { width: 100%; height: 100%; }
.btn-feas:hover { box-shadow: 0 8px 22px rgba(74,63,176,.38), inset 0 0 0 1px rgba(255,255,255,.20); }
.btn-feas:active { transform: translateY(1px); }
.btn-feas:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* 生成成功后的「已完成」态：微信绿 + 置灰不可点（区别于「未就绪」的灰禁用） */
.btn-feas.done,
.btn-feas.done:disabled {
  opacity: .92;
  background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
  cursor: default;
  box-shadow: 0 2px 8px rgba(40, 167, 69, .16);
}
.btn-feas.done:active { transform: none; }

/* ===== 可行性报告卡（全宽、独立卡片，不继承 .msg 气泡布局）===== */
.feas-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: var(--s-4);
  background: #fff;
  border: 1px solid rgba(91,84,207,.15);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(74,63,176,.07);
  animation: feasIn .35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes feasIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* 标题栏：干净白底 + 品牌紫字（不抢内容风头） */
.feas-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  font-size: 15px; font-weight: 800;
  color: #4F63E5;
  background: #F5F3FF;
  border-bottom: 1px solid rgba(91,84,207,.12);
}
.feas-sub {
  margin-left: auto; white-space: nowrap;
  font-size: 11px; font-weight: 600;
  color: #7C3AED;
  background: rgba(124,58,237,.08);
  padding: 3px 10px; border-radius: var(--r-pill);
}

/* 内容区 */
.feas-body { padding: 16px 20px 20px; }
.feas-thinking {
  font-size: var(--fs-14); color: var(--n-400);
  padding: 16px 0; text-align: center;
}
.feas-thinking::before { content: '✦ '; }

/* 分段：虚线分隔 */
.feas-sec {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(91,84,207,.12);
}
.feas-sec:first-child {
  margin-top: 0; padding-top: 0; border-top: none;
}

/* 分段标题：品牌紫胶囊（简洁不花哨） */
.feas-sec-title {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: .2px;
  color: #fff;
  background: linear-gradient(135deg, #4F63E5, #7C3AED);
  padding: 4px 13px; border-radius: var(--r-pill);
  margin-bottom: 9px;
  box-shadow: 0 1px 6px rgba(79,99,229,.2);
}

/* 分段正文：干净文字，不加额外符号（LLM 已自带 • / 数字编号） */
.feas-sec-text {
  font-size: 14px; line-height: 1.72; color: #333;
  white-space: pre-wrap; word-break: break-word;
}

.feas-error {
  font-size: var(--fs-14); color: #b91c1c; line-height: 1.6;
  padding: var(--s-2) 0;
}

/* 消息气泡 */
.msg { display: flex; align-items: flex-start; margin-bottom: var(--s-4); gap: var(--s-2); animation: msgIn .28s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { flex-direction: row-reverse; }
.avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 2px 6px rgba(20, 24, 40, .12);
}
.bubble-wrap { max-width: 76%; min-width: 0; display: flex; flex-direction: column; }
.msg.user .bubble-wrap { align-items: flex-end; }
.bubble-name { font-size: var(--fs-12); font-weight: 600; color: var(--text-2); margin: 0 4px 5px; line-height: 1.2; }
.bubble {
  position: relative; padding: 12px 15px; border-radius: 16px;
  font-size: var(--fs-15); line-height: 1.6; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-sm); word-break: break-word; white-space: pre-wrap;
}
.msg.user .bubble {
  background: var(--wx-green); color: #1f2433; border: none;
  border-bottom-right-radius: 5px;
}
.msg.expert .bubble {
  border-top-left-radius: 5px; border-left: 3px solid var(--e-reason);
}
.typing-cursor {
  display: inline-block; width: 2px; height: 1.05em; background: var(--n-400);
  margin-left: 2px; vertical-align: -2px; border-radius: 1px; animation: blink .8s steps(1) infinite;
}
.msg.user .typing-cursor { background: rgba(255, 255, 255, .85); }
@keyframes blink { 50% { opacity: 0; } }

/* ===================== 分享卡片弹层 ===================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--s-4); }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 24, 40, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: maskIn .2s ease both; }
.modal-body {
  position: relative; z-index: 1; width: 100%; max-width: 440px; max-height: 90vh;
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: 20px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  animation: sheetIn .26s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--s-4); font-size: var(--fs-16); font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.modal-head span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-right: 8px; vertical-align: middle; }
.modal-close { border: none; background: transparent; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--n-400); display: grid; place-items: center; transition: background .15s ease, color .15s ease; }
.modal-close:hover { background: var(--n-100); color: var(--n-700); }
.modal-close:active { background: var(--n-200); }
.modal-canvas-wrap {
  overflow: auto; padding: var(--s-4); display: flex; justify-content: center;
  background:
    radial-gradient(420px 220px at 50% 0%, rgba(102, 126, 234, .05), transparent 60%),
    var(--n-50);
}
.modal-canvas-wrap img { width: 100%; height: auto; border-radius: 14px; box-shadow: var(--sh-md); }
.modal-actions { padding: var(--s-4); border-top: 1px solid var(--border); }

/* 下载图片按钮（专用质感样式，替代通用 btn-primary） */
.dl-btn {
  position: relative; width: 100%; height: 44px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--fs-15); font-weight: 700; letter-spacing: .3px;
  color: var(--brand-a);
  background: var(--brand-soft);
  border-radius: var(--r-sm); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(91, 84, 207, .18), 0 2px 6px rgba(74, 63, 176, .06);
  transition: transform .16s ease, background .18s ease, box-shadow .18s ease;
}
.dl-btn:hover {
  background: #e6e8fd;
  box-shadow: inset 0 0 0 1px rgba(91, 84, 207, .30), 0 4px 12px rgba(74, 63, 176, .12);
}
.dl-btn:active { transform: translateY(1px); }
.dl-btn .dl-ico { width: 20px; height: 20px; display: grid; place-items: center; }
.dl-btn .dl-ico svg { width: 18px; height: 18px; stroke: var(--brand-a); transition: stroke .18s ease; }
.dl-btn .dl-txt { line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .dl-btn { transition: none; }
}

/* 点击后的「已保存」确认态（微信绿） */
.dl-btn.done {
  color: #fff;
  background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
  box-shadow: 0 4px 12px rgba(40, 167, 69, .22);
}
.dl-btn.done .dl-ico svg { stroke: #fff; }

/* ===================== 离屏分享卡片（html2canvas 目标 · 照搬聊天页浅色） ===================== */
/* 预览用类规则（复刻聊天页 .chat / .msg / .bubble）。导出模式由 app.js 内联写死几何与颜色。 */
.capture-card {
  position: absolute; left: -10000px; top: 0;
  background: var(--bg);
  background-image:
    radial-gradient(620px 360px at 12% -8%, rgba(102, 126, 234, .10), transparent 60%),
    radial-gradient(560px 360px at 92% 2%, rgba(118, 75, 162, .07), transparent 60%);
  padding: 20px 18px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
}

/* 品牌行（照搬聊天页顶栏：logo + 名 + 轻标签） */
.capture-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.capture-brand .cb-logo {
  width: 38px; height: 38px; border-radius: 11px; overflow: hidden; flex: 0 0 auto;
  display: block; box-shadow: 0 4px 12px rgba(91, 84, 207, .30), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.capture-brand .cb-name { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: .3px; line-height: 1.1; }
.capture-brand .cb-tag {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-2);
  background: rgba(91, 84, 207, .10); padding: 4px 10px; border-radius: 999px;
}

/* 对话区（照搬聊天页气泡） */
.capture-conv { display: flex; flex-direction: column; }
.capture-card .msg { display: flex; align-items: flex-start; margin-bottom: 16px; gap: 8px; }
.capture-card .msg:last-child { margin-bottom: 0; }
.capture-card .msg.user { flex-direction: row-reverse; }
.capture-card .avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 2px 6px rgba(20, 24, 40, .12);
}
.capture-card .bubble-wrap { max-width: 76%; min-width: 0; display: flex; flex-direction: column; }
.capture-card .msg.user .bubble-wrap { max-width: 78%; align-items: flex-end; }
.capture-card .bubble-name { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 4px 5px; line-height: 1.2; }
.capture-card .bubble {
  position: relative; padding: 12px 15px; border-radius: 16px;
  font-size: 15px; line-height: 1.6; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-sm); word-break: break-word; white-space: pre-wrap;
}
.capture-card .msg.user .bubble {
  background: var(--wx-green); color: #1f2433; border: none;
  border-bottom-right-radius: 5px;
}
.capture-card .msg.expert .bubble {
  border-top-left-radius: 5px; border-left: 3px solid var(--e-reason);
}

/* 页脚 */
.capture-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.capture-footer .cb-qr {
  flex: 0 0 auto; width: 72px; height: 72px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); display: grid; place-items: center; overflow: hidden;
}
.capture-footer .cb-qr svg { width: 46px; height: 46px; }
.capture-footer .f-text { flex: 1; }
.capture-footer .f-brand { font-size: 15px; font-weight: 800; color: var(--text); }
.capture-footer .f-disc { margin-top: 4px; font-size: 11px; color: var(--n-400); }

/* ===================== Toast ===================== */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 36, 51, .94); color: #fff; font-size: var(--fs-13); font-weight: 600;
  padding: 11px 18px; border-radius: var(--r-pill); box-shadow: var(--sh-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 200;
  max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== 无障碍 ===================== */
a:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-a); outline-offset: 2px; border-radius: var(--r-sm); }

/* ============ 召集三位大佬 过渡动画 ============ */
.summon {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center; color: #fff;
  background: var(--grad);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .38s ease, visibility .38s ease;
}
.summon.show { opacity: 1; visibility: visible; pointer-events: auto; }

.summon-logo {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 22px;
  display: grid; place-items: center; font-size: 28px; font-weight: 800;
  background: rgba(255, 255, 255, .16); overflow: hidden;
  animation: summonPop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.summon-logo img { width: 100%; height: 100%; display: block; }
.summon-title {
  margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: .5px;
  animation: summonPop .5s .05s cubic-bezier(.34, 1.56, .64, 1) both;
}
.summon-avatars { display: flex; gap: 18px; margin: 26px 0 18px; }
.summon-avatars .sav {
  width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(14px) scale(.8);
  animation: summonIn .5s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
.summon-avatars .sav img { width: 100%; height: 100%; display: block; }
.summon-avatars .sav svg { width: 28px; height: 28px; display: block; }
.summon-avatars .sav.jobs { background: linear-gradient(135deg, #7c6cf5, #5b54cf); animation-delay: .15s; }
.summon-avatars .sav.musk { background: linear-gradient(135deg, #22b8d6, #0e7490); animation-delay: .35s; }
.summon-avatars .sav.leijun { background: linear-gradient(135deg, #ff8a8a, #e03131); animation-delay: .55s; }
.summon-sub { margin: 4px 0 0; font-size: 13px; font-weight: 600; opacity: .88; animation: summonPop .5s .6s both; }
.summon-dots { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.summon-dots i { width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .5; animation: summonBlink 1.2s infinite; }
.summon-dots i:nth-child(2) { animation-delay: .2s; }
.summon-dots i:nth-child(3) { animation-delay: .4s; }
.summon-foot { position: absolute; bottom: 22px; left: 0; right: 0; font-size: 11px; opacity: .7; text-align: center; }

@keyframes summonPop { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes summonIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes summonBlink { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* 召集动画：禁用位移动画后，仍需保证头像/文案可见 */
  .summon-avatars .sav,
  .summon-logo,
  .summon-title,
  .summon-sub { opacity: 1 !important; transform: none !important; }
  .summon-dots i { opacity: .7 !important; }
}
