/* ============================================================
   快乐学拼音 · 长辈版 2.0
   设计原则：大字号、大按钮、高对比、少干扰、一步一件事
   ============================================================ */

:root {
  --bg: #F7F1E6;
  --card: #FFFFFF;
  --ink: #241A12;
  --ink-2: #3D2F24;
  --sub: #5C4B3C;
  --line: #E4D6C2;
  --line-2: #F0E6D6;

  --primary: #A62E1C;
  --primary-d: #842313;
  --primary-soft: #FBEDE7;
  --primary-line: #EFC5B9;

  --sm: #175D87;
  --sm-bg: #E8F2F9;
  --sm-line: #C9DFF0;

  --ym: #1D654B;
  --ym-bg: #E7F4EE;
  --ym-line: #C6E5D7;

  --zt: #82500D;
  --zt-bg: #FBF0DC;
  --zt-line: #EED7AE;

  --radius: 20px;
  --shadow: 0 4px 16px rgba(70, 50, 30, .08);
  --shadow-lg: 0 12px 40px rgba(70, 50, 30, .18);

  --fs: 22px;
  --tap: 60px;
  --nav-h: 88px;
}
html.size-large { --fs: 26px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: var(--fs);
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

body.no-scroll { overflow: hidden; }
main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 18px 16px 24px; }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; overflow-wrap: anywhere; }
ul { margin: 0; padding-left: 1.25em; }
li { margin: .35em 0; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 4px solid #0B5FA5;
  outline-offset: 3px;
  border-radius: 10px;
}

.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;
}

.skip-link {
  position: absolute; left: 12px; top: -80px;
  background: var(--primary); color: #fff;
  padding: 12px 20px; border-radius: 12px;
  text-decoration: none; z-index: 200; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------------- 顶栏 ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(247, 241, 230, .97);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  width: 54px; height: 54px;
  flex: 0 0 54px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 1.35em;
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(166, 46, 28, .28);
}

.brand-text { min-width: 0; }
.brand-text h1 { font-size: 1.3em; letter-spacing: .02em; white-space: nowrap; line-height: 1.2; }
.brand-text p { font-size: .76em; color: var(--sub); margin-top: 1px; white-space: nowrap; line-height: 1.3; }

.settings-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 0 14px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink-2);
  font-size: .88em;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.settings-btn:active { transform: scale(.97); }
.settings-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- 提示条 ---------------- */
.banner {
  position: fixed;
  top: 96px;
  left: 12px;
  right: 12px;
  z-index: 140;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
  padding: 12px 14px;
  background: #FFF3D6;
  border: 1px solid #EACF98;
  border-left: 6px solid #C2891C;
  border-radius: 14px;
  color: #5D430C;
  font-size: .86em;
  line-height: 1.55;
  box-shadow: 0 10px 30px rgba(70, 50, 30, .18);
}
.banner span { flex: 1; }
.banner-close {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #E0C58C;
  border-radius: 10px;
  font-size: .8em;
  font-weight: 700;
}

