/* ==========================================================================
   合同避坑助手 · 样式
   设计语言：纸质法律文书 + 荧光笔标注
   纸底/墨字/印章朱红，标题用衬线体以贴合"文书"气质
   ========================================================================== */

:root {
  --paper: #f5f2eb;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1b1917;
  --ink-2: #57514a;
  --ink-3: #8b8478;
  --line: #e6e0d5;
  --line-2: #d8d1c4;

  --seal: #a93226;
  --seal-bg: #fbece9;
  --amber: #92640f;
  --amber-bg: #fbf3e0;
  --slate: #41586e;
  --slate-bg: #eef2f6;
  --jade: #256b4e;
  --jade-bg: #e9f3ed;
  --marker: #ffeda0;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-1: 0 1px 2px rgba(27, 25, 23, 0.06), 0 1px 1px rgba(27, 25, 23, 0.04);
  --shadow-2: 0 8px 24px rgba(27, 25, 23, 0.09);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;

  --topbar-h: 52px;
  --tabbar-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  background-image:
    radial-gradient(circle at 18% 12%, rgba(169, 50, 38, 0.035), transparent 42%),
    radial-gradient(circle at 85% 78%, rgba(65, 88, 110, 0.045), transparent 46%);
  background-attachment: fixed;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- 布局骨架 */

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(27, 25, 23, 0.06);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: rgba(245, 242, 235, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px 0 8px;
  margin-left: -4px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
}
.topbar__back:hover { background: rgba(27, 25, 23, 0.05); }
.topbar__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__title--brand {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
}

.view {
  flex: 1;
  padding: 16px 16px calc(var(--tabbar-h) + 46px);
  outline: none;
  animation: viewIn 0.22s ease both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- 底部导航栏 */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.3px;
  position: relative;
  transition: color 0.2s ease;
}
.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--seal);
}
.tabbar__item[aria-current="page"] svg { color: var(--seal); }

/* -------------------------------------------------------------- 通用组件 */

.brandmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--seal);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.hero { padding: 10px 2px 20px; position: relative; }
/* 首页角上的印章装饰 */
.hero::after {
  content: "鉴";
  position: absolute;
  right: 4px;
  top: 2px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(169, 50, 38, 0.45);
  border-radius: 8px;
  color: rgba(169, 50, 38, 0.55);
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  transform: rotate(6deg);
  box-shadow: inset 0 0 0 1px rgba(169, 50, 38, 0.12);
  pointer-events: none;
}
.hero__eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--seal);
  font-weight: 700;
  margin-bottom: 10px;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--marker) 62%);
  padding: 0 2px;
}
.hero__desc {
  font-size: 14.5px;
  color: var(--ink-2);
  margin: 0;
}

