/* ===========================================================
   故事复述练习 · 手机端样式
   =========================================================== */

:root {
  --bg: #f6f3ec;
  --bg-soft: #efeae0;
  --card: #fffdf9;
  --ink: #241f1a;
  --ink-2: #5d5548;
  --ink-3: #8f8477;
  --line: #e7dfd1;
  --line-soft: #f0eae0;
  --accent: #c2452d;
  --accent-ink: #ffffff;
  --accent-soft: #f7e4de;
  --gold: #a9781f;
  --gold-soft: #fbf1dc;
  --ok: #3d7a54;
  --ok-soft: #e3efe7;
  --shadow: 0 1px 2px rgba(50, 36, 20, .05), 0 10px 28px -16px rgba(50, 36, 20, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --fs-base: 16px;
  --fs-story: 17px;
  --lh-story: 1.95;
  --maxw: 700px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --bg-soft: #1c1914;
    --card: #221e18;
    --ink: #ece5da;
    --ink-2: #ada294;
    --ink-3: #7e7365;
    --line: #332d25;
    --line-soft: #2a251e;
    --accent: #e2705a;
    --accent-ink: #1a0f0b;
    --accent-soft: #3a2620;
    --gold: #dcae5c;
    --gold-soft: #332a18;
    --ok: #83c39b;
    --ok-soft: #22322a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -16px #000;
  }
}

:root[data-theme="dark"] {
  --bg: #15130f;
  --bg-soft: #1c1914;
  --card: #221e18;
  --ink: #ece5da;
  --ink-2: #ada294;
  --ink-3: #7e7365;
  --line: #332d25;
  --line-soft: #2a251e;
  --accent: #e2705a;
  --accent-ink: #1a0f0b;
  --accent-soft: #3a2620;
  --gold: #dcae5c;
  --gold-soft: #332a18;
  --ok: #83c39b;
  --ok-soft: #22322a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -16px #000;
}

/* 字号档位 */
:root[data-fs="1"] { --fs-base: 15px; --fs-story: 16px; --lh-story: 1.9; }
:root[data-fs="2"] { --fs-base: 16px; --fs-story: 17.5px; --lh-story: 1.95; }
:root[data-fs="3"] { --fs-base: 17.5px; --fs-story: 19.5px; --lh-story: 2.05; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }

/* ---------------- 布局骨架 ---------------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.view {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px calc(28px + var(--sab));
}

.view.has-tabbar { padding-bottom: calc(84px + var(--sab)); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--sat);
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 12px 8px 8px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-title small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin-top: 1px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.icon-btn:active { transform: scale(.92); }
.icon-btn:hover { background-color: var(--bg-soft); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------------- 首页 ---------------- */
.hero {
  margin: 14px 0 18px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 58%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ring {
  position: relative;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
}

.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: var(--line); }
.ring .bar {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset .7s cubic-bezier(.22, 1, .36, 1);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.ring-label b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.ring-label span { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

.hero-meta { flex: 1; min-width: 0; }
.hero-meta h1 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .01em;
}
.hero-meta p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.hero-meta p b { color: var(--accent); font-weight: 650; }

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
}

.btn:active { transform: scale(.97); }

