/* ============================================================
   沐源渡文化人物 AI 馆 · 共用样式 v20260810-v2
   设计稿参照：刘光松人物问答页设计截图
   ============================================================ */

:root {
  --bg: #f5ebe1;            /* 整体米黄底 */
  --card: #ffffff;          /* 白卡 */
  --bio: #fdeedb;           /* 专业介绍卡米黄 */
  --accent: #8d3728;        /* 主红 */
  --accent-soft: #a73e2f;
  --ink: #2b1f17;
  --muted: #8a7a6a;
  --line: #ead9c4;
  --shadow: 0 6px 22px rgba(120, 70, 35, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- 顶部黑色导航栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 14px 14px;
  background: #1d1815;
  color: #f5ebe1;
  font-size: 16px;
}
.topbar .back {
  width: 36px; height: 36px;
  font-size: 22px; color: #f5ebe1;
  background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar .title {
  flex: 1; text-align: center;
  letter-spacing: .04em;
  font-weight: 500;
}
.topbar .actions {
  display: flex; gap: 14px;
  font-size: 18px;
}
.topbar .actions button {
  width: 32px; height: 32px;
  border: 0; background: transparent;
  color: #f5ebe1; font-size: 18px;
  cursor: pointer;
}

/* ---------- 容器 ---------- */
.shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 14px 16px 22px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ---------- 人物小卡 ---------- */
.person-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 26px;
  flex: 0 0 auto;
}
.person-info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.person-info .name {
  font-weight: 700; font-size: 17px; color: var(--ink);
}
.person-info .sub {
  color: var(--accent); font-size: 13px;
}

/* ---------- 专业介绍卡（米黄大卡） ---------- */
.bio-card {
  background: var(--bio);
  border-radius: 18px;
  padding: 18px 18px 14px;
}
.bio-card .bio-title {
  color: var(--accent);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.bio-card .bio-desc {
  color: #7a3a25;
  font-size: 14px;
  line-height: 1.85;
  margin: 0 0 14px;
  white-space: pre-line;
}
.bio-card .services {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 20px 0 14px;
}
.bio-card .services span {
  background: #ffffff;
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
}
.bio-card .contact {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--accent); font-size: 14px;
  border-top: 1px solid rgba(141, 55, 40, .18);
  padding-top: 12px; margin-top: 4px;
}
.bio-card .contact-label { font-size: 13px; opacity: .85; }
.bio-card .contact strong {
  font-weight: 700; letter-spacing: .02em;
  margin-left: 4px;
}
.bio-card .copy-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- 开场白卡 ---------- */
.greeting-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  line-height: 1.75;
  font-size: 14.5px;
}

/* ---------- 消息流（脚本动态插入） ---------- */
.messages {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 4px;
}
.message { max-width: 85%; }
.message.assistant { align-self: flex-start; }
.assistant .bubble {
  background: var(--card);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
  line-height: 1.75;
  font-size: 14.5px;
  box-shadow: var(--shadow);
  color: var(--ink);
  white-space: pre-wrap;
}
.message.user { align-self: flex-end; }
.user .bubble {
  background: var(--accent); color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 12px 14px;
  line-height: 1.75;
  font-size: 14.5px;
  white-space: pre-wrap;
}

/* ---------- 建议问题 ---------- */
.suggestions {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.suggestions::-webkit-scrollbar { display: none; }
.suggestions button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

/* ---------- 语音控制（两个胶囊按钮） ---------- */
.voice-controls {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
  padding: 4px 0 0;
}
.voice-controls button {
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
#record-button {
  border: 1px solid var(--accent);
  background: transparent; color: var(--accent);
  min-width: 130px;
}
#record-button.recording {
  background: var(--accent); color: #fff;
}
#play-answer-button {
  border: 1px solid #d8c9b6;
  background: transparent; color: #b5a490;
  min-width: 130px;
}
#play-answer-button:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
}
#stop-answer-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-size: 13px;
}
.voice-controls .record-status {
  flex: 0 0 100%;
  text-align: center;
  color: var(--muted); font-size: 12px;
  margin-top: 4px;
}

/* ---------- 输入栏 ---------- */
.composer {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 0 4px;
  position: sticky; bottom: 0;
  background: linear-gradient(transparent, var(--bg) 25%);
}
.composer input {
  flex: 1; border: 0;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit; color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
}
.composer input:focus { outline: 1px solid var(--accent); }
.composer button {
  border: 0; border-radius: 14px;
  padding: 12px 22px;
  background: var(--accent); color: #fff;
  font: inherit; cursor: pointer;
}

/* ---------- 底部免责 ---------- */
.notice {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 大屏 ---------- */
@media (min-width: 720px) {
  .shell { padding: 22px 24px 28px; gap: 16px; }
  .bio-card .bio-title { font-size: 24px; }
}
.answer-evidence{margin:12px 4px 0;padding-top:10px;border-top:1px solid #e5ded2;color:#665d53;font-size:13px}.answer-evidence summary{cursor:pointer;color:#8c3528;font-weight:600}.answer-evidence ol{margin:8px 0 4px;padding-left:22px}.answer-evidence li{margin:4px 0;line-height:1.45}.answer-evidence p{margin:8px 0}.knowledge-version{color:#80776d;font-size:12px;word-break:break-all}.feedback-actions{display:flex;align-items:center;gap:8px;margin:10px 4px 0;color:#746b61;font-size:12px}.feedback-actions button{padding:5px 10px;border:1px solid #cfc6b9;border-radius:16px;background:#fffaf2;color:#6c4a40;cursor:pointer}.feedback-actions button:disabled{opacity:.55;cursor:default}
