/* =========================================================
   言间 · 温暖编辑式 / 关系手记
   主题：温暖纸白 + 深墨正文 + 陶土主按钮 + 鼠尾草绿 + 暖金点缀
   ========================================================= */
:root {
  /* 色板（对比度已按 WCAG AA 校准，见 docs 说明） */
  --bg: #F6F1EB;          /* 温暖纸白背景 */
  --bg-alt: #EFE8DD;      /* 区块 alt 背景（footer / 折叠区） */
  --card: #FFFCF8;        /* 卡面 */
  --card-2: #FBF5EE;      /* 次级卡 / 内嵌块 */
  --line: #E4DACB;        /* 细边框 */
  --line-strong: #D4C5B2; /* 强调边框 */
  --fg: #292522;          /* 深墨正文 */
  --muted: #645C54;       /* 次级文字（AA 通过） */
  --accent: #A3483A;      /* 陶土主按钮（白字 AA 5.7） */
  --accent-dark: #87382C; /* 深陶土（软底上的文字 / hover） */
  --accent-soft: #F2E2DA; /* 浅陶土 */
  --sage: #788779;        /* 鼠尾草绿（辅助） */
  --sage-soft: #E7EBE3;   /* 浅鼠尾草 */
  --gold: #D2AE70;        /* 暖金点缀 */
  --gold-soft: #F7EBD9;
  --danger: #A53B2F;      /* 危险（AA 通过） */
  --warn-bg: #FBF3E3;
  --warn-line: #E2B873;
  --focus: #B75D45;       /* 焦点环 */

  /* 字体 */
  --font-head: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  /* 圆角 / 阴影（轻量） */
  --r: 14px;
  --r-sm: 10px;
  --shadow-soft: 0 1px 2px rgba(41, 37, 34, 0.04), 0 8px 22px rgba(41, 37, 34, 0.06);
  --shadow-lift: 0 2px 4px rgba(41, 37, 34, 0.06), 0 14px 30px rgba(41, 37, 34, 0.10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* 页内锚点定位偏移：sticky header 不遮挡 #example / #privacy 等目标 */
#example, #privacy { scroll-margin-top: 72px; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ===== 焦点态（统一，键盘可达） ===== */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent-soft); color: var(--fg); }

/* ===== 章节眉题（eyebrow）===== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--accent-dark); text-transform: uppercase;
  margin-bottom: 8px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1px;
  background: var(--gold); display: inline-block;
}

/* ===== 容器 ===== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 88px;
}

@media (max-width: 768px) {
  .container { padding: 18px 16px 72px; }
}

/* ===== 导航 ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); flex: 0 0 auto; }
.brand-inner { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-size: 20px; font-weight: 700; letter-spacing: 3px;
  font-family: var(--font-head);
  white-space: nowrap;
}
.brand-tag { font-size: 11px; color: var(--muted); white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 8px;
}
.nav-links a:hover { color: var(--accent-dark); background: var(--accent-soft); }
.nav-links a.nav-link { border-bottom: 2px solid transparent; }
.nav-link.active {
  color: var(--accent-dark); font-weight: 600; background: transparent;
  border-bottom-color: var(--accent);
}
.nav-link.active:hover { background: var(--accent-soft); }

@media (max-width: 640px) {
  .brand-tag { display: none; }
  .nav-links { gap: 6px; }
  .nav { padding: 10px 14px; }
}

/* ===== 首屏 ===== */
.hero { padding: 28px 0 6px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
  align-items: center;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.28;
  margin: 4px 0 18px;
  letter-spacing: 0.5px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--fg);
}

.hero-sub {
  color: var(--fg);
  margin: 0 0 22px;
  font-size: 16px;
  max-width: 34em;
}

.cta-row { display: flex; gap: 12px; margin: 22px 0 18px; flex-wrap: wrap; }

.hero-warn {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0;
  color: var(--fg);
  max-width: 34em;
}

.hero-preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.mini-chat .bubble { font-size: 13px; margin-bottom: 8px; }
.mini-analysis { border-top: 1px dashed var(--line-strong); margin-top: 14px; padding-top: 12px; }
.mini-hook {
  display: inline-block; font-size: 13px; color: var(--accent-dark);
  text-decoration: none; font-weight: 600;
}
.mini-hook:hover { text-decoration: underline; color: var(--accent); }

@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero h1 { font-size: 30px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 25px; }
}

/* ===== 通用 section / card ===== */
.section { margin-top: 56px; }
.section h2 {
  font-size: 24px; margin: 2px 0 10px;
  font-family: var(--font-head); font-weight: 600; color: var(--fg);
}
.section .muted { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 480px) {
  .card { padding: 16px; border-radius: var(--r-sm); }
}