.section {
  margin-top: 26px;
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section__title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section__title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--ink);
  flex: none;
}
.section__note { font-size: 12.5px; color: var(--ink-3); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* 场景入口卡 */
.scene {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 16px 15px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.scene:hover { border-color: var(--line-2); box-shadow: 0 10px 26px rgba(27, 25, 23, 0.11); transform: translateY(-2px); }
.scene:active { transform: scale(0.985); }
.scene__top { display: flex; align-items: center; gap: 10px; }
.scene__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.scene:hover .scene__icon {
  background: var(--seal-bg);
  border-color: rgba(169, 50, 38, 0.35);
  color: var(--seal);
  transform: rotate(-4deg) scale(1.05);
}
.scene__name {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex: 1;
}
.scene__arrow { color: var(--ink-3); flex: none; transition: transform 0.2s ease, color 0.2s ease; }
.scene:hover .scene__arrow { transform: translateX(3px); color: var(--seal); }
.scene__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}
.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.notice {
  display: flex;
  gap: 9px;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  background: var(--jade-bg);
  border: 1px solid rgba(37, 107, 78, 0.16);
  font-size: 13px;
  line-height: 1.6;
  color: #1f5a41;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.btn:active { transform: scale(0.985); }
.btn--primary {
  background: var(--ink);
  color: #fff;
  width: 100%;
  box-shadow: 0 3px 10px rgba(27, 25, 23, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn--primary:not(:disabled):hover {
  background: #2d2924;
  box-shadow: 0 5px 16px rgba(27, 25, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn--primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--ghost {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 输入区 */
.editor {
  width: 100%;
  min-height: 240px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.8;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(27, 25, 23, 0.03);
}
.editor::placeholder { color: #a9a29a; }
.editor:focus { outline: none; border-color: var(--ink-3); }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 2px 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.hint {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-top: 12px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- 报告页 */

.score-card {
  padding: 20px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  border-top: 4px solid var(--ink);
  margin-bottom: 14px;
}
.score-card[data-level="low"] { border-top-color: var(--jade); }
.score-card[data-level="mid"] { border-top-color: var(--amber); }
.score-card[data-level="high"] { border-top-color: var(--seal); }

.score-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.score-dial {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--dial, var(--ink)) calc(var(--pct, 0) * 1%), var(--line) 0);
  animation: dialIn 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}
@keyframes dialIn {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.score-dial::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface);
}
.score-dial__num {
  position: relative;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}
.score-dial__unit { position: relative; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.score-dial__inner { display: flex; flex-direction: column; align-items: center; }

.score-card__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 5px;
  letter-spacing: 0.4px;
}
.score-card__sub { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.score-counts { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.score-counts__item { font-size: 12.5px; color: var(--ink-3); }
.score-counts__num { display: block; font-family: var(--font-serif); font-size: 21px; font-weight: 700; line-height: 1.2; }
.score-counts__item[data-k="high"] .score-counts__num { color: var(--seal); }
.score-counts__item[data-k="mid"] .score-counts__num { color: var(--amber); }
.score-counts__item[data-k="low"] .score-counts__num { color: var(--slate); }

/* 风险卡 */
.risk {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  margin-bottom: 10px;
  overflow: hidden;
}
.risk[data-sev="high"] { border-left-color: var(--seal); }
.risk[data-sev="mid"] { border-left-color: var(--amber); }
.risk[data-sev="low"] { border-left-color: var(--slate); }

.risk__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px 14px 14px 13px;
  transition: background 0.2s ease;
}
.risk__head:hover { background: var(--surface-2); }
.risk__badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 5px;
  margin-top: 2px;
  white-space: nowrap;
}
.risk[data-sev="high"] .risk__badge { background: var(--seal-bg); color: var(--seal); }
.risk[data-sev="mid"] .risk__badge { background: var(--amber-bg); color: var(--amber); }
.risk[data-sev="low"] .risk__badge { background: var(--slate-bg); color: var(--slate); }

.risk__title { flex: 1; font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.risk__chev { flex: none; color: var(--ink-3); transition: transform 0.2s ease; margin-top: 3px; }
.risk[data-open="1"] .risk__chev { transform: rotate(90deg); }

.risk__body { padding: 0 14px 16px; display: none; }
.risk[data-open="1"] .risk__body { display: block; animation: viewIn 0.2s ease both; }

.field { margin-top: 13px; }
.field:first-child { margin-top: 0; }
.field__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-3);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field__label::before { content: ""; width: 12px; height: 2px; background: var(--line-2); border-radius: 2px; }
.field__text { font-size: 14px; color: var(--ink-2); line-height: 1.75; }

.quote {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  word-break: break-all;
}
.quote mark {
  background: var(--marker);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 600;
}

.law {
  font-size: 13px;
  color: var(--slate);
  background: var(--slate-bg);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  line-height: 1.7;
}

.fix {
  border: 1px solid rgba(37, 107, 78, 0.22);
  background: var(--jade-bg);
  border-radius: var(--radius-xs);
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.75;
  color: #1c5039;
}

/* 缺失条款 */
.missing-list { margin: 0; padding: 0; list-style: none; }
.missing-list li {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: flex-start;
}
.missing-list li:last-child { border-bottom: none; }
.missing-list b { font-weight: 600; }
.missing-list small { color: var(--ink-3); font-size: 12.5px; display: block; margin-top: 2px; }
.missing-list__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  margin-top: 9px;
}

.empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--ink-2);
}
.empty__icon {
  font-family: var(--font-serif);
  font-size: 34px;
  color: var(--jade);
  margin-bottom: 8px;
}
.empty__title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty__desc { font-size: 13.5px; color: var(--ink-2); margin: 0; }

/* -------------------------------------------------------------- 知识库 */

.filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-2);
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

.entry {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-bottom: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.entry:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.entry:active { transform: scale(0.99); }
.entry__cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--seal);
  margin-bottom: 5px;
}
.entry__title { font-size: 15.5px; font-weight: 600; line-height: 1.5; margin-bottom: 4px; }
.entry__sum { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

.article__title {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.4;
  margin: 6px 0 8px;
  letter-spacing: 0.4px;
}
.article__sum {
  font-size: 14px;
  color: var(--ink-2);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
}
.article h3 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 22px 0 9px;
  letter-spacing: 0.3px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.article h3::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--seal);
  flex: none;
}
.article p { font-size: 14.5px; line-height: 1.85; margin: 0 0 11px; color: var(--ink-2); }
.article ol, .article ul { margin: 0 0 12px; padding-left: 0; list-style: none; }
.article li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.85;
  margin-bottom: 8px;
  color: var(--ink-2);
}
.article li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-2);
}
.article ol { counter-reset: step; }
.article ol li { padding-left: 27px; }
.article ol li::before {
  counter-increment: step;
  content: counter(step);
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.article .law { margin-bottom: 12px; }
.article strong { color: var(--ink); font-weight: 600; }

/* 话术卡 */
.phrase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  margin-bottom: 11px;
  box-shadow: var(--shadow-1);
}
.phrase__scene {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--slate);
  margin-bottom: 5px;
}
.phrase__title { font-size: 15px; font-weight: 600; margin-bottom: 9px; }
.phrase__body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  padding: 11px 12px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
}
.phrase__foot { display: flex; justify-content: flex-end; margin-top: 9px; }
.phrase__why { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin: 0 0 9px; }