/* ---------------- 栏目通用 ---------------- */
.panel { animation: fadeUp .2s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.intro-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 8px solid var(--primary);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.intro-card h2 { font-size: 1.18em; }
.intro-card p { font-size: .9em; color: var(--ink-2); margin-top: 4px; }

.link-btn {
  margin-top: 8px;
  min-height: 44px;
  color: var(--primary-d);
  font-size: .86em;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------------- 字母分类 ---------------- */
.big-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: #EADCC8;
  border-radius: 18px;
  margin-bottom: 14px;
}

.seg-item {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 14px;
  color: var(--ink-2);
  font-size: .9em;
  font-weight: 700;
  line-height: 1.3;
}
.seg-item small { font-size: .7em; color: var(--sub); font-weight: 600; }
.seg-item.is-on {
  background: #fff;
  color: var(--primary-d);
  box-shadow: 0 3px 10px rgba(70, 50, 30, .12);
}
.seg-item.is-on small { color: var(--primary); }

.guide {
  background: #FFFDF8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: .92em;
  color: var(--ink-2);
}

/* ---------------- 字母网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.letter-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.letter-card:active { transform: scale(.96); }
.letter-card.sm { background: var(--sm-bg); border-color: var(--sm-line); }
.letter-card.ym { background: var(--ym-bg); border-color: var(--ym-line); }
.letter-card.zt { background: var(--zt-bg); border-color: var(--zt-line); }

.lc-main {
  font-size: 2.2em;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
}
.letter-card.sm .lc-main { color: var(--sm); }
.letter-card.ym .lc-main { color: var(--ym); }
.letter-card.zt .lc-main { color: var(--zt); }
.letter-card.is-long .lc-main { font-size: 1.15em; letter-spacing: 0; }

.lc-sub {
  font-size: .78em;
  color: var(--sub);
  background: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 1.55;
}

.tip-card {
  margin-top: 16px;
  padding: 14px 16px;
  background: #F3EBDD;
  border-radius: 16px;
  font-size: .88em;
}
.tip-card strong { display: block; font-size: 1.02em; color: var(--primary-d); }
.tip-card p { color: var(--sub); margin-top: 2px; }
/* ---------------- 拼一拼：三步向导 ---------------- */
.step-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 14px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.step-dot span {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--sub);
  font-size: 1.02em;
  font-weight: 700;
}
.step-dot em {
  font-style: normal;
  font-size: .7em;
  color: var(--sub);
  font-weight: 600;
}
.step-dot.is-on span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(166, 46, 28, .28);
}
.step-dot.is-on em { color: var(--primary-d); font-weight: 700; }
.step-dot.is-done span { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-d); }
.step-dot.is-done em { color: var(--primary-d); }
.step-line { flex: 1; height: 3px; background: var(--line); margin-bottom: 20px; border-radius: 2px; }

.wizard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 16px;
  padding-bottom: 98px;
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}
.wizard-card.step-three { padding-bottom: 18px; }
.wizard-head { margin-bottom: 14px; }
.wizard-kicker {
  font-size: .74em;
  color: var(--primary-d);
  font-weight: 700;
  letter-spacing: .04em;
}
.wizard-head h2 { font-size: 1.3em; margin-top: 2px; }
.wizard-head > p:last-child { font-size: .86em; color: var(--sub); margin-top: 4px; }

.pick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.pick-chip {
  min-height: 64px;
  padding: 4px 2px;
  background: #FFFDF8;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 1.22em;
  font-weight: 700;
  line-height: 1.2;
}
.pick-chip:active { transform: scale(.95); }
.pick-chip.is-long { font-size: .98em; }
.pick-chip.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(166, 46, 28, .26);
}

.pick-summary {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: 14px;
  color: var(--primary-d);
  font-size: .88em;
  font-weight: 600;
}
.pick-summary strong { font-size: 1.15em; }

.tone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}
.tone-pick {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px;
  background: #FFFDF8;
  border: 2px solid var(--line);
  border-radius: 16px;
}
.tone-pick:active { transform: scale(.97); }
.tone-pick.is-on { background: var(--primary-soft); border-color: var(--primary); }
.tp-mark { font-size: 1.9em; font-weight: 700; color: var(--primary-d); line-height: 1.1; }
.tp-name { font-size: .8em; color: var(--sub); }
.tp-char { font-size: 1.1em; color: var(--ink); font-weight: 600; }
.tp-curve { width: 82px; height: 34px; margin-top: 2px; }
.tp-curve path {
  fill: none; stroke: var(--primary);
  stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- 拼读结果 ---------------- */
.result-card {
  margin-top: 14px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFAF2 100%);
  border: 2px solid var(--primary-line);
  border-radius: 22px;
  text-align: center;
}
.result-formula {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 14px;
  background: #F7F0E4;
  border-radius: 999px;
  font-size: .86em;
  font-weight: 700;
}
.rf-sm { color: var(--sm); }
.rf-ym { color: var(--ym); }
.rf-res { color: var(--primary-d); }
.rf-op { color: var(--sub); }
.result-main {
  font-size: 3.2em;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-d);
  margin-top: 6px;
}
.result-main.is-long { font-size: 2.2em; letter-spacing: 0; }
.result-char { font-size: 1.35em; color: var(--ink); margin-top: 2px; }
.result-char span { font-size: .62em; color: var(--sub); margin-left: 6px; }
.result-actions { display: grid; gap: 8px; margin-top: 14px; }
.result-actions .btn { min-height: 66px; font-size: 1em; }