.btn.primary {
  flex: 1;
  background-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.primary:hover { filter: brightness(1.06); }

.btn.ghost {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 16px;
  background-color: var(--bg-soft);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn.ghost:hover { color: var(--ink); }

.btn.wide { width: 100%; }

.btn[disabled] { opacity: .5; pointer-events: none; }

/* 搜索 & 过滤 */
.tools { margin-bottom: 10px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background-color: var(--card);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: 15px;
}

.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search .clear {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.search.has-value .clear { display: flex; }

.chips {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s ease;
}

.chip .cnt { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chip[aria-pressed="true"] {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.chip[aria-pressed="true"] .cnt { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* 列表 */
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 2px 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.story-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}

.story-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  text-align: left;
  background-color: var(--card);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .12s ease;
}

.story-row:last-child { border-bottom: 0; }
.story-row:hover { background-color: var(--bg-soft); }
.story-row:active { background-color: var(--bg-soft); }

.story-row .num {
  flex: 0 0 auto;
  min-width: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.story-row .ttl {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-row .ttl mark {
  background-color: color-mix(in srgb, var(--gold) 26%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.story-row .mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .15s ease;
}

.story-row .mark svg { width: 12px; height: 12px; }

.story-row.done .mark {
  background-color: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.story-row.done .ttl { color: var(--ink-2); }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.8;
}
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* ---------------- 故事页 ---------------- */
.story-head {
  padding: 20px 2px 14px;
}

.story-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.story-kicker .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.story-head h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.38;
  font-weight: 680;
  letter-spacing: .01em;
}

.badge-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background-color: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
}
.badge-done svg { width: 12px; height: 12px; }

.story-body {
  padding: 20px 18px 22px;
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.story-body p {
  margin: 0 0 14px;
  font-size: var(--fs-story);
  line-height: var(--lh-story);
  text-align: justify;
  text-justify: inter-ideograph;
  text-indent: 2em;
  letter-spacing: .012em;
  color: var(--ink);
  word-break: break-word;
}

.story-body p:last-child { margin-bottom: 0; }

/* 复述小抄 */
.cheat {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--line) 80%, var(--ink-3));
  background: transparent;
  overflow: hidden;
}

.cheat summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.cheat summary::-webkit-details-marker { display: none; }
.cheat summary svg { width: 16px; height: 16px; color: var(--gold); }
.cheat summary .chev { margin-left: auto; transition: transform .2s ease; width: 16px; height: 16px; color: var(--ink-3); }
.cheat[open] summary .chev { transform: rotate(180deg); }

.cheat-inner {
  padding: 2px 16px 18px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.cheat-inner ol, .cheat-inner ul { margin: 0 0 12px; padding-left: 20px; }
.cheat-inner li { margin-bottom: 5px; }
.cheat-inner li::marker { color: var(--ink-3); font-size: .9em; }
.cheat-inner .k { color: var(--ink); font-weight: 600; }
.cheat-inner .talk {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: var(--bg-soft);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.8;
}

/* 大道理门 */
.moral {
  margin-top: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.moral-locked {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moral-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moral-ico {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background-color: var(--gold-soft);
  color: var(--gold);
}
.moral-ico svg { width: 19px; height: 19px; }

.moral-head b {
  display: block;
  font-size: 15px;
  font-weight: 650;
}
.moral-head small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.moral-revealed { padding: 18px; }

.moral-text {
  position: relative;
  font-size: calc(var(--fs-story) - 1px);
  line-height: 1.9;
  color: var(--ink);
  text-align: justify;
  text-justify: inter-ideograph;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
}

.moral-text::before {
  content: "";
  display: block;
}

.moral-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.moral-foot .done-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ok);
  font-weight: 600;
}
.moral-foot .done-note svg { width: 14px; height: 14px; }

.link-btn {
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--ink-3) 40%, transparent);
  min-height: 32px;
  padding: 0 2px;
}
.link-btn:hover { color: var(--ink-2); }

/* 讲故事 */
.speak-hint {
  margin: 16px 2px 0;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.7;
}

/* 上一篇 / 下一篇 */
.pager {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.pager .btn {
  flex: 1;
  min-height: 48px;
  font-size: 14px;
  border-radius: 14px;
  background-color: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 14px;
  gap: 1px;
}
.pager .btn span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }
.pager .btn b {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pager .btn.next { align-items: flex-end; text-align: right; }
.pager .btn:disabled { opacity: .38; }
.pager .btn:hover:not(:disabled) { background-color: var(--bg-soft); }

/* ---------------- 指南页 ---------------- */
.guide-head { padding: 22px 2px 16px; }
.guide-head .eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.guide-head h1 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 680;
}
.guide-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
}

.gsec {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.gsec-h {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 12px;
}

.gsec-n {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background-color: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 1px;
}

.gsec-h h2 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: .01em;
}
.gsec-h .sub {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 3px;
}

.gsec p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}
.gsec p:last-child { margin-bottom: 0; }

.gsec p.lead {
  color: var(--ink);
  font-size: 15px;
}

.gsec ul, .gsec ol { margin: 0 0 12px; padding-left: 22px; }
.gsec ul:last-child, .gsec ol:last-child { margin-bottom: 0; }
.gsec li {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
  margin-bottom: 7px;
  padding-left: 2px;
}
.gsec li:last-child { margin-bottom: 0; }
.gsec li::marker { color: var(--accent); font-weight: 600; }
.gsec li b, .gsec li strong { color: var(--ink); font-weight: 650; }

.gsec h3 {
  margin: 18px 0 8px;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.gsec h3:first-child { margin-top: 0; }
.gsec h3 .pip {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background-color: var(--bg-soft);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
}

.quote {
  margin: 0 0 12px;
  padding: 13px 15px;
  border-radius: 12px;
  background-color: var(--gold-soft);
  border-left: 3px solid var(--gold);
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
}
.quote:last-child { margin-bottom: 0; }

.kv {
  display: grid;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  margin-bottom: 12px;
}
.kv:last-child { margin-bottom: 0; }

.kv-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.75;
  background-color: var(--bg-soft);
  border-bottom: 1px solid var(--line-soft);
}
.kv-row:last-child { border-bottom: 0; }
.kv-row dt, .kv-row .k {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
}
.kv-row dd, .kv-row .v { margin: 0; color: var(--ink); }

.guide-cta {
  margin: 6px 0 4px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent), var(--card);
  border: 1px solid var(--line);
  text-align: center;
}
.guide-cta p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }

/* ---------------- 底部标签栏 ---------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px calc(6px + var(--sab));
  background-color: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 0 6px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
  transition: color .15s ease, background .15s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="true"] { color: var(--accent); }
.tab:active { background-color: var(--bg-soft); }

/* ---------------- 设置面板 ---------------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 15, 8, .38);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.sheet-mask.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 18px calc(22px + var(--sab));
  background-color: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px -18px rgba(0, 0, 0, .4);
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.sheet.open { transform: translateY(0); }

.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--line);
  margin: 4px auto 16px;
}

.sheet h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 650;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sheet-head h2 { margin: 0; }
.sheet-head .link-btn { font-size: 14px; font-weight: 600; color: var(--accent); }

.setting { margin-bottom: 20px; }
.setting > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-bottom: 9px;
}

.seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background-color: var(--bg-soft);
}
.seg button {
  flex: 1;
  height: 38px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all .15s ease;
}
.seg button[aria-pressed="true"] {
  background-color: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.setting .hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

.danger {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.danger:active { transform: scale(.99); }

/* ---------------- 轻提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--sab));
  z-index: 70;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 48px);
  padding: 11px 18px;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 入场动画 ---------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp .32s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes unlock {
  0% { opacity: 0; transform: translateY(10px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.moral-revealed { animation: unlock .34s cubic-bezier(.22, 1, .36, 1) both; }

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

/* 桌面端加成 */
@media (min-width: 720px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .story-head h1 { font-size: 26px; }
  .hero { padding: 22px; }
}
