:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f0f4f4;
  --border: #dfe6e6;
  --text: #1b2528;
  --text-soft: #5b6b70;
  --text-mute: #8a999e;
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --warn: #9a5b00;
  --warn-soft: #fdf3e2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 34, 38, 0.05), 0 8px 24px rgba(16, 34, 38, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* 账号表单展开时会多出「显示名」和两个按钮。窄屏下让顶栏整行换行，
     别把状态文字挤成一列或者溢出。 */
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 12px; color: var(--text-mute); }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.dot.ok { background: #12805c; }
.dot.warn { background: #d97706; }
.dot.bad { background: var(--danger); }

/* ---------- 账号登录 ---------- */
.account { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; justify-content: flex-end; }
.account-who { color: var(--text-soft); white-space: nowrap; }
.account-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-form input {
  width: 108px;
  padding: 4px 8px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
/* 显示名可以留空，给宽一点让中文名字不被截断。 */
#account-name { width: 132px; }
/* 「用我的模型」：从按钮下方展开的小面板。塞进顶栏那条 flex 里会把整行挤到
   换行、看着像布局坏了——它本来就是「点开才看」的东西。 */
#model { position: relative; }
#model-form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 304px;
  padding: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}
/* 三行输入各占满一行：地址与 key 都偏长，挤在一行里看不见自己填了什么。 */
#model-form input { flex: 1 0 100%; width: 100%; }
#model-form button { flex: 0 0 auto; }
/* 这行提示不是错误，别用账号区的红色；它属于这张表单，就留在面板里。 */
.model-hint {
  flex: 1 0 100%;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}
.account-note {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 8px;
  font-size: 12.5px;
  color: var(--danger);
}
/* 注册成功/「已在登录态」这类不是错误的提示：用中性色，不然看着像失败。 */
.account-note.ok { color: var(--text-soft); }

.banner {
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  padding: 7px 20px;
  text-align: center;
  border-top: 1px solid #f0dfc0;
}
.banner.demo { background: #eef2ff; color: #3730a3; border-top-color: #dfe4fb; }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* 左列容器：身份面板 + 资料面板纵向堆叠，共用一条 grid 轨道。 */
.side-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 861px) {
  .side-col { position: sticky; top: 78px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .topbar-inner { padding: 10px 14px; }
  .brand-text span { display: none; }
}

/* ---------- 身份面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

@media (min-width: 861px) {
  .profile-panel { position: sticky; top: 78px; }
}

.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 14px; margin: 0; letter-spacing: 0.02em; }

.panel-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin: 8px 0 14px;
  line-height: 1.6;
}

.profile-form { display: flex; flex-direction: column; gap: 10px; }
.profile-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); }
.profile-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input, select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.form-note { font-size: 11.5px; color: var(--text-mute); margin: 2px 0 0; }

/* ---------- 我的教务资料面板 ---------- */

.docs-panel.docs-collapsed .docs-upload,
.docs-panel.docs-collapsed .docs-list,
.docs-panel.docs-collapsed .form-note { display: none; }

.docs-upload { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.docs-upload select { width: auto; flex: 1; min-width: 0; padding: 6px 8px; font-size: 12.5px; }
.docs-upload .link-btn { white-space: nowrap; }

.docs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.docs-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.docs-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.docs-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-item-meta { font-size: 11.5px; color: var(--text-mute); }
.docs-item-note { font-size: 11.5px; color: var(--text-soft); line-height: 1.55; }
.docs-item-error { color: var(--danger); }
.docs-empty { font-size: 12px; color: var(--text-mute); line-height: 1.6; }

.docs-item-actions { display: flex; gap: 10px; margin-top: 2px; }
.docs-item-actions .link-btn { font-size: 12px; padding: 2px 6px; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  /* 顶栏挤的时候「登录」会被拆成「登」「录」两行，看着像坏掉了。 */
  white-space: nowrap;
}
.link-btn:hover { background: var(--accent-soft); }
.link-btn:disabled { color: var(--text-mute); cursor: default; background: none; }

/* ---------- 聊天 ---------- */
.chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
  overflow: hidden;
}

@media (max-width: 860px) {
  .chat { min-height: auto; }
}

.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 22px 8px; }
@media (max-width: 860px) { .chat-scroll { padding: 16px 14px 4px; } }

.empty-state { max-width: 620px; margin: 18px auto 26px; }
.empty-state h1 { font-size: 21px; line-height: 1.45; margin: 0 0 10px; letter-spacing: -0.01em; }
.empty-state p { color: var(--text-soft); font-size: 13.5px; margin: 0 0 16px; }
.empty-foot { font-size: 12px; color: var(--text-mute); margin-top: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.messages { display: flex; flex-direction: column; gap: 20px; padding-bottom: 18px; }

.msg-user { align-self: flex-end; max-width: 82%; }
.msg-user .bubble {
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bot { max-width: 100%; }

.answer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 10px;
  background: var(--surface);
}

.answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ok { background: var(--accent-soft); color: #0b5d57; }
.badge.partial { background: var(--warn-soft); color: var(--warn); }
.badge.refused { background: #eef1f4; color: #475569; }
.badge.degraded { background: var(--danger-soft); color: var(--danger); }

.answer-note { font-size: 12px; color: var(--text-mute); }

.section { margin: 0 0 14px; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.section-label::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.section-label.basis::before { background: #2563eb; }
.section-label.steps::before { background: #7c3aed; }
.section-label.branches::before { background: #d97706; }
.section-label.referral::before { background: #64748b; }

.conclusion { font-size: 15px; line-height: 1.7; margin: 0; }

.basis-list { display: flex; flex-direction: column; gap: 8px; }
.basis-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.basis-item:hover { border-color: var(--accent); background: #fff; }
.basis-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.basis-title { font-size: 12.5px; font-weight: 600; }
.basis-page { font-size: 11.5px; color: var(--text-mute); }
.basis-quote {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.basis-open { font-size: 11.5px; color: var(--accent); margin-top: 6px; display: inline-block; }

.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.steps li { position: relative; padding-left: 30px; font-size: 13.5px; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #f3e8ff;
  color: #6b21a8;
  font-size: 11.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.step-meta { display: block; font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.branches { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.branches li {
  font-size: 13.5px;
  padding: 9px 12px;
  border-left: 3px solid #f0c48a;
  background: #fffbf4;
  border-radius: 0 8px 8px 0;
}
.branches .cond { font-weight: 600; }

/* 能力说明（sections.self_intro）。样式只为区分「这不是政策回答」：
   灰底徽标 + 无依据块，学生一眼就知道这一条没有原文可点。 */
.badge.intro { background: #eef2f7; color: #334155; }

.intro-summary {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 0 0 6px;
}
.intro-topic-name { font-weight: 600; margin-right: 6px; }
.intro-example { display: block; font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.intro-limits { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.intro-limits li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-soft);
}
.intro-limits li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--text-mute);
}

.referral-box {
  border: 1px dashed #c7d2d8;
  border-radius: 10px;
  padding: 11px 13px;
  background: #fafcfc;
  font-size: 13px;
}
.referral-dept { font-weight: 600; margin-bottom: 3px; }
.referral-meta { font-size: 12px; color: var(--text-mute); margin: 2px 0 0; }
.referral-box a { color: var(--accent); }

.caveats {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f8fafb;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-soft);
}
.caveats ul { margin: 4px 0 0; padding-left: 18px; }
.caveats li { margin-bottom: 3px; }

.answer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}
.foot-label { font-size: 12px; color: var(--text-mute); }
.fb-btn {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}
.fb-btn:hover { border-color: var(--danger); color: var(--danger); }
.fb-btn.done { border-color: #12805c; color: #12805c; background: #eefaf5; cursor: default; }

.fb-note { width: 100%; margin-top: 8px; display: flex; gap: 8px; }
.fb-note input { font-size: 12.5px; }
.fb-submit {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.thinking { display: flex; align-items: center; gap: 10px; color: var(--text-mute); font-size: 13px; padding: 6px 2px; }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.streaming { font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.cursor { display: inline-block; width: 2px; height: 15px; background: var(--accent); vertical-align: -2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.error-box {
  border: 1px solid #f3c0bb;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
}
.error-box .retry { margin-left: 8px; }

/* ---------- 输入区 ---------- */
.composer {
  display: flex;
  gap: 10px;
  padding: 12px 18px 6px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-end;
}
.composer textarea {
  resize: none;
  max-height: 140px;
  line-height: 1.5;
  padding: 10px 12px;
}
.send-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 11px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.send-btn:disabled { background: #a7c4c1; cursor: not-allowed; }
.composer-hint {
  margin: 0;
  padding: 0 18px 12px;
  font-size: 11.5px;
  color: var(--text-mute);
  background: var(--surface);
}

/* ---------- 引用抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 34, 0.35);
  z-index: 30;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 92vw);
  background: var(--surface);
  z-index: 31;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(16, 34, 38, 0.12);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-head strong { font-size: 14px; display: block; }
.drawer-meta { font-size: 12px; color: var(--text-mute); }
.drawer-body { padding: 14px 18px 24px; overflow-y: auto; }
.drawer-nav { display: flex; justify-content: space-between; margin-bottom: 10px; }
.drawer-text { font-size: 13.5px; line-height: 1.85; white-space: pre-wrap; margin: 0 0 16px; }
.drawer-link { font-size: 12.5px; color: var(--accent); }
.icon-btn {
  border: none;
  background: var(--surface-2);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}
.icon-btn:hover { background: var(--border); }

/* 追问块：与普通 caveat 区分开——这一条需要学生回答，不是免责声明 */
.clarify-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--warn-soft);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  font-size: 13px;
  color: var(--warn);
}
.clarify-box ul { margin: 4px 0 0; padding-left: 18px; }
.clarify-box li { margin-bottom: 3px; line-height: 1.5; }
.caveats-wrap { margin-bottom: 4px; }

.thinking-elapsed {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* ---- R4 多轮会话 ---- */

/* 顶栏「新对话」按钮：没有会话时隐藏 */
#session-restart {
  margin-left: 12px;
  white-space: nowrap;
}
#session-restart.hidden { display: none; }

/* 已记住的条件条：贴在输入框上方，学生随时能看到系统记住了什么 */
.facts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  font-size: 12px;
  color: var(--text-mute);
}
.facts-bar.hidden { display: none; }
.facts-label { font-weight: 600; }
.fact-chip {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

/* 独立追问卡片 */
.followup-box .followup-text {
  margin: 6px 0;
  font-size: 14px;
  font-weight: 600;
}

/* 会话过期 / 重新开始的系统提示条 */
.system-note {
  margin: 4px auto;
  max-width: 78%;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}

/* ---------- R6 结构化办理指引 ----------
   目标：让「哪些是政策要求、哪些是待核实」在视觉上分得开。
   颜色只表达可信度，不表达「重要程度」——避免学生把待核实项当重点漏掉。 */

.section-label.facts::before { background: #0f766e; }
.section-label.checks::before { background: #0891b2; }
.section-label.materials::before { background: #b45309; }
.section-label.deadlines::before { background: #be123c; }
.section-label.channels::before { background: #4d7c0f; }
.section-label.missing::before { background: #7c3aed; }
.section-label.gaps::before { background: #b42318; }

.guidance { display: flex; flex-direction: column; gap: 4px; }

/* 标签：状态与类型共用一套，避免满屏不同形状 */
.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text-soft);
}
.pill.pass { background: var(--accent-soft); color: var(--accent); border-color: #bfe3dd; }
.pill.fail { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c4; }
.pill.unknown { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb8; }
.pill.pending { background: #f1ebff; color: #6d28d9; border-color: #ddd0f7; }
.pill.official { background: #eef2ff; color: #3730a3; border-color: #d6ddfb; }
.pill.advise { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.pill.muted { background: var(--surface-2); color: var(--text-mute); }

/* ---- 你的情况 ---- */
.fact-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fact {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
}
.fact.unknown { border-style: dashed; color: var(--text-mute); }
.fact-key { color: var(--text-mute); }
.fact-value { font-weight: 600; }
.fact-source, .fact-note { font-size: 11px; color: var(--text-mute); }

/* ---- 条件判断 ---- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.check-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.check-desc { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.check-detail { margin-top: 4px; font-size: 12px; color: var(--text-soft); }
.check-reason { margin-top: 4px; font-size: 12px; color: var(--warn); }

/* ---- 办理步骤 ---- */
.guide-steps { margin: 0; padding-left: 20px; }
.guide-steps > li { margin-bottom: 10px; }
.step-head { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.step-title { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.step-desc { margin: 3px 0 0; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.step-note { margin: 3px 0 0; font-size: 12px; color: var(--warn); }

/* ---- 材料 / 时间 / 渠道 ---- */
.material-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.material-list li { font-size: 13px; color: var(--text); line-height: 1.5; }
.material-list li > .pill { margin-left: 6px; }
.item-note { display: block; font-size: 12px; color: var(--text-mute); }

/* ---- 待补充 / 证据缺口 ---- */
.missing-list, .gap-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.missing-list li { font-size: 13px; color: var(--text); }
.gap-list li { font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.gap-list li > .pill { margin-right: 6px; }

.evidence-link {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- 窄屏：步骤与条件改单列，标签换行不挤压正文 ---- */
@media (max-width: 860px) {
  .check-head, .step-head { gap: 4px; }
  .check-detail, .check-reason { font-size: 11.5px; }
  .fact { font-size: 12px; }
  .material-list li { font-size: 12.5px; }
}

/* ---------- R7 动态行动清单 ----------
   状态色沿用 R6 的 pill 语义；这里只补布局与流程线的连接。 */

.section-label.plan::before { background: #0f766e; }
.section-label.flow::before { background: #6366f1; }

.plan { display: flex; flex-direction: column; gap: 8px; }

.plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.plan-title { font-size: 13px; font-weight: 600; color: var(--text); }
.plan-version { font-size: 11.5px; color: var(--text-mute); }

/* 变更提示：告诉学生「这次哪一步变了」，而不是让他自己比对 */
.plan-changes {
  margin: 0;
  padding: 8px 10px 8px 24px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid #f0dcb8;
  font-size: 12px;
  color: var(--warn);
}
.plan-changes li { line-height: 1.6; }
.plan-changes li.change-invalidated { color: var(--danger); }

.plan-steps { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.plan-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 8px 10px;
}
.plan-step.state-completed { border-color: #bfe3dd; background: var(--accent-soft); }
.plan-step.state-needs_revalidation { border-color: #f0dcb8; background: var(--warn-soft); }
.plan-step.state-blocked { opacity: 0.72; }

.plan-step-row { display: flex; align-items: flex-start; gap: 8px; }
.plan-check { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.plan-step-body { flex: 1 1 auto; min-width: 0; }
.plan-step-head { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.plan-step-title { font-size: 13px; line-height: 1.5; color: var(--text); }
.plan-step-note { margin: 3px 0 0; font-size: 12px; color: var(--warn); }
.plan-step-dep { margin: 3px 0 0; font-size: 11.5px; color: var(--text-mute); }

/* ---- 流程图：纯 CSS 竖线 + 圆点，不引入绘图库 ---- */
.plan-flow { display: flex; flex-direction: column; gap: 0; }
.flow-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0 6px 18px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.flow-node.has-next::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: -6px;
  width: 1px;
  background: var(--border);
}
.flow-dot {
  position: absolute;
  left: 0;
  top: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text-mute);
}
.flow-node.kind-start .flow-dot { border-color: var(--accent); }
.flow-node.kind-end .flow-dot { border-color: var(--accent); background: var(--accent); }
.flow-node.kind-decision .flow-dot { border-color: #6d28d9; }
.flow-node.kind-wait .flow-dot { border-color: #b45309; }
.flow-node.kind-unknown .flow-dot { border-color: var(--danger); border-style: dashed; }
.flow-node.kind-unknown .flow-label { color: var(--danger); }
.flow-label { line-height: 1.5; }
.flow-note { display: block; font-size: 11.5px; color: var(--text-mute); }

.plan-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-reset {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}
.plan-reset:hover { border-color: var(--accent); color: var(--accent); }
.plan-hint { font-size: 11.5px; color: var(--text-mute); }
.plan-note { margin: 4px 0 0; font-size: 12px; color: var(--text-soft); }

@media (max-width: 860px) {
  .plan-head { flex-direction: column; gap: 2px; }
  .plan-step { padding: 8px; }
  .plan-step-title { font-size: 12.5px; }
  .plan-actions { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- 回答版式（2026-10-31 简洁化） ----------
 *
 * 只加两组东西：结论强调 + 折叠行。不引入新配色、不改既有段落样式——
 * 折叠面板用中性底，避免页面上出现第三、第四种卡片颜色。
 */

/* 结论：左侧一条粗线 + 稍大字号。不用彩色卡片。 */
.answer-lead {
  margin: 0 0 14px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--accent);
}
.answer-lead .conclusion {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
}
/* 结论范围标签：「先说规则」/「按你填的信息」。
   存在的意义是把「政策怎么写」和「你符不符合」分开——不抢结论的字号，
   但要让人一眼看到这句话是哪一种。 */
.conclusion-scope {
  display: inline-block;
  margin-bottom: 2px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-mute);
}
.conclusion-scope.rule-only { color: var(--warn); }

/* 可信度小标记：只在「待核实 / 无可核对结论」时出现，不做成第二个徽标。 */
.confidence {
  font-size: 11.5px;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.confidence.needs_verification { color: var(--warn); border-color: #f0dcb8; background: var(--warn-soft); }
.confidence.insufficient { color: var(--text-soft); border-style: dashed; }

/* 折叠行：整行可点，箭头在最左，标题最多一行。 */
.fold { margin: 0 0 12px; }
.fold-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.fold-head:hover { background: var(--surface-2); color: var(--accent); }
.fold-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fold-arrow { color: var(--text-mute); width: 12px; flex: none; }
.fold-head.open .fold-label { color: var(--text); }
.fold-body { padding: 2px 0 2px 18px; }

/* 政策依据：一行一份文件，点开才显示原文。 */
.basis-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.basis-card .basis-item { border: none; background: none; border-radius: 10px; }
.basis-card .basis-item:hover { background: #fff; }
.basis-section { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.basis-body { padding: 0 12px 10px; border-top: 1px dashed var(--border); }
.basis-quote-full {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 8px 0 6px;
  white-space: pre-wrap;
}
.basis-jump { padding: 2px 0; font-size: 12px; }

/* 关键条件：一行一条，状态在前。 */
.condition-list { display: flex; flex-direction: column; gap: 8px; }
.condition-row { font-size: 13.5px; }
.condition-desc { margin-left: 6px; }
.condition-detail { font-size: 12px; color: var(--text-mute); margin-top: 2px; line-height: 1.6; }

/* 材料：紧跟步骤，属于「要交什么」，不进依据区。 */
.materials-inline { margin-top: 10px; }
.sub-section { margin-bottom: 10px; }
.sub-section:last-child { margin-bottom: 0; }
.sub-label { font-size: 11.5px; color: var(--text-mute); margin-bottom: 4px; }

.caveat-more { margin: 0; padding-left: 18px; }
.caveats-wrap .fold { margin-top: 4px; }

@media (max-width: 640px) {
  .answer-lead .conclusion { font-size: 15px; }
  .fold-body { padding-left: 8px; }
  .condition-detail { font-size: 11.5px; }
}

/* ---------- 交互式追问卡片 ----------
   设计基调与既有的 .clarify-box 一致（同样是「需要你确认」的语气），
   但它多了可点选的控件，所以：选项整行可点、点中后有明确选中态、
   提交与跳过分开摆、失效时整卡置灰并只留「重新提问」一个出口。 */

.clarify-wrap { margin: 10px 0 4px; }

.clarify-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
}

.clarify-head { margin-bottom: 8px; }

.clarify-title { font-size: 14px; color: var(--text); }

.clarify-message {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.clarify-questions { display: flex; flex-direction: column; gap: 14px; }

/* fieldset 默认带边框与内边距，这里全部清掉，只保留语义 */
.clarify-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.clarify-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin-bottom: 6px;
}

.clarify-question { font-size: 13.5px; font-weight: 600; color: var(--text); }

.clarify-optional {
  font-size: 11px;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
}

.clarify-why {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.55;
}

.clarify-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clarify-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.clarify-option:hover { border-color: var(--accent); }

.clarify-option.is-picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.clarify-input { accent-color: var(--accent); margin: 0; }

.clarify-option-label { line-height: 1.4; }

.clarify-free {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

.clarify-free:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.clarify-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.clarify-submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.clarify-submit:disabled { opacity: 0.55; cursor: default; }

.clarify-skip { font-size: 12.5px; color: var(--text-soft); }

.clarify-status {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  flex: 1 1 200px;
}

/* 提交中：整卡轻微降透明度，控件已 disabled，视觉上「锁住」 */
.clarify-card.is-busy { opacity: 0.85; }

/* 已提交：只读回执，不再强调行动 */
.clarify-card.is-done {
  border-left-color: var(--text-mute);
  background: var(--surface-2);
}
.clarify-card.is-done .clarify-field { opacity: 0.7; }

/* 失效：明确说清楚原因，只留「重新提问」 */
.clarify-card.is-stale {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.clarify-stale { margin-top: 8px; }

@media (max-width: 640px) {
  .clarify-card { padding: 12px 12px 10px; }
  .clarify-options { flex-direction: column; align-items: stretch; }
  /* 手机上整行可点，且高度不小于 44px，避免误触 */
  .clarify-option { min-height: 44px; }
  .clarify-foot { gap: 10px; }
  .clarify-submit { width: 100%; min-height: 44px; }
  .clarify-status { flex-basis: 100%; }
}