.mini-tones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.mini-tone {
  min-height: 64px;
  padding: 4px 2px;
  background: #FFFDF8;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: .78em;
}
.mini-tone.is-on { background: var(--primary-soft); border-color: var(--primary); }
.mt-py { display: block; font-size: 1.15em; font-weight: 700; color: var(--primary-d); }
.mt-char { display: block; font-size: .95em; color: var(--ink-2); }

.note {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: 12px;
  color: var(--primary-d);
  font-size: .8em;
  line-height: 1.65;
  text-align: left;
}

.wizard-footer {
  position: sticky;
  bottom: calc(var(--nav-h) + 4px);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 4px);
  z-index: 20;
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 18px;
  background: linear-gradient(180deg, rgba(247, 241, 230, 0), var(--bg) 40%);
}
.wizard-footer .btn { flex: 1; }
.wizard-footer.is-static {
  position: static;
  background: none;
  padding-top: 14px;
}

/* ---------------- 四声练习 ---------------- */
.tone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.tone-kicker { font-size: .74em; color: var(--sub); font-weight: 600; }
.tone-group { font-size: 1.45em; font-weight: 700; letter-spacing: .12em; color: var(--ink); }
.tone-head .btn { min-height: 56px; padding: 0 16px; font-size: .84em; }

.tone-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tone-card {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 12px 8px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.tone-card:active { transform: scale(.97); }
.tc-num {
  font-size: .74em;
  color: var(--primary-d);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 10px;
}
.tc-char { font-size: 2.9em; font-weight: 700; line-height: 1.1; }
.tc-py { font-size: .9em; color: var(--primary-d); }
.tc-curve { width: 88px; height: 42px; margin-top: 2px; }
.tc-curve path {
  fill: none; stroke: var(--primary);
  stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
}

.btn-wide { width: 100%; margin-top: 14px; }

.verse {
  margin-top: 16px;
  padding: 14px 16px;
  background: #FFFDF8;
  border: 1px dashed var(--primary-line);
  border-radius: 16px;
  color: var(--ink-2);
  font-size: .9em;
  line-height: 2;
}

.knowledge {
  margin-top: 16px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.knowledge summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--primary-d);
  font-size: .96em;
  font-weight: 700;
  cursor: pointer;
}
.knowledge ul { margin: 4px 0 10px; padding-left: 1.2em; }
.knowledge li { color: var(--ink-2); font-size: .84em; margin: .5em 0; }
.knowledge strong { color: var(--primary-d); }
/* ---------------- 按钮 ---------------- */
.btn {
  min-height: 64px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.25;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(166, 46, 28, .24);
}
.btn-soft {
  background: #fff;
  border: 2px solid var(--primary-line);
  color: var(--primary-d);
}
.btn-ghost {
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink-2);
}
.btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 字母详情 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 26, 18, .58);
}
.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding-bottom: 24px;
  animation: popIn .2s ease both;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-card:focus { outline: none; }

.modal-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 253, 249, .98);
  border-bottom: 1px solid var(--line);
}
.modal-close {
  min-height: 50px;
  padding: 0 16px;
  background: #F3EBDD;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: .88em;
  font-weight: 700;
}
.modal-kind { font-size: .76em; color: var(--sub); font-weight: 600; }
#modalBody { padding: 16px; }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  margin-bottom: 14px;
}
.detail-hero.sm { background: var(--sm-bg); border: 2px solid var(--sm-line); }
.detail-hero.ym { background: var(--ym-bg); border: 2px solid var(--ym-line); }
.detail-hero.zt { background: var(--zt-bg); border: 2px solid var(--zt-line); }
.detail-letter {
  min-width: 1.25em;
  text-align: center;
  font-size: 3.8em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}