/* ===== 按钮 ===== */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
  line-height: 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--accent-soft);
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
}
.btn-secondary:hover { background: #ead4c8; border-color: #ead4c8; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.btn-danger:hover { background: rgba(165, 59, 47, 0.08); }

/* ===== 聊天气泡 ===== */
.chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; }
.bubble p { margin: 2px 0 0; }
.bubble .who { font-size: 11px; color: var(--muted); display: block; }
.bubble.them { align-self: flex-start; background: #EDE6DA; border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }

/* ===== 分析预览 ===== */
.analysis-preview { border-top: 1px dashed var(--line-strong); margin-top: 18px; padding-top: 10px; }
.analysis-preview ul { margin: 4px 0 10px; padding-left: 20px; }
.analysis-preview li { margin: 4px 0; }
.analysis-preview h3, .analysis-preview h4 { font-family: var(--font-head); }

/* ===== 表单 ===== */
.coach-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  background: var(--card-2);
}
.coach-form textarea:focus { background: var(--card); border-color: var(--accent); }

.coach-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.coach-row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.coach-row input, .coach-row select {
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 15px;
  min-height: 44px;
  background: var(--card-2);
  color: var(--fg);
}
.coach-row input:focus, .coach-row select:focus { border-color: var(--accent); background: var(--card); }

.coach-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.file-pick { display: inline-block; }

@media (max-width: 768px) {
  .coach-row { grid-template-columns: 1fr; }
}

