/* 讲义：暖米色纸张 + 陶土橙 + 鼠尾草绿 */
:root {
  --paper: #fbf5ec;
  --paper-2: #f6ecdf;
  --card: #fffbf4;
  --line: #eadcc9;
  --ink: #3f342b;
  --ink-2: #6e5f52;
  --clay: #d9825b;
  --clay-2: #c0704d;
  --clay-3: #9f5433;   /* 按钮底、橙色小字：保证对比度 */
  --clay-soft: #fbeadd;
  --sage: #7fa47a;
  --sage-3: #456f43;   /* 绿色小字 */
  --sage-soft: #e9f1e3;
  --honey: #c79a4b;    /* 自评 */
  --honey-3: #80601f;
  --honey-soft: #f8efd9;
  --shadow: 0 1px 2px rgba(92, 66, 40, .07), 0 8px 22px rgba(92, 66, 40, .08);
  --shadow-up: 0 2px 4px rgba(92, 66, 40, .08), 0 14px 30px rgba(92, 66, 40, .13);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --topbar-h: 52px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  background-color: var(--paper);
  /* 很淡的纸张噪点 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.35; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 18px 16px 36px; outline: none; }
:focus-visible { outline: 2px solid var(--clay-3); outline-offset: 2px; }
svg { display: block; }
[hidden] { display: none !important; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--topbar-h);
  width: 100%; max-width: 780px; margin: 0 auto; padding: 8px 16px 0;
}
.brand { font: 700 16px/40px var(--serif); text-decoration: none; color: var(--clay-3); white-space: nowrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; font-size: 14px; color: var(--ink-2); }
.crumbs a, .crumbs span { line-height: 40px; }
.crumbs a { display: inline-block; min-width: 40px; min-height: 40px; text-align: center; text-decoration: none; padding: 0 2px; }
.crumbs a:hover { color: var(--clay-3); }
.crumbs i { font-style: normal; margin: 0 5px; opacity: .55; }
.footer { padding: 22px 16px calc(26px + env(safe-area-inset-bottom)); text-align: center; color: var(--ink-2); font: 14px var(--serif); }

/* 通用 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.lift { transition: transform .25s ease, box-shadow .25s ease; }
@media (hover: hover) {
  .lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
}
.reveal { opacity: 0; }
.reveal.in { opacity: 1; animation: rise .55s cubic-bezier(.2, .7, .3, 1) var(--d, 0ms) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; margin: 6px 0 4px; }
.page-sub { color: var(--ink-2); margin-bottom: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font-size: 15px; line-height: 1.3; text-decoration: none; cursor: pointer;
  transition: transform .22s var(--spring), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.96); }
@media (hover: hover) { .btn:hover { border-color: var(--clay); } }
.btn-main { background: var(--clay-3); border-color: var(--clay-3); color: #fffaf3; }
@media (hover: hover) { .btn-main:hover { background: #8f4a2c; border-color: #8f4a2c; } }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.bar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; box-shadow: inset 0 1px 1px rgba(92, 66, 40, .08); }
.bar > i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--clay), var(--clay-2)); transition: width .9s cubic-bezier(.2, .7, .2, 1); }

.state { text-align: center; padding: 56px 18px; color: var(--ink-2); }
.state h2 { color: var(--ink); font-size: 20px; margin-bottom: 8px; }
.state .btn { margin-top: 16px; }
.state svg { width: 92px; margin: 0 auto 14px; }

/* 首页 */
.hero { display: grid; gap: 6px; padding: 22px 20px 18px; overflow: hidden; }
.hero-art { width: min(100%, 300px); margin: 0 auto; }
.hero h1 { font-size: 30px; }
.note {
  margin-top: 8px;
  line-height: 32px;
  font-family: var(--serif);
  background: repeating-linear-gradient(transparent 0 31px, rgba(192, 112, 77, .2) 31px 32px);
}
.sign { margin-top: 6px; text-align: right; color: var(--clay-3); font-family: var(--serif); }
.overall { margin: 16px 0; padding: 16px 18px; }
.overall-text { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.overall-text span { color: var(--ink-2); font-size: 14px; }
.grid { display: grid; gap: 12px; }
.subject {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 84px; padding: 14px 16px;
  text-align: left; text-decoration: none; cursor: pointer;
}
.seal {
  flex: none; display: grid; place-items: center; width: 50px; height: 50px;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  font: 700 22px var(--serif);
  color: #fffaf3; background: var(--clay-3);
}
.subject b { display: block; font: 700 18px/1.4 var(--serif); }
.subject small { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.subject.soon .seal { background: var(--paper-2); color: var(--ink-2); }
.subject.soon b { color: var(--ink-2); }
.arrow { margin-left: auto; color: var(--clay-2); font-size: 20px; }
.grow { flex: 1; min-width: 0; }

/* 漂浮只留给插画，很慢 */
.drift { animation: drift 9s ease-in-out infinite; }
.breathe { animation: breathe 8s ease-in-out infinite; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: .85; } }

/* 试卷列表 */
.paper-card { padding: 18px; }
.paper-card h2 { font-size: 19px; }
.paper-card .desc { color: var(--ink-2); font-size: 14px; margin: 2px 0 12px; }
.paper-card .count { color: var(--ink-2); font-size: 13px; margin: 6px 0 12px; }

/* 试卷页顶部 */
.paper-head { padding: 18px; margin-bottom: 12px; }
.paper-head h1 { font-size: 22px; margin-bottom: 8px; }
.paper-count { font-size: 15px; margin-bottom: 8px; }
.paper-count b { color: var(--clay-3); font-family: var(--serif); font-size: 18px; }
.paper-done { margin-top: 10px; font-size: 14px; color: var(--sage-3); }
.paper-head .btn-row { margin-top: 14px; align-items: center; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--clay-3); animation: fade .2s; }

/* 题号跳转条 */
.jump {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -16px 8px; padding: 6px 16px 4px;
  background: rgba(251, 245, 236, .96);
  border-bottom: 1px solid var(--line);
}
.jump-track {
  position: relative;
  display: flex; align-items: center;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.jump-track::-webkit-scrollbar { display: none; }
.jump-gap { flex: none; width: 1px; height: 20px; margin: 0 5px; background: var(--line); }
.dot {
  flex: none; width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
}
.dot span {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-size: 13px; line-height: 1; color: var(--ink-2);
  background: var(--paper-2); border: 1.5px solid transparent;
  transition: background-color .3s, color .3s, transform .22s var(--spring), border-color .3s;
}
.dot:active span { transform: scale(.88); }
.dot.right span { background: var(--sage); color: #1f3a1e; }
.dot.wrong span { background: var(--clay); color: #40190a; }
.dot.self-ok span { background: var(--honey); color: #372808; }
.dot.self-review span { background: var(--honey-soft); color: var(--honey-3); border: 1.5px dashed var(--honey); }
.dot.current span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 12px; padding-bottom: 2px; font-size: 12px; line-height: 20px; color: var(--ink-2); }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.legend .l-right { background: var(--sage); box-shadow: none; }
.legend .l-wrong { background: var(--clay); box-shadow: none; }
.legend .l-self { background: var(--honey); box-shadow: none; }

/* 题卡 */
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 24px 2px 10px; }
.section-head h2 { font-size: 19px; }
.section-head span { color: var(--ink-2); font-size: 13px; }
.q-card { padding: 16px; margin-bottom: 14px; scroll-margin-top: 92px; outline: none; }
.q-head { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 8px; }
.q-no { font: 700 17px var(--serif); color: var(--clay-3); }
.q-type { font-size: 12px; color: var(--ink-2); }
.chip { margin-left: auto; padding: 1px 9px; border-radius: 99px; font-size: 12px; line-height: 22px; animation: fade .25s; }
.chip:empty { display: none; }
.unsure { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 4px; font-size: 13px; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.unsure + .chip { margin-left: 0; }
.unsure input { width: 18px; height: 18px; margin: 0; accent-color: var(--clay-3); cursor: pointer; }
.unsure.on { color: var(--clay-3); font-weight: 600; }
.chip.right { background: var(--sage-soft); color: var(--sage-3); }
.chip.wrong { background: var(--clay-soft); color: var(--clay-3); }
.chip.self-ok, .chip.self-review { background: var(--honey-soft); color: var(--honey-3); }

.math-x { max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding-block: .4em; margin-block: -.25em; } /* 留够分数、根号下缘，负外边距抵消多出的间距 */
.ex-box.math-x, .answer-box.math-x { margin-block: 0; }
.katex { font-size: 1.1em; }
.q-sub { margin-top: 6px; }
.q-table { border-collapse: collapse; margin: 10px 0; font-size: 14px; background: var(--card); }
.q-table th, .q-table td { border: 1px solid var(--line); padding: 4px 10px; text-align: center; white-space: nowrap; }
.q-table th { background: var(--paper-2); font-weight: 600; }
.q-figure {
  margin: 10px auto 2px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.q-figure svg,
.q-figure img,
.q-fig {
  display: block;
  max-width: 100%;
  height: auto;
  width: auto;
  margin: 0 auto;
}
.q-stem img,
.q-stem > svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px auto;
}
.math-x .katex-display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0.5em 0;
}

/* 三个标签 */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 14px 0 12px; padding: 3px; border-radius: 13px; background: var(--paper-2); }
.tab {
  min-height: 42px; padding: 4px 2px;
  border: 0; border-radius: 10px; background: transparent;
  font-size: 14px; line-height: 1.25; color: var(--ink-2); cursor: pointer;
  transition: background-color .2s, color .2s, transform .22s var(--spring);
}
.tab:active { transform: scale(.96); }
.tab[aria-pressed="true"] { background: var(--card); color: var(--clay-3); font-weight: 600; box-shadow: 0 1px 3px rgba(92, 66, 40, .13); }
.pip { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; vertical-align: 1px; background: var(--honey); }
.pip.right { background: var(--sage); }
.pip.wrong { background: var(--clay); }
.panel { animation: fade .25s ease; }

/* 选项 */
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 8px 12px;
  text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 13px; background: #fffdf9;
  transition: transform .22s var(--spring), background-color .25s, border-color .25s;
}
.opt:active { transform: scale(.985); }
@media (hover: hover) { .opt:hover { border-color: var(--clay); } }
.opt-letter {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--paper-2); font: 700 14px var(--serif);
  transition: background-color .25s, color .25s;
}
.opt-body { flex: 1; min-width: 0; overflow-x: auto; }
.opt-body svg,
.opt-body img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  height: auto;
  width: auto;
  margin: 4px 0;
}
.opt-mark { flex: none; font-size: 12px; white-space: nowrap; color: var(--clay-3); }
.opt.is-right { background: var(--sage-soft); border-color: var(--sage); }
.opt.is-right .opt-letter { background: var(--sage); color: #1f3a1e; }
.opt.is-wrong { background: var(--clay-soft); border-color: var(--clay); }
.opt.is-wrong .opt-letter { background: var(--clay); color: #40190a; }

.tick { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--sage-3); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tick.draw path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .45s .08s ease-out forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }

.fb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin-top: 10px; padding: 9px 12px; border-radius: 12px; font-size: 15px; line-height: 1.55;
  animation: fade .25s ease;
}
.fb.ok { background: var(--sage-soft); color: var(--sage-3); }
.fb.no { background: var(--clay-soft); color: var(--clay-3); }
.fb.soft { background: var(--honey-soft); color: var(--honey-3); }
.fb .btn { min-height: 40px; padding: 4px 12px; font-size: 14px; }
.fb .fb-text { flex: 1 1 170px; }