.detail-hero.sm .detail-letter { color: var(--sm); }
.detail-hero.ym .detail-letter { color: var(--ym); }
.detail-hero.zt .detail-letter { color: var(--zt); }
.detail-meta { flex: 1; min-width: 0; }
.pill {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(255, 255, 255, .85);
  border-radius: 999px;
  color: var(--sub);
  font-size: .7em;
  font-weight: 600;
}
.detail-read { font-size: .95em; color: var(--ink-2); margin-top: 6px; }
.detail-read strong { font-size: 1.3em; color: var(--primary-d); }

.detail-actions { display: grid; gap: 9px; margin-bottom: 16px; }
.detail-actions .btn { min-height: 68px; font-size: 1.02em; }

.detail-block { margin-top: 16px; }
.detail-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--primary-d);
  font-size: 1em;
}
.detail-block h3::before {
  content: "";
  width: 6px; height: 1.05em;
  border-radius: 3px;
  background: var(--primary);
}
.detail-block p { color: var(--ink-2); font-size: .92em; line-height: 1.78; }

.word-list { display: grid; gap: 8px; margin-top: 8px; }
.word-row {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #FFFDF8;
  border: 2px solid var(--line);
  border-radius: 14px;
  text-align: left;
}
.word-row:active { transform: scale(.98); }
.w-char { font-size: 1.6em; font-weight: 700; }
.w-py { font-size: .88em; color: var(--sub); }
.w-play {
  margin-left: auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-d);
  font-size: .76em;
  font-weight: 700;
}

.detail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.detail-nav .btn { min-height: 60px; font-size: .92em; }

/* ---------------- 设置 / 帮助面板 ---------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop { position: absolute; inset: 0; background: rgba(36, 26, 18, .58); }
.sheet-card {
  position: relative;
  width: min(720px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s ease both;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 1.22em; }
.sheet-close {
  min-height: 50px;
  padding: 0 16px;
  background: #F3EBDD;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: .86em;
  font-weight: 700;
}
.sheet-body { overflow-y: auto; padding: 14px 18px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-2);
}
.setting-text { flex: 1; min-width: 0; }
.setting-text h3 { font-size: 1em; }
.setting-text p { margin-top: 2px; color: var(--sub); font-size: .8em; }
.setting-row-column { flex-direction: column; align-items: stretch; }

.seg {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #F3EBDD;
  border-radius: 999px;
}
.seg button {
  min-height: 52px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .84em;
  font-weight: 700;
}
.seg button.is-on {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(166, 46, 28, .26);
}
.seg-3 button { padding: 0 12px; }
.setting-row-column .seg { align-self: stretch; }
.setting-row-column .seg button { flex: 1; }

.about-line {
  margin-top: 18px;
  text-align: center;
  color: var(--sub);
  font-size: .76em;
  line-height: 1.8;
}

/* ---------------- 帮助 ---------------- */
.help-hero { text-align: center; padding: 8px 0 16px; }
.help-logo {
  width: 66px; height: 66px;
  margin: 0 auto;
  display: grid; place-items: center;
  background: var(--primary);
  border-radius: 18px;
  color: #fff;
  font-size: 1.6em;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(166, 46, 28, .26);
}
.help-hero h3 { font-size: 1.18em; margin-top: 10px; }
.help-hero p { font-size: .84em; color: var(--sub); margin-top: 2px; }

.help-steps { list-style: none; margin: 0; padding: 0; }
.help-steps li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.help-steps li > span {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-d);
  font-size: 1.05em;
  font-weight: 700;
}
.help-steps strong { font-size: 1em; }
.help-steps p { margin-top: 2px; color: var(--sub); font-size: .84em; line-height: 1.65; }

