:root {
  --orange: #ff7a00;
  --orange-dark: #ff6a00;
  --bg: #fff7f1;
  --card: #ffffff;
  --text: #222222;
  --muted: #888888;
  --line: #f0e4da;
  --warn: #fff4d6;
  --warn-text: #e8a000;
  --ok: #2f9d64;
  --danger: #e5484d;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
body { min-height: 100dvh; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, #ffe3d0 0%, var(--bg) 100%);
}
.brand { font-size: 20px; font-weight: 700; color: var(--orange-dark); }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 内页顶部收成一行：品牌名 + 走到第几步（清单第 8、9 条） */
.top-slim {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 4px;
}
.top-slim .brand { font-size: 16px; flex: 0 0 auto; }
.steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}
.step.done { color: var(--text); }
.step.on { color: var(--orange-dark); font-weight: 600; }
.step-sep { color: #d0c4ba; }
.progress {
  margin: 8px 16px 0;
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--orange);
  width: 0;
  transition: width .2s ease;
}
.main {
  flex: 1;
  padding: 12px 16px 110px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 20px rgba(255, 122, 51, 0.08);
}
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.hint { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
/* 字号必须 ≥16px：低于 16 时 iOS 聚焦输入框会自动放大整页，退不回去。
   password 类型别漏，漏了它就会掉回浏览器默认字号。 */
textarea, input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 180px; resize: vertical; }
.option {
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 12px 12px 14px;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text);
}
.option.on {
  border-color: var(--orange);
  background: #fff3ea;
}
/* 键盘选中时要看得见焦点在哪，不然用键盘的人不知道自己在第几项 */
.option:focus-visible,
.btn:focus-visible,
.voice-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.option .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.option .label { flex: 1; }
/* 下面几处点击区在手机上偏小（走查实测 17~29px），撑大热区但不动字号和长相：
   加内边距、给个最小高度，长按位置更容易点中。 */