/* 填空、草稿 */
.fill { display: flex; gap: 8px; }
.fill-hint { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.input {
  flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf9;
  font-size: 16px; /* 16px 以下 iOS 会自动放大页面 */
  transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--clay-2); }
.draft-label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.draft {
  display: block; width: 100%; min-height: 150px; padding: 0 12px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; line-height: 30px;
  background: #fffdf9 repeating-linear-gradient(transparent 0 29px, rgba(192, 112, 77, .16) 29px 30px) local;
}
.draft:focus { outline: none; border-color: var(--clay-2); }
.practice-actions { margin-top: 10px; }
.self-ask { margin: 14px 0 8px; font-weight: 600; }

/* 讲解 */
.gate { padding: 16px; border-radius: 14px; background: var(--paper-2); animation: fade .25s; }
.gate p { font-family: var(--serif); font-size: 17px; margin-bottom: 12px; }
.ex-block + .ex-block { margin-top: 16px; }
.ex-label { display: block; margin-bottom: 4px; font: 700 15px var(--serif); color: var(--clay-3); }
.ex-box { padding: 10px 12px; border-radius: 12px; background: var(--paper); }
.steps { list-style: none; margin: 4px 0 0; padding: 0 0 0 16px; border-left: 2px dotted #dcc4a8; }
.steps li { position: relative; padding: 5px 0; overflow: visible; }
.steps li::before { content: ""; position: absolute; left: -21px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
.step-body { max-width: 100%; }
.steps.play li { animation: fade .4s ease backwards; animation-delay: calc(var(--i) * 110ms); }
.answer-box { padding: 10px 12px; border: 1.5px solid var(--sage); border-radius: 12px; background: var(--sage-soft); font-weight: 600; }
.tip {
  position: relative; padding: 16px 14px 12px; border-radius: 4px 14px 14px 14px;
  background: #fbf1cf; box-shadow: 0 2px 6px rgba(92, 66, 40, .1);
}
.tip::before {
  content: ""; position: absolute; top: -7px; left: 22px; width: 58px; height: 15px;
  background: rgba(217, 130, 91, .35); transform: rotate(-3deg);
}
.tip .ex-label { color: var(--honey-3); }
.variant-tag { display: block; margin-bottom: 6px; font: 700 15px var(--serif); color: var(--clay-3); }
.variant-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.variant-sw {
  font: 600 13px var(--sans); color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.variant-sw.on { background: #f3ebe0; border-color: #6b5a4a; color: #3f342b; }
.variant-sw:hover { border-color: #6b5a4a; }

.variant-stem { margin-bottom: 12px; }
.variant-ans { margin-top: 12px; animation: fade .25s; }
.link-btn { margin-top: 12px; }
.solution { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line); animation: fade .3s; }

.entry-grid { display: grid; gap: 12px; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: calc(100vw - 32px); width: max-content; padding: 10px 16px;
  border-radius: 12px; background: var(--ink); color: #fdf6ec; font-size: 14px; line-height: 1.5;
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 桌面 */
@media (min-width: 640px) {
  main { padding: 22px 24px 44px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .jump { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .hero { grid-template-columns: 1.15fr 1fr; align-items: center; column-gap: 20px; padding: 28px 30px; }
  .hero-art { grid-column: 2; grid-row: 1; }
  .hero h1 { font-size: 34px; }
  .grid.subjects { grid-template-columns: repeat(3, 1fr); }
  .subject { flex-direction: column; align-items: flex-start; padding: 18px; }
  .subject .arrow { display: none; }
  .subject .grow { flex: none; }
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
  .q-card { padding: 20px 22px; }
  .tabs { max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; }
  .tick.draw path { stroke-dashoffset: 0; }
}

/* ---------- v2：同步状态、备注、过程草稿 ---------- */
.sync-state { margin: 6px 0 0; font-size: 12px; color: var(--ink-3, #a99580); min-height: 1.3em; }
.sync-state.off { color: var(--clay-2, #c0704d); }
.note-wrap { margin-top: 10px; }
.note-toggle {
  background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12.5px;
  color: #a99580; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px;
}
.note-toggle:hover { color: var(--ink-2); }
.note-box { margin-top: 6px; }
.note-area { min-height: 0; font-size: 14px; }
.note-pip { margin-left: auto; margin-right: 6px; font-size: 13px; color: var(--clay-2, #c0704d); }
.scratch { margin-top: 10px; }
.scratch summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.scratch .draft { margin-top: 6px; }

/* 知识点 */
.pt-group + .pt-group { margin-top: 6px; }
.pt-list { padding: 4px 0; overflow: hidden; }
.pt-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; min-height: 52px; }
.pt-item + .pt-item { border-top: 1px solid var(--line); }
.pt-item:active { background: var(--paper-2); }
.pt-item b { display: block; font: 600 16px var(--serif); }
.pt-item small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.pt-item .arrow { color: var(--clay-2); }
.pt-no { flex: none; width: 30px; font: 700 13px var(--serif); color: var(--clay-3); }
.pt-group-tag { margin-bottom: 2px; font: 600 13px var(--serif); color: var(--clay-3); }
.pt-card { padding: 16px; }
.pt-core { margin: 4px 0 0; padding: 0; list-style: none; }
.pt-core li { position: relative; padding: 4px 0 4px 16px; }
.pt-core li::before { content: ""; position: absolute; left: 2px; top: 1.05em; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); }
.tip .pt-core li::before { background: var(--honey); }
.pt-ans { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--sage); border-radius: 0 12px 12px 0; background: var(--sage-soft); }
.pt-navs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pt-nav { display: block; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.pt-nav.next { text-align: right; }
.pt-nav small { display: block; color: var(--ink-2); font-size: 12px; }
.pt-nav b { font: 600 14px var(--serif); }

/* ---------- v4：照片上传 ---------- */
.ph-wrap { margin-top: 10px; }
.ph-wrap.solve { padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper-2); }
.ph-body { margin-top: 6px; }
.ph-wrap.solve .ph-body { margin-top: 0; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-btn { font-size: 14px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.ph-grid:empty { display: none; }
.ph-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eee8df; border: 1px solid var(--line); }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ph-del {
  position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(40, 30, 20, .62); color: #fff; font-size: 17px; line-height: 26px; padding: 0; cursor: pointer;
}
.ph-st { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11.5px; text-align: center; padding: 2px 0; color: #fff; background: rgba(40, 30, 20, .55); }
.ph-st.fail, .ph-st.bad { background: rgba(168, 80, 43, .85); }
.ph-st.up { background: rgba(127, 164, 122, .9); }
.ph-line { margin: 8px 0 0; font-size: 12.5px; color: #8f7d6b; }
.ph-line.off { color: var(--clay-3, #9f5433); }
.ph-big { position: fixed; inset: 0; z-index: 90; background: rgba(20, 14, 8, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; }
.ph-big img { max-width: 100%; max-height: calc(100% - 36px); object-fit: contain; border-radius: 6px; background: #fff; }
.ph-big-x { color: #eadcc9; font-size: 13px; margin-top: 10px; }

/* ---------- v5：题目 → 知识点 ---------- */
.q-pts, .t-pts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 2px; }
.q-pts-label, .t-pts > span { font-size: 12.5px; color: #8f7d6b; margin-right: 2px; }
.q-pt {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  background: var(--clay-soft); color: var(--clay-3); font-size: 13.5px; text-decoration: none; border: 1px solid #f1d3bf;
}
.q-pt::after { content: "›"; margin-left: 5px; font-size: 15px; line-height: 1; }
.q-pt:active { background: #f6dcc8; }
.pt-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px; margin: 0 0 10px;
  border-radius: 999px; background: var(--card, #fff); box-shadow: var(--shadow); color: var(--clay-3);
  font-weight: 600; font-size: 14px; text-decoration: none;
}
.pt-back.bottom { margin: 14px 0 0; }
.pt-qlist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pt-q { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; text-decoration: none; background: var(--paper); }
.pt-q.here { border-color: var(--clay); color: var(--clay-3); background: var(--clay-soft); font-weight: 600; }
.pt-nq { flex: none; font-size: 12px; color: #8f7d6b; }

/* ---------- 老师讲解：语音播放器 / 视频 / 草稿放大（学生页和老师页共用） ---------- */
.xp {
  --xp-ink: var(--clay-3);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px;
  background: #fffdf8; border: 1px solid #efdcc6; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(92, 66, 40, .06), 0 6px 16px rgba(92, 66, 40, .07);
  user-select: none; -webkit-user-select: none;
}
.xp-btn {
  flex: none; width: 52px; height: 52px; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer; color: #fffaf3;
  background: linear-gradient(150deg, #e4956d, #b4603b);
  box-shadow: 0 5px 14px rgba(159, 84, 51, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .18s var(--spring), box-shadow .2s;
  position: relative;
}
.xp-btn svg { width: 24px; height: 24px; fill: currentColor; }
.xp-btn:active { transform: scale(.92); }
.xp-play .xp-btn::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(217, 130, 91, .55); animation: xp-ring 1.6s ease-out infinite;
}
@keyframes xp-ring { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.22); opacity: 0; } }
.xp-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xp-wave {
  position: relative; height: 40px; cursor: pointer; touch-action: pan-y; border-radius: 8px; outline-offset: 3px;
}
.xp-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2.5px; pointer-events: none; overflow: hidden; }
.xp-bars i { flex: 1; min-width: 0; border-radius: 3px; background: #e6d2bb; }
.xp-on { clip-path: inset(0 100% 0 0); }
.xp-on i { background: linear-gradient(180deg, #d9825b, #9f5433); }
.xp-drag .xp-on { filter: saturate(1.2); }
.xp-meta { display: flex; justify-content: space-between; font: 12px/1.2 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.xp-bad .xp-time { color: #a8502b; }
.xp-speed {
  flex: none; min-width: 48px; height: 32px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid #ecd4bb; background: #fbeadd; color: var(--clay-3); font: 600 12.5px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.xp-speed.on { background: var(--clay-3); border-color: var(--clay-3); color: #fffaf3; }
.xp audio { display: none; }
.xp-video { border-radius: 16px; overflow: hidden; background: #1c1713; box-shadow: var(--shadow); }
.xp-video video { display: block; width: 100%; max-height: 62vh; background: #1c1713; }

.sx {
  margin: 14px 0 6px; padding: 14px 14px 16px; border-radius: 20px;
  background: linear-gradient(165deg, #fff8ee 0%, #fbeadd 100%);
  border: 1px solid #f0d6bf; box-shadow: var(--shadow);
}
.sx.has-new { border-color: #e4a47f; box-shadow: 0 0 0 3px rgba(217, 130, 91, .16), var(--shadow); }
.sx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sx-head b { font: 700 16px/1.2 var(--serif); color: var(--ink); }
.sx-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--clay-3); color: #fffaf3; }
.sx-mark svg { width: 17px; height: 17px; fill: currentColor; }
.sx-count { font-size: 12.5px; color: var(--ink-2); }
.sx-newtag, .sx-new {
  font-style: normal; font-size: 11px; line-height: 1; padding: 3px 8px; border-radius: 999px;
  background: var(--clay-3); color: #fffaf3; letter-spacing: .04em;
}
.sx-item + .sx-item { margin-top: 14px; }
.sx-cap { display: flex; align-items: center; gap: 8px; margin: 0 2px 7px; font-size: 13.5px; color: var(--ink-2); }
.sx-cap time, .sx-cap small { margin-left: auto; font-size: 12px; color: #a99580; }
.sx-cap time + .sx-new { margin-left: 0; }
.sx-drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.sx-thumb {
  position: relative; padding: 0; aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: zoom-in;
  border: 1px solid #ecd4bb; background: #fff; box-shadow: var(--shadow);
  transition: transform .18s var(--spring);
}
.sx-thumb:active { transform: scale(.96); }
.sx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-thumb .sx-new { position: absolute; left: 6px; top: 6px; }
.sx-pdf {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 10px 12px; min-height: 52px; border-radius: 14px;
  text-decoration: none; background: #fffdf8; border: 1px solid #ecd4bb; font-size: 14px; grid-column: 1 / -1;
}
.sx-pdf b { font-size: 11px; padding: 5px 7px; border-radius: 7px; background: var(--clay-3); color: #fffaf3; letter-spacing: .06em; }
.sx-pdf span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1; padding: 4px 9px; border-radius: 999px;
  background: var(--clay-soft); color: var(--clay-3); border: 1px solid #efc9ac;
}
.sx-pill i, .sx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); animation: sx-beat 1.5s ease-in-out infinite; }
@keyframes sx-beat { 50% { transform: scale(1.6); opacity: .5; } }
.sx-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 12px 0 2px; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(120deg, #fff2e3, #fbeadd); border: 1px solid #efc9ac; font-size: 14px; color: var(--ink);
}
.sx-banner a { color: var(--clay-3); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }

.xl { position: fixed; inset: 0; z-index: 1000; background: rgba(24, 17, 12, .93); animation: xl-in .18s ease; overscroll-behavior: contain; }
.xl.xl-out { opacity: 0; transition: opacity .16s; }
@keyframes xl-in { from { opacity: 0; } }
.xl-stage { position: absolute; inset: 0; display: flex; overflow: auto; -webkit-overflow-scrolling: touch; }
.xl-stage img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; -webkit-user-drag: none; }
.xl-zoom .xl-stage img { max-width: none; max-height: none; width: 220%; height: auto; cursor: zoom-out; }
.xl-x, .xl-nav {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 250, 243, .16); color: #fffaf3; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 28px; line-height: 1; padding: 0 0 3px;
}
.xl-x { top: calc(12px + env(safe-area-inset-top)); right: 12px; padding: 0; }
.xl-x svg { width: 22px; height: 22px; }
.xl-nav { top: 50%; margin-top: -23px; }
.xl-prev { left: 10px; } .xl-next { right: 10px; }
.xl-count { position: absolute; top: calc(22px + env(safe-area-inset-top)); left: 16px; color: #fffaf3; font-size: 14px; opacity: .85; }
.xl-hint { position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); text-align: center; color: rgba(255, 250, 243, .7); font-size: 13px; pointer-events: none; }
body.xl-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .xp-play .xp-btn::after, .sx-pill i, .sx-dot { animation: none; }
}

/* 登录页 / 退出登录 */
body.authing .topbar, body.authing .footer { visibility: hidden; }
.login-card { max-width: 340px; margin: 12vh auto 0; padding: 26px 22px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-title { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.login-field input { min-height: 46px; padding: 0 14px; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.login-field input:focus { border-color: var(--clay); outline: none; box-shadow: 0 0 0 3px var(--clay-soft); }
.login-err { min-height: 22px; font-size: 14px; color: #b3402a; text-align: center; }
.login-btn { width: 100%; min-height: 46px; justify-content: center; }
.logout { display: block; margin: 8px auto 0; min-height: 36px; padding: 0 14px; font: 13px var(--sans); color: var(--ink-2); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- PWA 开屏（中性，全账号）：纸摊开 → 色块叠入 → 盖章 → 印字 → 翻页离场 ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  color: var(--ink);
  transform-origin: 0 50%;
  transition: transform .6s cubic-bezier(.55,0,.25,1), opacity .22s ease .38s, visibility 0s linear .6s;
}
/* 翻页时右侧压暗一点，像纸页的背光面 */
.splash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(63,52,43,0) 30%, rgba(63,52,43,.22));
  opacity: 0; transition: opacity .6s ease;
}
.splash.is-out { transform: perspective(1400px) rotateY(-86deg); opacity: 0; visibility: hidden; pointer-events: none; }
.splash.is-out::after { opacity: 1; }

/* 一张讲义纸：从折痕处摊开 */
.splash-sheet {
  position: relative; width: min(300px, 80vw); padding: 38px 24px 30px;
  display: flex; flex-direction: column; align-items: center;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(217,130,91,.07) 27px 28px),
    var(--card);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(92,66,40,.06), 0 18px 40px -12px rgba(92,66,40,.22);
  transform-origin: 50% 0;
  animation: splash-unfold .62s cubic-bezier(.2,.75,.25,1) both, splash-thud .22s ease-out 1.02s;
}
.splash-sheet::before { /* 折痕：摊开后慢慢消失 */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(92,66,40,.16), transparent);
  animation: splash-fade-out .5s ease .55s forwards;
}
@keyframes splash-unfold {
  from { transform: perspective(900px) rotateX(-78deg) translateY(-10px); opacity: 0; }
  35% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
@keyframes splash-thud { 40% { transform: translateY(1.5px) scale(.996); } }
@keyframes splash-fade-out { to { opacity: 0; } }

/* 三张陶土色卡错落叠入，章盖在上面 */
.splash-seal { position: relative; width: 104px; height: 104px; }
.splash-tile {
  position: absolute; inset: 8px; border-radius: 12px; opacity: 0;
  animation: splash-tile .5s cubic-bezier(.2,.8,.25,1) both;
}
.splash-tile.t1 { background: #d9825b; --from: translate(-70px, 14px) rotate(-24deg); --to: translate(-15px, 3px) rotate(-11deg); animation-delay: .34s; }
.splash-tile.t2 { background: #f6ecdf; border: 1px solid var(--line); --from: translate(72px, -10px) rotate(22deg); --to: translate(14px, -2px) rotate(9deg); animation-delay: .44s; }
.splash-tile.t3 { background: #9f5433; --from: translate(6px, 64px) rotate(8deg); --to: translate(2px, 9px) rotate(-3deg); animation-delay: .54s; }
@keyframes splash-tile {
  from { transform: var(--from); opacity: 0; }
  30% { opacity: 1; }
  to { transform: var(--to); opacity: 1; }
}
.splash-mark {
  position: absolute; left: 8px; top: 8px; width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px var(--card), 0 3px 8px rgba(92,66,40,.22);
  opacity: 0;
  animation: splash-stamp .38s cubic-bezier(.5,0,.75,0) .72s forwards, splash-settle .3s cubic-bezier(.2,.8,.3,1) 1.1s forwards;
}
.splash-mark img { position: absolute; left: -26px; top: -26px; width: 140px; height: 140px; display: block; max-width: none; }
@keyframes splash-stamp {   /* 举高 → 落下压实 */
  from { transform: translateY(-18px) scale(1.55) rotate(-8deg); opacity: 0; }
  40% { opacity: 1; }
  to { transform: scale(.93); opacity: 1; }
}
@keyframes splash-settle { from { transform: scale(.93); opacity: 1; } to { transform: none; opacity: 1; } }

/* 字逐个印上 + 一道墨线 */
.splash-title {
  margin-top: 22px; display: flex; gap: .14em;
  font: 700 26px/1.2 var(--serif); color: var(--ink); letter-spacing: 0;
}
.splash-title span { display: block; opacity: 0; animation: splash-print .42s cubic-bezier(.2,.8,.25,1) forwards; }
.splash-title span:nth-child(1) { animation-delay: 1.12s; }
.splash-title span:nth-child(2) { animation-delay: 1.19s; }
.splash-title span:nth-child(3) { animation-delay: 1.26s; }
.splash-title span:nth-child(4) { animation-delay: 1.33s; }
@keyframes splash-print {
  from { opacity: 0; transform: translateY(7px); color: var(--clay); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; color: var(--ink); }
}
.splash-rule {
  width: 132px; height: 2px; margin-top: 12px; border-radius: 1px;
  background: var(--clay-2); transform: scaleX(0); transform-origin: 0 50%;
  animation: splash-rule .45s cubic-bezier(.6,0,.2,1) 1.42s forwards;
}
@keyframes splash-rule { to { transform: scaleX(1); } }
.splash-sub {
  margin-top: 12px; font: 14px/1.4 var(--sans); color: var(--ink-2); letter-spacing: .06em;
  opacity: 0; animation: splash-in .5s ease 1.6s forwards;
}
.splash-skip {
  position: absolute; z-index: 1; right: 16px; top: max(12px, env(safe-area-inset-top));
  min-height: 36px; padding: 0 12px; font: 13px var(--sans); color: var(--ink-2);
  background: transparent; border: 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
@keyframes splash-in {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-sheet, .splash-sheet::before, .splash-tile, .splash-mark, .splash-title span, .splash-rule, .splash-sub { animation: none; opacity: 1; transform: none; }
  .splash-sheet::before { opacity: 0; }
  .splash-tile { transform: var(--to); }
  .splash { transition: opacity .2s ease, visibility 0s linear .2s; }
  .splash.is-out { transform: none; }
  .splash::after { display: none; }
}

/* ---------- 安装到桌面提示（安卓 beforeinstallprompt / iOS 指引） ---------- */
.pwa-tip {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10050; display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(92, 66, 40, .16);
  color: var(--ink); font: 14px/1.45 var(--sans);
  transform: translateY(120%); opacity: 0;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s;
}
.pwa-tip.is-on { transform: none; opacity: 1; }
.pwa-tip .grow { flex: 1; min-width: 0; }
.pwa-tip b { display: block; font: 600 14px/1.3 var(--sans); color: var(--clay-3); margin-bottom: 2px; }
.pwa-tip .pwa-ico {
  width: 44px; height: 44px; border-radius: 10px; flex: none; overflow: hidden;
  box-shadow: 0 2px 8px rgba(92,66,40,.12);
}
.pwa-tip .pwa-ico img { width: 100%; height: 100%; display: block; }
.pwa-tip .btn { min-height: 36px; padding: 0 12px; flex: none; }
.pwa-tip .pwa-x {
  position: absolute; top: 6px; right: 8px; width: 28px; height: 28px;
  border: 0; background: transparent; color: var(--ink-2); font-size: 18px; cursor: pointer;
  line-height: 1;
}

/* ---------- SampleLearner专属欢迎（仅登录后接口取图；无图时框架可跳过） ---------- */
.wxm-hi {
  position: fixed; inset: 0; z-index: 9500;
  background: #1a1410; color: #fffaf3;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden; opacity: 0; transition: opacity .5s ease;
}
.wxm-hi.is-on { opacity: 1; }
.wxm-hi.is-out { opacity: 0; pointer-events: none; }
.wxm-hi-stage { position: absolute; inset: 0; }
.wxm-hi-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%;
  opacity: 0; transform: scale(1.12) translate3d(0, 2%, 0);
  transition: opacity 1.35s ease, transform 6.5s ease-out;
  will-change: opacity, transform;
}
.wxm-hi-stage img.is-on { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
.wxm-hi-stage img.is-on.alt { transform: scale(1.06) translate3d(0, -1.5%, 0); }
.wxm-hi-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,12,8,.78) 0%, rgba(20,12,8,.25) 45%, rgba(20,12,8,.15) 100%);
  pointer-events: none;
}
.wxm-hi-copy {
  position: relative; z-index: 2; width: min(92vw, 420px);
  padding: 0 20px max(48px, env(safe-area-inset-bottom));
  text-align: left;
}
.wxm-hi-copy b {
  display: block; font: 700 28px/1.25 var(--serif); margin-bottom: 8px;
  opacity: 0; transform: translateY(12px);
  animation: splash-in .7s cubic-bezier(.2,.8,.2,1) .2s forwards;
}
.wxm-hi-copy span {
  display: block; font: 15px/1.55 var(--sans); color: rgba(255,250,243,.9);
  min-height: 3.2em; opacity: 0; animation: splash-in .7s ease .35s forwards;
}
.wxm-hi-skip {
  position: absolute; right: 14px; top: max(12px, env(safe-area-inset-top)); z-index: 3;
  min-height: 36px; padding: 0 12px; border: 0; background: transparent;
  color: rgba(255,250,243,.85); font: 13px var(--sans); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .wxm-hi, .wxm-hi-stage img { transition: none; }
  .wxm-hi-stage img { transform: none; }
  .wxm-hi-copy b, .wxm-hi-copy span { animation: none; opacity: 1; transform: none; }
}

/* 第21题第3问：可拖动阴影示意 */
.jiao-viz {
  margin: 10px 0 4px;
  padding: 10px 10px 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.jiao-viz-hint { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.jv-figwrap { overflow: hidden; }
.jv-svg { width: 100%; height: auto; max-height: 260px; touch-action: none; display: block; }
.jv-axis { stroke: #c4b09a; stroke-width: 1.2; }
.jv-read {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 4px; font-size: 13px; color: var(--ink);
}
.jv-read span {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.6;
}
.jv-read .jv-s { background: var(--clay-soft); border-color: #ead0bc; color: var(--clay-3); font-weight: 600; }
.jv-read .jv-tip:empty { display: none; }
.jv-read .jv-tip { background: var(--sage-soft); border-color: #cfe0c8; color: var(--sage-3); }
.jv-slider {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 2px 6px; font-size: 13px; color: var(--ink-2);
}
.jv-slider input[type=range] {
  flex: 1; height: 28px; margin: 0; accent-color: var(--clay-2);
  touch-action: none;
}
.jv-plot { width: 100%; height: auto; max-height: 130px; display: block; }

/* 限时模式：开关放在卷头，用时标记默认隐藏，打开后显示（自动记时） */
.speed-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.speed-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.speed-bar input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--clay-3);
  cursor: pointer;
}
.speed-live {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-2);
}
.speed-live[hidden] { display: none; }
.speed-row {
  display: none;
  align-items: center;
  margin: 8px 0 2px;
}
.is-speed .speed-row { display: flex; }
.speed-mark {
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.3;
  padding: 5px 12px;
  border-radius: 999px;
}
.speed-mark.is-done {
  border-color: transparent;
  background: var(--sage-soft);
  color: var(--sage-3);
}

/* 做题方式：整卷 / 单题（一次一题，右滑下一题） */
.view-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.view-bar-label { flex: none; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-2);
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  padding: 6px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn[aria-pressed="true"] {
  background: var(--clay-soft);
  color: var(--clay-3);
  font-weight: 600;
}
.swipe-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 12px;
  padding: 8px 2px;
}
.swipe-nav[hidden] { display: none; }
.swipe-nav .btn:first-of-type { justify-self: start; }
.swipe-nav .btn-main { justify-self: end; }
.swipe-prog {
  grid-column: 2;
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--ink-2);
}
.swipe-hint {
  grid-column: 1 / -1;
  width: 100%;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-2);
}
.swipe-nav .btn:disabled {
  opacity: .45;
  cursor: default;
}
body.is-single-q .paper-sec:not(.has-current) { display: none; }
body.is-single-q .q-card { margin-bottom: 8px; }


/* 角落「安装」：关掉大条后仍能一键触发 beforeinstallprompt.prompt() */
.pwa-fab {
  position: fixed; right: 14px; bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 10060; min-width: 56px; min-height: 56px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--clay-3); color: #fffaf3;
  font: 600 15px/1 var(--sans);
  box-shadow: 0 8px 22px rgba(92, 66, 40, .28);
}
.pwa-fab:active { transform: scale(.97); }


/* ---- 英语背诵 ---- */
.en-hint{margin:0 0 12px;color:var(--muted,#6b645c);font-size:.95rem;line-height:1.5}
.en-tabs,.en-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;align-items:center}
.en-tab,.en-chip{border:1px solid rgba(0,0,0,.12);background:#fff;border-radius:999px;padding:6px 14px;font:inherit;cursor:pointer}
.en-tab.on,.en-chip.on{background:#2c241b;color:#fff;border-color:#2c241b}
.en-progress{margin-left:auto;font-size:.85rem;color:var(--muted,#6b645c)}
.en-card{padding:20px 18px 16px}
.en-en-row{display:flex;align-items:flex-start;gap:10px;margin:0 0 10px}
.en-en{font-size:1.35rem;font-weight:700;line-height:1.4;margin:0;flex:1;word-break:break-word}
.en-speak{flex:0 0 auto;border:1px solid rgba(0,0,0,.14);background:#fff;border-radius:999px;padding:6px 12px;font:inherit;font-size:.85rem;cursor:pointer;color:#3a342c;line-height:1.2}
.en-speak:active{background:rgba(0,0,0,.05)}
.en-ex-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}
.en-ex-head .en-ex-label{margin-bottom:0}
.en-result-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.en-zh{font-size:1.1rem;line-height:1.5;margin:0 0 12px;color:#3a342c}
.en-ex{margin-top:10px;padding:10px 12px;background:rgba(0,0,0,.04);border-radius:10px;font-size:.95rem;line-height:1.5;color:#4a433a}
.en-ex-label{display:block;font-size:.75rem;letter-spacing:.04em;color:#8a8074;margin-bottom:4px}
.en-marks{display:flex;gap:10px;margin:16px 0 12px}
.en-marks .btn{flex:1}
.en-known.on{background:#1f6b3a;color:#fff;border-color:#1f6b3a}
.en-unknown.on{background:#8a3b2a;color:#fff;border-color:#8a3b2a}
.en-nav{display:flex;align-items:center;gap:10px;margin-top:4px}
.en-nav .btn{flex:1}
.en-pos{min-width:4.5em;text-align:center;font-variant-numeric:tabular-nums;color:#6b645c}
.en-quiz-label{margin:0 0 8px;font-size:.85rem;color:#8a8074}
.en-choices{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.en-choice{text-align:left;border:1px solid rgba(0,0,0,.12);background:#fff;border-radius:12px;padding:12px 14px;font:inherit;cursor:pointer;line-height:1.4}
.en-choice.pick{border-color:#2c241b}
.en-choice.ok{border-color:#1f6b3a;background:#e8f5ee}
.en-choice.bad{border-color:#8a3b2a;background:#f8ebe7}
.en-result{margin:10px 0 0;font-weight:600}
.en-result.right{color:#1f6b3a}
.en-result.wrong{color:#8a3b2a}
.en-overview{margin:0 0 12px;padding:10px 12px;background:rgba(159,84,51,.08);border-radius:12px}
.en-overview-text{font-size:1.05rem;font-weight:700;line-height:1.45}
.en-overview-note{margin:6px 0 0;font-size:.85rem;color:#6b645c;line-height:1.45}
.en-children{display:flex;flex-direction:column;gap:12px;margin-top:8px}
.en-child{padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:12px;background:#fff}
.en-en-row{flex-wrap:wrap}
.en-audio-note{flex:1 0 100%;font-size:.8rem;color:#8a3b2a;line-height:1.35}
.en-audio-note:empty{display:none}
.en-speak.is-busy{opacity:.72}
.en-speak.is-playing{background:#2c241b;color:#fff;border-color:#2c241b}
.en-speak.is-missing,.en-speak.is-blocked{border-color:#8a3b2a}
.entry-grid{display:grid;gap:12px}
@media(min-width:560px){.entry-grid{grid-template-columns:1fr 1fr}}