.disclaimer {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-top: 26px;
}
.disclaimer b { color: var(--ink-2); }

.link { color: var(--slate); text-decoration: underline; text-underline-offset: 2px; }

/* 载入 */
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 20px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--seal);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading__text { font-size: 14px; color: var(--ink-2); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
  transform: translate(-50%, 12px);
  z-index: 60;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 84vw;
  text-align: center;
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ AI 设置表单 */

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px 14px 4px;
  box-shadow: var(--shadow-1);
}
.form__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}
.form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.3px;
}
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--ink-3); }
.input:focus {
  outline: none;
  border-color: var(--slate);
  box-shadow: 0 0 0 3px rgba(65, 88, 110, 0.12);
  background: var(--surface);
}
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

/* AI 标记 */
.tag-ai {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.5;
  color: var(--slate);
  background: var(--slate-bg);
  border: 1px solid rgba(65, 88, 110, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* AI 提示条 */
.ai-error {
  font-size: 13px;
  line-height: 1.7;
  color: var(--seal);
  background: var(--seal-bg);
  border: 1px solid rgba(169, 50, 38, 0.24);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-top: 12px;
  word-break: break-word;
}
.ai-status {
  font-size: 13px;
  line-height: 1.7;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 10px 12px;
  margin-top: 12px;
  word-break: break-word;
}
.ai-status:empty { display: none; }
.ai-status[data-kind="ok"] {
  color: var(--jade);
  background: var(--jade-bg);
  border-color: rgba(37, 107, 78, 0.24);
}
.ai-status[data-kind="bad"] {
  color: var(--seal);
  background: var(--seal-bg);
  border-color: rgba(169, 50, 38, 0.24);
}
.ai-status[data-kind="wait"] {
  color: var(--slate);
  background: var(--slate-bg);
  border-color: rgba(65, 88, 110, 0.24);
}
.ai-status[data-kind="info"] { color: var(--ink-2); }

/* AI 整体判断卡：印章角标 */
.ai-verdict { position: relative; padding: 15px; border-left: 3px solid var(--slate); }
.ai-verdict::after {
  content: "AI 研判";
  position: absolute;
  right: 12px;
  top: -9px;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--seal);
  background: var(--surface);
  border: 1px solid rgba(169, 50, 38, 0.4);
  border-radius: 4px;
  padding: 2px 7px;
  transform: rotate(-3deg);
  box-shadow: 0 1px 3px rgba(27, 25, 23, 0.1);
}

/* AI 建议行动清单 */
.ai-actions {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ai-step;
}
.ai-actions li {
  counter-increment: ai-step;
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 9px;
}
.ai-actions li:last-child { margin-bottom: 0; }
.ai-actions li::before {
  content: counter(ai-step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--slate);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* 动效降级 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------- 次数显示 / 购买解锁 */

/* 结果页顶部那行「还剩几次」 */
.quota-bar {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid rgba(27, 25, 23, 0.1);
  background: var(--paper, #f7f5f0);
  color: var(--ink-2);
}
.quota-bar[data-kind="ok"] {
  background: var(--jade-bg);
  border-color: rgba(37, 107, 78, 0.22);
  color: #1c5340;
}
.quota-bar[data-kind="warn"] {
  background: var(--amber-bg);
  border-color: rgba(146, 100, 15, 0.22);
  color: #6b4a0c;
}

/* AI 设置页「我的次数」清单 */
.quota-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.quota-list li {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-2);
}
.quota-list b { color: var(--ink); }

/* 购买面板 */
.pay-panel {
  margin-top: 14px;
  border: 1px solid rgba(27, 25, 23, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(27, 25, 23, 0.07);
  overflow: hidden;
}
.pay-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(27, 25, 23, 0.08);
}
.pay-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.pay-panel__close {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  color: var(--ink-3);
  cursor: pointer;
}

/* 两个价位并排 */
.pay-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 15px;
}
.pay-plan {
  position: relative;
  border: 1px solid rgba(27, 25, 23, 0.12);
  border-radius: 12px;
  padding: 14px 12px;
  background: var(--paper, #f7f5f0);
}
.pay-plan--best {
  border-color: rgba(169, 50, 38, 0.4);
  background: var(--seal-bg);
}
.pay-plan__badge {
  position: absolute;
  top: -9px;
  left: 12px;
  background: var(--seal);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.pay-plan__name {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.pay-plan__price {
  font-size: 12.5px;
  color: var(--ink-2);
}
.pay-plan__price b {
  font-size: 21px;
  color: var(--ink);
  margin-right: 1px;
}
.pay-plan__desc {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}
.pay-plan__desc b { color: var(--ink-2); }

/* 怎么付款 */
.pay-how,
.pay-redeem {
  padding: 0 15px 15px;
}
.pay-how {
  border-top: 1px dashed rgba(27, 25, 23, 0.12);
  padding-top: 14px;
}
.pay-how__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 9px;
}
.pay-qr {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(27, 25, 23, 0.1);
}
.pay-qr--empty {
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  background: var(--paper, #f7f5f0);
  border-style: dashed;
  padding: 10px;
}
.pay-line {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 6px;
  text-align: center;
}
.pay-line b { color: var(--ink); }

/* 兑换码输入 */
.pay-redeem {
  border-top: 1px dashed rgba(27, 25, 23, 0.12);
  padding-top: 14px;
}
.pay-redeem__row {
  display: flex;
  gap: 8px;
}
.pay-redeem__row .input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}
.pay-redeem .ai-status { margin-top: 9px; }

/* 窄屏微调 */
@media (max-width: 360px) {
  .hero__title { font-size: 26px; }
  .score-card__head { gap: 12px; }
  .score-dial { width: 72px; height: 72px; }
  .pay-plans { grid-template-columns: 1fr; }
}