.help-btn {
  flex: 0 0 auto;
  border: 0;
  background: #fff;
  color: var(--orange-dark);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #ffd2b3;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.extra { margin-top: 8px; }
.warn.high {
  background: #ffe8e8;
  color: #c62828;
}
.warn.mid {
  background: #fff4d6;
  color: #c47a00;
}
.warn.ok {
  background: #e9f7ef;
  color: #2f9d64;
}
.warn {
  background: var(--warn);
  color: var(--warn-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.preview-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.preview-item:last-child { border-bottom: 0; }
.preview-q { font-size: 13px; color: var(--muted); }
.preview-a { margin-top: 4px; font-size: 15px; }
/* 「修改」是客户回去改答案的高频入口，19px 太容易点偏 */
.edit-btn {
  float: right;
  border: 0;
  background: none;
  color: var(--orange-dark);
  font-size: 13px;
  padding: 10px 4px 10px 16px;
  margin: -8px 0;
  min-height: 40px;
}
.md-box {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  max-height: 42vh;
  overflow: auto;
}
.sid {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange-dark);
  letter-spacing: 1px;
  margin: 8px 0 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(34,34,34,.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 50;
  display: none;
}
.bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
}
.btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 13px 10px;
  font-size: 16px;
  font-weight: 600;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:disabled { opacity: .45; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }

/* 按下反馈：手机上没有 hover，不给按下态的话点了像没反应。
   只压暗一点点、缩一丁点，不改配色。 */
.btn:active:not(:disabled),
.option:active,
.voice-btn:active,
.help-btn:active,
.edit-btn:active,
.linkish:active {
  filter: brightness(.94);
  transform: scale(.985);
}
.btn, .option, .voice-btn, .help-btn, .edit-btn, .linkish {
  transition: filter .08s ease, transform .08s ease;
}
/* 勾选项按下时给个更明显的确认感——手指盖住的时候也能感觉到 */
.option.feat:active { filter: brightness(.9); }
.mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: flex-end;
  z-index: 40;
}
.mask.show { display: flex; }
.sheet {
  background: #fff;
  width: 100%;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 8px; font-size: 17px; }
.linkish {
  color: var(--orange-dark);
  font-size: 13px;
  background: none;
  border: 0;
  padding: 10px 6px;
  margin: -10px -6px;   /* 热区往外撑，排版位置不变 */
  min-height: 40px;
}

.lookup { margin-top: 12px; display: flex; gap: 8px; }
.lookup input { flex: 1; }
.mini { margin-top: 10px; }
.urlbox {
  background: #fff3ea;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
  margin: 8px 0;
}

.urlbox, .md-box { -webkit-user-select: all; user-select: all; }
.urlbox.pick, .md-box.pick { outline: 2px solid var(--orange); }
.card .btn { width: 100%; }

.extra-block { margin-top: 8px; }
textarea.extra-long { min-height: 140px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; background: #f6f6f6; }
.thumb { position: relative; }
.thumb-del {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: #333; color: #fff; font-size: 14px; line-height: 22px;
}
.img-add {
  display: inline-block; margin-top: 10px;
  background: #fff3ea; color: #ff6a00;
  border: 1px dashed #ffd2b3; border-radius: 10px;
  padding: 10px 12px; font-size: 14px;
}
.img-add input { display: none; }

/* ---------- 二期：功能勾选与实时区间条 ---------- */
.feat-group { margin-top: 14px; }
.grp-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.option.feat { padding: 10px 12px; margin-bottom: 8px; }
.option.feat .hint { margin: 4px 0 0; font-size: 12px; }
.option .money { flex: 0 0 auto; color: var(--orange-dark); font-size: 13px; }
/* 增值项淡一档（清单第 11 条）：没勾时描边虚线、底色更浅，和必备项一眼分开；
   勾上之后跟必备项一样，不让人觉得"这个勾了也不算" */
.feat-group-extra .option.feat:not(.on) {
  border-style: dashed;
  background: #fffdfb;
}
.feat-group-extra .option.feat:not(.on) .label { color: #555; }
.feat-space { height: 76px; }

/* 贴在底部按钮条上方，跟着勾选实时变 */
#quoteBar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 30;
}
.qbar {
  background: #fff3ea;
  border-top: 1px solid #ffd2b3;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text);
}
.qbar b { color: var(--orange-dark); font-size: 16px; }
/* 数字变了轻轻闪一下，让客户注意到价格跟着勾选动了 */
.qbar.bump { animation: qbar-bump .28s ease; }
@keyframes qbar-bump {
  0%   { background: #ffe6cf; }
  100% { background: #fff3ea; }
}
@media (prefers-reduced-motion: reduce) {
  .qbar.bump { animation: none; }
  .btn, .option, .voice-btn, .help-btn, .edit-btn, .linkish { transition: none; }
}
.qbar-none { color: var(--muted); }
.qbar-tip { color: var(--muted); font-size: 12px; margin-top: 1px; }

/* 脚本出错时的兜底提示，压在最上层 */
.crash-notice {
  position: fixed;
  left: 12px; right: 12px; top: 12px;
  z-index: 100;
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  color: #c62828;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

/* 语音输入 */
.voice-row { margin-top: 10px; }
.voice-btn {
  border: 1px dashed #ffd2b3;
  background: #fff3ea;
  color: var(--orange-dark);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  min-height: 44px;
  width: 100%;
}
.voice-btn.on {
  background: var(--orange);
  border-style: solid;
  border-color: var(--orange);
  color: #fff;
}
.voice-tip { margin-top: 10px; margin-bottom: 0; }

/* 内部视图（编号 + 口令） */
.inner-top { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 2px; }
.money-big { font-size: 24px; font-weight: 700; color: var(--orange-dark); }
.row-line {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.row-line:last-child { border-bottom: 0; }
.row-line.total { font-weight: 700; }
.row-line span:last-child { color: var(--muted); white-space: nowrap; }
.row-line.total span:last-child { color: var(--text); }

/* 闲鱼来的客户才看得到这句 */
.floor-note {
  color: var(--orange-dark);
  font-size: 13px;
  background: #fff3ea;
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 10px;
}

/* 结果页的区间卡片 */
.price-card { text-align: center; margin-bottom: 12px; background: #fff3ea; }
.price-label { font-size: 12px; color: var(--muted); }
.price-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--orange-dark);
  letter-spacing: .5px;
  margin: 4px 0 6px;
}
.price-extra { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 结论卡里的"下一步"（清单第 10 条） */
.next-step {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ffd2b3;
  font-size: 14px;
  color: var(--text);
}
.next-step b { letter-spacing: .5px; }

/* 说明书折叠 + 排版（清单第 10、14 条） */
.md-fold { margin-top: 4px; }
.md-fold > summary {
  cursor: pointer;
  color: var(--orange-dark);
  font-size: 14px;
  padding: 10px 0;
  min-height: 40px;
  list-style: none;
}
.md-fold > summary::-webkit-details-marker { display: none; }
.md-fold > summary::before { content: "▸ "; }
.md-fold[open] > summary::before { content: "▾ "; }
.md-box.md-rendered {
  white-space: normal;
  -webkit-user-select: text;
  user-select: text;
  line-height: 1.6;
}
.md-rendered h2 { font-size: 16px; margin: 4px 0 8px; }
.md-rendered h3 { font-size: 14px; margin: 14px 0 6px; color: var(--orange-dark); }
.md-rendered h4, .md-rendered h5 { font-size: 13px; margin: 10px 0 4px; }
.md-rendered p { margin: 3px 0; }
.md-rendered ul, .md-rendered ol { margin: 4px 0; padding-left: 20px; }
.md-rendered li { margin: 2px 0; }
.md-rendered hr { border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }

/* ================================================================
   清单第 12 条（老板 2026-09-21 拍）：橙色收窄
   ----------------------------------------------------------------
   橙色只留给：价格数字、主按钮、品牌名、当前步骤、进度条、正在录音。
   其余次要元素降成中性色——原来按钮、价格、链接、选中态全是橙，
   强调到处都是等于没有强调，客户视线最该落的「参考区间」反而不突出。

   降色之后必须仍然一眼可辨：
     选中态 → 深色描边 + 内阴影视觉加粗（不改边框宽度，布局不跳）
     链接   → 加下划线，一看就知道能点

   整块集中在这里，要调回去只动这一段。
   ================================================================ */
:root {
  --neutral-strong: #3a3a3a;
  --neutral-link: #4a4a4a;
}
.option.on {
  border-color: var(--neutral-strong);
  box-shadow: inset 0 0 0 1px var(--neutral-strong);
  background: #f6f6f6;
}
.help-btn { color: var(--neutral-link); border-color: var(--line); }
.edit-btn,
.linkish,
.md-fold > summary {
  color: var(--neutral-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sid { color: var(--text); }
.img-add { color: var(--neutral-link); background: #f7f7f7; border-color: var(--line); }
.voice-btn:not(.on) { color: var(--neutral-link); background: #f7f7f7; border-color: #d8d8d8; }
.floor-note { color: var(--text); background: #f7f7f7; }
.next-step { border-top-color: var(--line); }
.md-rendered h3 { color: var(--text); }

/* ================================================================
   清单第 13 条（老板 2026-09-21 拍）：12px 并进 13px
   手机上 12 和 13 肉眼几乎分不出，层级多了反而不突出。
   ================================================================ */
.help-btn,
.option.feat .hint,
.qbar-tip,
.price-label { font-size: 13px; }