.help-block { margin-top: 18px; }
.help-block h3 { color: var(--primary-d); font-size: 1.02em; }
.help-block ul { margin-top: 6px; }
.help-block li { color: var(--ink-2); font-size: .86em; margin: .5em 0; line-height: 1.65; }
.help-block p { margin-top: 6px; color: var(--ink-2); font-size: .86em; line-height: 1.75; }

/* ---------------- 首次使用 ---------------- */
.welcome-body { text-align: center; padding-top: 26px; }
.welcome-logo {
  width: 84px; height: 84px;
  margin: 0 auto;
  display: grid; place-items: center;
  background: var(--primary);
  border-radius: 24px;
  color: #fff;
  font-size: 2em;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(166, 46, 28, .28);
}
.welcome-body h2 { margin-top: 14px; font-size: 1.3em; }
.welcome-sub { margin-top: 4px; color: var(--sub); font-size: .88em; }
.welcome-list { list-style: none; margin: 18px 0; padding: 0; }
.welcome-list li { display: flex; gap: 12px; text-align: left; padding: 9px 0; }
.welcome-list li > span {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary-d);
  font-weight: 700;
}
.welcome-list strong { font-size: .98em; }
.welcome-list p { margin-top: 1px; color: var(--sub); font-size: .82em; }
.welcome-note { margin-top: 10px; color: var(--sub); font-size: .76em; }

/* ---------------- 底部导航 / 停止按钮 ---------------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: rgba(255, 253, 249, .98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(70, 50, 30, .1);
  padding-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  min-height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--sub);
}
.nav-btn:active { background: #F7F0E4; }
.nav-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: #F3EBDD;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 1.02em;
  font-weight: 700;
}
.nav-label { font-size: .78em; font-weight: 700; }
.nav-btn.is-on { color: var(--primary-d); }
.nav-btn.is-on .nav-icon { background: var(--primary); color: #fff; }
.nav-btn.is-on .nav-label { color: var(--primary-d); }

.stop-fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 12px);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
  z-index: 130;
  min-height: 60px;
  padding: 0 24px;
  background: #241A12;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: .92em;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(36, 26, 18, .3);
  white-space: nowrap;
}
.stop-fab:active { transform: translateX(-50%) scale(.96); }

/* ---------------- 适配 ---------------- */
@media (hover: hover) {
  .letter-card:hover { border-color: var(--primary-line); box-shadow: 0 10px 24px rgba(70, 50, 30, .14); }
  .pick-chip:hover { border-color: var(--primary-line); }
  .tone-card:hover { border-color: var(--primary-line); }
  .btn-primary:hover { background: var(--primary-d); }
  .btn-soft:hover, .btn-ghost:hover { background: var(--primary-soft); }
  .settings-btn:hover { border-color: var(--primary-line); }
}

@media (max-width: 380px) {
  :root { --fs: 21px; --nav-h: 82px; }
  html.size-large { --fs: 24px; }
  .app-header { padding: 10px 12px; }
  .logo { width: 48px; height: 48px; flex-basis: 48px; font-size: 1.2em; }
  .brand-text h1 { font-size: 1.2em; }
  .brand-text p { display: none; }
  .settings-btn { min-height: 50px; padding: 0 10px; }
  main { padding: 14px 12px 22px; }
  .grid { gap: 8px; }
  .letter-card { min-height: 104px; }
  .lc-main { font-size: 2em; }
  .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .pick-chip { min-height: 58px; font-size: 1.05em; }
  .tone-card { min-height: 146px; }
  .tc-char { font-size: 2.6em; }
  .seg button { padding: 0 11px; }
}

@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal-card { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .wizard-footer .btn { font-size: .9em; padding: 0 10px; }
}

@media (min-width: 640px) {
  :root { --fs: 23px; }
  html.size-large { --fs: 27px; }
  .app-header { padding: 14px 24px; }
  main { padding: 22px 24px 32px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .pick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tone-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wizard-card { padding: 22px 22px 104px; }
  .wizard-card.step-three { padding-bottom: 22px; }
  .detail-actions { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  main { max-width: 980px; padding-left: 32px; padding-right: 32px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .letter-card { min-height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