/* ===== 锁定提示 ===== */
.lock-note {
  background: var(--gold-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}
.lock-note strong { color: var(--fg); }

/* ===== 结果 ===== */
.coach-result {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.coach-result .block { margin: 10px 0; }
.coach-result ul, .coach-result ol { padding-left: 20px; }
.coach-result li { margin: 4px 0; }
.coach-result h3, .coach-result h4 { font-family: var(--font-head); }
.coach-result h3 { margin-top: 4px; font-size: 20px; }
.coach-result h4 { font-size: 16px; color: var(--fg); margin: 6px 0 6px; }
/* 连续追问结果追加展示：与上一轮结果之间加分隔 */
.result-item + .result-item { margin-top: 18px; }
.result-item-followup {
  border-top: 2px solid var(--line-strong);
  padding-top: 18px;
}

.conf {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; margin-right: 6px; background: #EDE6DA; color: #4F4A44;
}
.conf-low { background: var(--gold-soft); color: #7A5C16; }
.conf-medium { background: var(--sage-soft); color: #3F6A46; }
.conf-high { background: #DCEDE1; color: #1F5C32; }

.reply {
  border-left: 3px solid var(--accent);
  padding: 8px 12px; margin: 8px 0;
  background: var(--accent-soft); border-radius: 8px;
}
.reply-level { font-size: 11px; color: var(--accent-dark); letter-spacing: 1px; font-weight: 600; }
.reply-text { margin: 4px 0; }
.reply-reason { margin: 4px 0; font-size: 13px; color: var(--muted); }

.method-template { background: var(--card-2); padding: 10px 12px; border-radius: 8px; font-size: 13px; border: 1px dashed var(--line-strong); }
.meta { font-size: 12px; margin-top: 12px; color: var(--muted); }

/* ===== 练习 ===== */
.practice-log {
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px; height: 280px; overflow-y: auto; margin: 8px 0;
}
.practice-log .bubble { margin-bottom: 8px; }
#practice-form { display: flex; gap: 8px; margin-top: 8px; }
#practice-form input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); font-size: 15px; background: var(--card-2);
}
#practice-form input:focus { border-color: var(--accent); background: var(--card); }

/* ===== 隐私列表 ===== */
.privacy-list { padding-left: 20px; margin: 0; }
.privacy-list li { margin: 10px 0; font-size: 15px; }
.privacy-list strong { color: var(--accent-dark); }
.privacy-more { margin-top: 14px; }
.privacy-more > summary {
  cursor: pointer; font-size: 13px; color: var(--muted);
  list-style: none; display: inline-block;
}
.privacy-more > summary::-webkit-details-marker { display: none; }
.privacy-more > summary::before { content: "▸ "; color: var(--gold); }
.privacy-more[open] > summary::before { content: "▾ "; }
.privacy-more > summary:hover { color: var(--accent-dark); }
.privacy-list-more { margin-top: 10px; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(41, 37, 34, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lift);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted);
}
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .auth-grid { grid-template-columns: 1fr; } }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form h3 { font-family: var(--font-head); margin: 0; }
.auth-form input, .auth-form select {
  padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 15px; min-height: 44px; background: var(--card-2);
}
.auth-form input:focus, .auth-form select:focus { border-color: var(--accent); background: var(--card); }

/* ===== 杂项 ===== */
.form-note { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.form-msg { margin: 10px 0 0; font-size: 13px; }
.form-msg.ok { color: #2E6B3A; }
.form-msg.err { color: var(--danger); }
.muted { color: var(--muted); }

.dev-stub {
  margin-top: 16px; padding: 12px;
  background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: var(--r-sm);
}
.dev-stub button {
  margin-right: 6px; margin-top: 6px; padding: 6px 12px;
  border: 1px solid var(--gold); background: var(--card); border-radius: 999px;
  cursor: pointer; font-size: 12px; color: var(--fg);
}

.site-footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 32px 20px; border-top: 1px solid var(--line);
  margin-top: 60px; background: var(--bg-alt);
}
.footer-inner {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px; text-align: left; flex-wrap: wrap;
}
.footer-copy p { margin: 2px 0; }
.footer-links { display: flex; gap: 36px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col-title {
  font-size: 11px; letter-spacing: 0.1em; color: var(--fg); font-weight: 600;
  margin-bottom: 2px;
}
.footer-col a { color: var(--muted); text-decoration: none; font-size: 12px; }
.footer-col a:hover { color: var(--accent-dark); text-decoration: underline; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 24px; }
}

/* ===== LAB（仅 root 可见） ===== */
.lab-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.lab-badge {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: #7C3AED; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}

/* ===== 知识库判定徽标与待审改判 ===== */
.kb-badge {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.kb-badge-pua { background: #B3261E; }
.kb-badge-pass { background: #2E7D32; }
.kb-badge-pending { background: #8A6D00; }
.kb-review-row { margin-top: 8px; display: flex; gap: 8px; }
.kb-review-row .btn-ghost, .kb-review-row .btn-danger {
  padding: 4px 12px; font-size: 13px; border-radius: 6px;
}
.kb-review-row .btn-ghost { border-color: var(--line); background: none; cursor: pointer; }
.kb-review-row .btn-danger { border-color: var(--danger); color: var(--danger); background: none; cursor: pointer; }
.kb-review-row .btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.kb-review-row .btn-danger:hover { background: rgba(165, 59, 47, 0.08); }

/* ===== 账号页（我的）：五卡片 + 绑定 + 删除弹窗 ===== */
.me-wrap { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.lock-note {
  padding: 20px; border-radius: var(--r);
  background: var(--gold-soft); border: 1px dashed var(--gold);
  font-size: 15px; color: var(--fg);
}
.me-card h3 { margin: 0 0 10px; font-family: var(--font-head); }
.me-row { margin: 8px 0; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.me-row strong { color: var(--fg); }
.me-actions { margin-top: 12px; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--line); color: var(--fg); font-size: 12px; font-weight: 600;
}
.badge-ok { background: #2E6B3A; color: #fff; }
.btn-text-inline {
  background: none; border: none; padding: 2px 6px; cursor: pointer;
  color: var(--accent-dark); font-size: 13px; text-decoration: underline;
}
.bind-panel {
  margin-top: 12px; padding: 14px 16px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.bind-panel h4 { margin: 0 0 6px; font-family: var(--font-head); }
.bind-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.bind-row .field-label { min-width: 64px; }
.bind-row input {
  flex: 1 1 160px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 15px; min-height: 44px; background: var(--card);
}
.bind-row input:focus { border-color: var(--accent); outline: none; }
.bind-row button { flex: 0 0 auto; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.delete-card input {
  display: block; width: 100%; margin: 6px 0 12px; padding: 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 15px; min-height: 44px; background: var(--card-2);
  box-sizing: border-box;
}
.delete-card input:focus { border-color: var(--accent); background: var(--card); }
.delete-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.quota-line { margin: 8px 0; font-size: 15px; }
.quota-danger { color: var(--danger); }
.danger-card { border: 1px solid rgba(165, 59, 47, 0.45); background: rgba(165, 59, 47, 0.03); }
.danger-card h3 { color: var(--danger); }
.privacy-link { color: var(--accent-dark); }
@media (max-width: 480px) {
  .bind-row { flex-direction: column; align-items: stretch; }
  .bind-row .field-label { min-width: 0; }
  .delete-actions { flex-direction: column-reverse; }
  .delete-actions .btn-danger, .delete-actions .btn-ghost { width: 100%; text-align: center; }
}

/* ===== 小屏优化 ===== */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .section { margin-top: 40px; }
  .section h2 { font-size: 21px; }
  .btn-primary:not(#nav-auth-btn), .btn-secondary:not(#nav-auth-btn), .btn-ghost:not(#nav-auth-btn) { width: 100%; text-align: center; }
  .cta-row { flex-direction: column; }
  #practice-form { flex-direction: column; }
}

/* ===== E2：输入 tabs / 上传卡片 / 结果 ===== */
.input-tabs {
  display: inline-flex; gap: 4px; margin-bottom: 16px;
  background: var(--bg-alt); padding: 4px; border-radius: 10px;
}
.tab-btn {
  background: transparent; border: none; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; cursor: pointer; color: var(--muted); min-height: 36px;
}
.tab-btn.active {
  background: var(--card); color: var(--fg); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field-label .muted { font-size: 12px; }

.upload-card {
  display: block; border: 2px dashed var(--line-strong); border-radius: var(--r);
  padding: 32px; text-align: center; cursor: pointer; background: var(--card-2);
  transition: border-color 0.15s, background 0.15s;
}
.upload-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-icon { font-size: 30px; color: var(--accent); line-height: 1; margin-bottom: 8px; }

.upload-preview { display: flex; gap: 16px; align-items: center; margin-top: 12px; padding: 12px; background: var(--card-2); border-radius: var(--r-sm); }
.upload-preview img { max-width: 120px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }

.reply { position: relative; }
.reply-copy {
  position: absolute; top: 8px; right: 8px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 6px;
  font-size: 11px; padding: 2px 8px; cursor: pointer; color: var(--muted);
}
.reply-copy:hover { color: var(--accent-dark); border-color: var(--accent); }

.citation-item { font-size: 13px; color: var(--muted); }

/* ===== E3：view 切换 + 底部导航 ===== */
.view h2 { margin-top: 0; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 50; height: calc(56px + env(safe-area-inset-bottom));
}
.bn-link {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px;
  min-width: 64px; padding: 4px;
}
.bn-link.active { color: var(--accent); }
.bn-icon { font-size: 18px; line-height: 1; }

@media (min-width: 769px) {
  .bottom-nav { display: none; }
}

body.has-bottom-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }

.nav-link.active { color: var(--accent-dark); font-weight: 600; border-bottom: 2px solid var(--accent); }

#practice-card { margin-top: 12px; }

/* ===== E4：链接/按钮重置 & header 居中 ===== */
.nav a, .bottom-nav a { color: var(--fg); text-decoration: none; }
.nav a:hover { color: var(--accent-dark); }

.site-header .nav {
  max-width: 1160px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

button { font-family: inherit; }
main a { color: var(--accent-dark); }
main a:hover { text-decoration: underline; }

.mini-analysis li, .analysis-preview li { font-size: 13px; }

/* ===== 直接提问入口（Phase 1 检索式问答，复用 coach-result 样式）===== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ask-panel { margin: 24px 0 8px; }
.ask-panel-inline {
  margin: 0 0 16px; padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-strong);
}
.ask-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--fg); }
.ask-bar { display: flex; align-items: center; gap: 8px; }
.ask-bar input {
  flex: 1; min-height: 44px; padding: 0 12px; font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--card-2); color: var(--fg);
}
.ask-bar input:focus { border-color: var(--accent); background: var(--card); outline: none; }
/* width:auto 覆盖小屏媒体查询里的 .btn-primary { width:100% }（验证报告 F9）。
   那条规则带 :not(#nav-auth-btn)，ID 使优先级升到 (1,1,0)，故这里补同样的 :not(#nav-auth-btn)
   让本规则 (1,2,0) 胜出，否则 width 会被按容器拉满、按钮溢出屏幕。 */
.ask-bar .btn-primary:not(#nav-auth-btn) { flex: 0 0 auto; width: auto; min-width: 64px; min-height: 44px; padding: 0 16px; }
.ask-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.ask-status { margin: 6px 0 0; }
.ask-result { margin-top: 12px; }
.ask-result .ask-conclusion { font-weight: 600; margin: 6px 0 10px; }
.ask-result .ask-distress {
  background: var(--gold-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px;
}

[hidden] { display: none !important; }

/* 用户头像 chip */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); cursor: pointer;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-chip .email { font-size: 13px; color: var(--fg); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 情景练习简介卡片 */
.practice-intro {
  margin: 36px 0 0; padding: 22px 24px;
  background: var(--sage-soft); border: 1px solid #CBD4C4; border-radius: var(--r);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.practice-intro h3 { margin: 0 0 8px; font-size: 18px; font-family: var(--font-head); }
.practice-intro p { margin: 0; color: var(--fg); font-size: 14px; max-width: 640px; }
.practice-intro .btn-secondary { white-space: nowrap; }
.practice-cta-side { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.gate-note { font-size: 12px; color: var(--sage); text-align: center; }
@media (max-width: 640px) {
  .practice-intro { flex-direction: column; align-items: flex-start; }
  .practice-intro .btn-secondary { width: 100%; text-align: center; }
}

/* ===== F：手机端 360-430px 适配 ===== */
.brand-name { white-space: nowrap; }
.brand-tag { white-space: nowrap; }

@media (max-width: 640px) {
  .nav-links .nav-link { display: none; }
  .nav-links { gap: 8px; }
  .nav { padding: 10px 12px !important; }
  .brand { gap: 6px; }
  .brand-name { font-size: 17px; }
  .brand-tag { display: none; }
}

@media (max-width: 640px) {
  .user-chip .email { display: none; }
  .user-chip { padding: 4px; }
}

@media (max-width: 640px) {
  body.keyboard-open .bottom-nav { display: none; }
  body.keyboard-open { padding-bottom: 0 !important; }
}

@media (max-width: 640px) {
  .coach-actions { padding-bottom: 8px; margin-bottom: 8px; }
  .coach-result { margin-bottom: 16px; }
}

.coach-row label { font-size: 12px; }
.coach-actions .btn-primary { width: 100%; }

/* ===== F2：历史列表卡片 / 个人页反馈 ===== */
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; margin: 12px 0;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.history-item .meta { font-size: 12px; color: var(--muted); }
.history-item .title { font-size: 15px; line-height: 1.55; margin: 4px 0 0; overflow-wrap: anywhere; }
.history-item button {
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer;
  color: var(--danger);
}
.history-item button:hover { border-color: var(--danger); }

.history-item-body { min-width: 0; width: 100%; }
.history-actions { display: flex; gap: 8px; margin-top: 12px; }
.history-actions button {
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 7px 14px; font-size: 12px; cursor: pointer;
  min-height: 40px;
}
.history-actions .btn-text { color: var(--accent-dark); border-color: var(--accent-soft); }
.history-actions .btn-text:hover { background: var(--accent-soft); }
.history-actions .btn-danger-text { color: var(--danger); }
.history-actions .btn-danger-text:hover { border-color: var(--danger); }

.history-view-body {
  background: var(--card-2); border-radius: 8px; padding: 12px;
  font-size: 12px; white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
}

.history-result-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 8px;
}
.history-result-banner .history-label { margin: 0; }
.history-result-banner a { color: var(--accent-dark); font-size: 13px; text-decoration: none; white-space: nowrap; }
.history-result-banner a:hover { text-decoration: underline; }

.reply-authenticity { margin: -4px 0 14px; color: var(--muted); font-size: 13px; }

/* ===== H：结果页结构 ===== */
.reply-primary {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 10px;
}
.reply-primary .reply-text { font-size: 16px; line-height: 1.7; margin: 6px 0; }

.unknown-block {
  background: var(--gold-soft);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
}
.unknown-block h4 { margin: 0 0 6px; color: var(--accent-dark); }
.unknown-block ul { margin: 0; padding-left: 20px; }

.detail-block {
  margin-top: 16px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}
.detail-block > summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 14px;
  padding: 8px 0;
  user-select: none;
  font-weight: 600;
}
.detail-block > summary:hover { text-decoration: underline; }

.history-label { margin: 0 0 8px; font-size: 12px; }

.empty-state, .loading-state, .error-state {
  text-align: center; padding: 32px 16px; color: var(--muted); font-size: 14px;
}
.error-state { color: var(--danger); }

.btn-busy { opacity: 0.6; pointer-events: none; }

/* ===== J：首页示例折叠 / 详情 summary ===== */
.example-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.example-details > summary::-webkit-details-marker { display: none; }
/* summary 内标题样式（替换原内嵌 h2 的视觉） */
.example-details > summary .summary-title {
  font-size: 24px; font-family: var(--font-head);
  font-weight: 600; color: var(--fg);
}
@media (max-width: 560px) {
  .example-details > summary .summary-title { font-size: 21px; }
}
.example-details > summary::after {
  content: " ▾";
  color: var(--gold);
}
.example-details[open] > summary::after { content: " ▴"; }
.example-details .card { margin-top: 12px; }
.example-label {
  display: inline-block; font-size: 11px; color: var(--accent-dark);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 6px;
  letter-spacing: 0.04em; margin: 0 0 8px;
}

/* OCR 清理建议 */
.ocr-suggest {
  margin-top: 12px; padding: 12px;
  background: var(--card-2); border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
}
.ocr-suggest h5 { margin: 0 0 8px; font-size: 13px; color: var(--accent-dark); }
.ocr-suggest textarea {
  width: 100%; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 13px; font-family: monospace;
  background: var(--bg);
}

.user-chip { text-decoration: none; }
.user-menu-wrap { position: relative; display: inline-flex; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 148px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow-lift); padding: 6px; z-index: 30;
}
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; text-decoration: none;
  font: inherit; font-size: 13px; color: var(--fg); background: transparent;
  border: none; padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.user-menu a:focus-visible, .user-menu button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ===== 情景练习页 ===== */
.practice-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.practice-head-copy { flex: 1 1 auto; min-width: 0; }
.practice-head-copy h2 { margin-top: 0; }
.practice-quota {
  flex: 0 0 auto; min-width: 178px; padding: 12px 14px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 3px;
}
.quota-label { color: var(--muted); font-size: 11px; letter-spacing: 0.05em; }
.quota-main { color: var(--fg); font-size: 13px; }
.quota-main strong { color: var(--accent-dark); font-size: 20px; font-family: var(--font-head); line-height: 1.1; }
.quota-reset { color: #8A8178; font-size: 11px; }
.quota-upgrade-link {
  margin-top: 4px; padding: 0; border: none; background: transparent;
  color: var(--accent-dark); font: inherit; font-size: 12px; font-weight: 600;
  text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.quota-upgrade-link:hover { color: var(--accent); }
.quota-upgrade-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.practice-closed h3, .practice-closed > strong { display: block; margin-bottom: 8px; }
.practice-closed p { margin: 6px 0 8px; color: var(--muted); font-size: 13px; }
.practice-closed ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.practice-scenario-card.is-locked {
  cursor: pointer; opacity: 0.72; background: var(--bg-alt); border-color: var(--line);
}
.practice-scenario-card.is-locked:hover {
  opacity: 0.9; transform: none; box-shadow: var(--shadow-soft); border-color: var(--line-strong);
}
.practice-scenario-card.is-locked .scenario-action { color: var(--muted); font-size: 12px; }
.practice-scenario-card.is-quota-empty .scenario-action { color: var(--accent-dark); }
.practice-scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.practice-scenario-card {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  min-height: 190px; width: 100%; padding: 18px;
  text-align: left; color: var(--fg); font: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.practice-scenario-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.practice-scenario-card:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(183, 93, 69, 0.18);
}
/* 奇数张时最后一张居中，避免最后一行孤零零贴在左侧 */
.practice-scenario-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 7px);
  justify-self: center;
}
.scenario-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scenario-category {
  color: var(--accent-dark); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft);
}
.scenario-difficulty {
  color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--bg-alt);
}
.scenario-difficulty.diff-初级 { color: #3F6A46; background: var(--sage-soft); }
.scenario-difficulty.diff-中级 { color: #7A5C16; background: var(--gold-soft); }
.scenario-difficulty.diff-高级 { color: var(--accent-dark); background: #F3DED7; }
.scenario-title { margin-top: 10px; font-size: 17px; line-height: 1.4; font-weight: 700; font-family: var(--font-head); }
.scenario-summary {
  margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.scenario-bottom {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 14px;
}
.scenario-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.scenario-action {
  flex: 0 0 auto; color: var(--accent-dark);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.scenario-arrow { display: inline-block; transition: transform 160ms ease; }
.practice-scenario-card:hover .scenario-arrow { transform: translateX(2px); }
.scenario-check {
  position: absolute; top: 12px; left: 12px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--sage-soft); color: #2E6B3A;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1;
}
/* 有对勾时分类标签右移，避免遮挡 */
.practice-scenario-card.has-check .scenario-top { padding-left: 18px; }

/* 分类筛选 Tab */
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.category-tab {
  font: inherit; font-size: 13px; color: var(--muted);
  background: var(--bg-alt); border: 1px solid transparent; border-radius: 999px;
  padding: 6px 13px; cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.category-tab:hover { color: var(--accent-dark); border-color: var(--line-strong); }
.category-tab.active {
  color: var(--card); background: var(--accent); border-color: var(--accent);
  font-weight: 600;
}
.category-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 继续上次练习 banner */
.practice-resume-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin-top: 14px; padding: 12px 16px;
  background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: var(--r-sm); color: var(--fg); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.practice-resume-banner:hover {
  background: var(--gold-soft); border-color: var(--gold); transform: translateY(-1px);
}
.practice-resume-banner:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.practice-resume-banner .resume-arrow { color: var(--accent-dark); font-weight: 700; transition: transform 160ms ease; }
.practice-resume-banner:hover .resume-arrow { transform: translateX(2px); }

.practice-picker-label { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.practice-report-link {
  display: inline-block; margin-top: 16px; font-size: 13px; color: var(--muted);
  text-decoration: none; border-bottom: 1px dashed var(--line-strong);
}
.practice-report-link span { color: var(--accent-dark); font-weight: 600; }
.practice-report-link:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }
.practice-report-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.practice-disclaimer {
  margin-top: 26px; padding-top: 14px; border-top: 1px dashed var(--line);
  color: #8A8178; font-size: 12px;
}

/* ===== 练习对话页 ===== */
.session-view { max-width: 860px; }
.session-shell {
  display: flex; flex-direction: column; min-height: 560px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-soft); overflow: hidden;
}
.session-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card);
}
.session-back {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-2); color: var(--fg);
  font-size: 18px; line-height: 1; cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.session-back:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.session-back:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.session-heading { flex: 1 1 auto; min-width: 0; }
.session-heading h2 { margin: 0; font-size: 18px; line-height: 1.35; font-family: var(--font-head); }
.session-heading .muted { font-size: 12px; }
.session-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.session-rounds {
  font-size: 12px; color: var(--accent-dark); font-weight: 600; white-space: nowrap;
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--card-2);
  cursor: pointer; font-size: 15px; line-height: 1;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.session-disclosure {
  margin: 12px 16px 0; padding: 8px 12px; border-radius: 8px;
  background: var(--gold-soft); color: #6F571C; font-size: 12px; line-height: 1.55;
}
.session-log {
  flex: 1 1 auto; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}
.session-msg { display: flex; align-items: flex-start; gap: 8px; max-width: 88%; }
.session-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.session-msg.user .msg-stack { align-items: flex-end; }
.msg-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.ai-avatar { background: var(--accent); color: #fff; }
.user-avatar { background: var(--sage); color: #fff; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.session-msg.ai .msg-bubble { border-bottom-left-radius: 4px; }
.session-msg.user .msg-bubble { background: var(--accent-soft); border-color: #E7CDC2; border-bottom-right-radius: 4px; }
.session-msg.failed .msg-bubble { border-color: var(--danger); color: var(--danger); background: #FBE9E6; }
.msg-retry {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  border: 1px solid var(--danger); background: transparent; color: var(--danger);
  border-radius: 999px; padding: 2px 9px; font-size: 11px; cursor: pointer;
}
.msg-retry:hover { background: var(--danger); color: #fff; }
.msg-retry:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.session-msg.user .msg-retry { margin-left: auto; }
.session-date { align-self: center; color: #8A8178; font-size: 11px; }
.typing-row { display: flex; align-items: center; gap: 8px; padding: 0 16px 10px; background: var(--bg); }
.typing-bubble {
  padding: 8px 13px; border-radius: 14px; border-bottom-left-radius: 4px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.typing-dots { display: inline-block; animation: typingPulse 1.2s ease-in-out infinite; }
@keyframes typingPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.session-ended {
  margin: 0 16px 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--sage-soft); color: #3F6A46; font-size: 13px; text-align: center;
}
.session-composer {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: var(--card); margin: 0;
}
.session-composer input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: 14px; background: var(--card);
}
.session-composer input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(183,93,69,.14); }
.session-composer input:disabled { background: var(--bg-alt); color: var(--muted); cursor: not-allowed; }
.session-composer .btn-primary { flex: 0 0 auto; min-width: 76px; min-height: 44px; }
.session-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 16px; }
.session-footer .btn-secondary { flex: 0 0 auto; }
.session-footer .form-msg { margin: 0; text-align: right; }
.confirm-card { max-width: 440px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.practice-review-card { margin-bottom: 20px; }

@media (max-width: 768px) {
  .practice-head { flex-direction: column; gap: 10px; }
  .practice-quota { width: 100%; min-width: 0; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
  .practice-scenario-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .practice-scenario-card,
  .practice-scenario-card:last-child:nth-child(odd) {
    grid-column: auto; width: 100%; justify-self: stretch;
  }
  .practice-scenario-card { min-height: 160px; padding: 16px; }
  .session-shell { min-height: calc(100vh - 160px); border-radius: 0; }
  .session-log { padding: 12px; }
  .session-footer { flex-direction: column; align-items: stretch; }
  .session-footer .btn-secondary { width: 100%; }
  .session-footer .form-msg { text-align: left; }
  .scenario-bottom { align-items: flex-start; }
  .history-item { align-items: stretch; padding: 14px; }
  .history-actions { margin-top: 12px; }
  .history-result-banner { align-items: flex-start; }
}

/* 手机端压缩首页高度：减少 section 间距 */
@media (max-width: 480px) {
  .section { margin-top: 28px !important; }
  .hero { padding: 12px 0 4px; }
  .practice-intro { padding: 16px; margin-top: 20px; }
  .how-it-works { margin: 20px 0 4px; }
  .site-footer { margin-top: 30px; padding: 20px 16px; }
}

/* ===== 反馈条 ===== */
.feedback-bar {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong);
}
.feedback-bar button {
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; min-height: 40px;
}
.feedback-bar button:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ===== 复盘展示（L8：4 维可观察行为） ===== */
.review-dim {
  margin: 10px 0; padding: 12px 14px;
  background: var(--card-2); border-left: 3px solid var(--sage);
  border-radius: 8px;
}
.review-dim .dim-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.review-dim .dim-score {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--sage-soft); color: #3F6A46;
}
.review-dim .dim-evidence { margin: 6px 0 2px; font-size: 13px; color: var(--fg); }
.review-dim .dim-evidence .lbl, .review-dim .dim-alt .lbl { color: var(--muted); font-size: 12px; }
.review-dim .dim-alt { margin-top: 4px; font-size: 13px; color: var(--muted); }
.review-dim .dim-alt strong { color: var(--accent-dark); }

/* ===== 首屏优先：prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== K：知识库摄入管理（root 专属视图）===== */
.kb-row {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0;
}
.kb-row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--muted); flex: 1 1 240px;
}
.kb-row input[type="text"], .kb-row select {
  width: 100%; box-sizing: border-box;
}

.kb-task-item {
  border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; margin: 8px 0;
  background: var(--bg-soft);
}
.kb-progress {
  height: 8px; border-radius: 6px; overflow: hidden;
  background: var(--line-strong); margin: 8px 0;
}
.kb-progress-bar {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.4s ease;
}
.kb-err { color: var(--danger); }

.kb-side {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 1px 8px;
}

.kb-version-table { display: flex; flex-direction: column; gap: 4px; }
.kb-version-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
  font-size: 13px;
}
.kb-version-row.active {
  border-color: var(--gold); background: var(--gold-soft);
}
.kb-vkey { font-weight: 600; }
.kb-vstatus { color: var(--muted); text-transform: capitalize; }
.kb-vcounts { color: var(--muted); }

/* ===== L11 增量：隐私确认 / 连续追问 / 定价购买（复用 L9 token） ===== */
.privacy-ack {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 14px 0 4px; font-size: 13px; line-height: 1.55;
  color: var(--muted);
}
.privacy-ack input {
  width: auto; margin: 2px 0 0; flex: 0 0 auto;
  accent-color: var(--accent);
}

.coach-followup {
  margin-top: 18px; padding: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.coach-followup h4 {
  margin: 0 0 8px; font-family: var(--font-head); font-size: 18px;
}
.coach-followup textarea {
  width: 100%; min-height: 96px; box-sizing: border-box;
  padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; color: var(--fg); background: var(--card); resize: vertical;
}
.coach-followup textarea:focus {
  outline: none; border-color: var(--accent); background: var(--card);
}
.followup-banner {
  margin: 6px 0 12px; padding: 8px 12px;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 8px; font-size: 13px;
}

.pricing-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.price-group { border-top: 1px solid var(--line); padding-top: 12px; }
.price-head { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.price-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.price-card {
  position: relative; padding: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px;
}
.price-card.price-rec { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.price-badge {
  position: absolute; top: -10px; right: 10px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; letter-spacing: 1px;
}
.price-now {
  position: absolute; top: -10px; left: 10px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--fg); color: #fff; font-size: 11px; letter-spacing: 1px;
}
.price-card.price-current { border-color: var(--fg); }
.price-card h4 { margin: 0 0 4px; font-size: 15px; font-family: var(--font-head); }
.price-amount { margin: 4px 0 6px; font-size: 20px; font-weight: 700; color: var(--accent-dark); }
.price-card .btn-secondary { margin-top: 8px; min-height: 44px; width: 100%; }
.pricing-pay {
  margin-top: 12px; padding: 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--bg-alt);
}
