/* 16px = 1rem。手机端只用 rem；safe-area 用 env() */
:root {
  --paper: #f3ebdd;
  --paper-2: #ebe1d0;
  --ink: #1b1610;
  --ink-soft: #5c5348;
  --rule: #c9bba6;
  --seal: #9c2b18;
  --seal-soft: #c45c3e;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --pad: max(1.25rem, env(safe-area-inset-left));
  --pad-r: max(1.25rem, env(safe-area-inset-right));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--paper);
  height: 100dvh;
  overflow: hidden;
  line-height: 1.55;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wx-cover {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 300px;
  height: 300px;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.top {
  flex-shrink: 0;
  padding: calc(1rem + env(safe-area-inset-top)) var(--pad-r) 0.75rem var(--pad);
  border-bottom: 0.0625rem solid var(--rule);
  background: var(--paper);
}
.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seal);
  font-weight: 500;
}
.brand-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "title count jump";
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0.2rem 0 0.9rem;
}
.brand-title h1 { grid-area: title; }
.exam-count { grid-area: count; min-width: 0; }
.brand-title .cross-jump { grid-area: jump; justify-self: end; }
h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
}
.cross-jump {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #fffdf8;
  background: var(--seal);
  border: 0.0625rem solid var(--seal);
  text-decoration: none;
  white-space: nowrap;
}
.cross-jump:active { opacity: 0.75; }

.search-shell {
  display: flex;
  align-items: stretch;
  background: #fffdf8;
  border: 0.0625rem solid var(--ink);
  min-height: 3rem;
}
.search-kicker {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: #fffdf8;
  background: var(--ink);
  writing-mode: horizontal-tb;
}
#q {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
#q::placeholder { color: #9a8f80; }
.search-shell, .filters button, .hit, .recall-draw, .tip-btn, .tip-close, .copy-v, .back, .recall-reveal, .recall-next, .recall-grade button, .assoc-item, .assoc-chip, .examples button, .cross-jump, .geo-row button, .calc-chips button, .body-jump, .tool-jump-link, .ai-hit {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(156, 43, 24, 0.12);
}

.filters {
  display: block;
  margin-top: 0.75rem;
}
.filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem;
}
.filters button {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0.0625rem solid transparent;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.filters button[data-lv="1"] {
  font-weight: 600;
  letter-spacing: 0.12em;
}
.filters button[aria-selected="true"] {
  color: var(--seal);
  border-color: var(--seal);
  background: rgba(156, 43, 24, 0.06);
}
.filters button:active { opacity: 0.7; }

.geo {
  margin-top: 0.55rem;
}
.geo.is-hidden { display: none; }
.geo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.geo-row + .geo-row { margin-top: 0.35rem; }
.geo-row button {
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: #fffdf8;
  border: 0.0625rem solid var(--rule);
  padding: 0.28rem 0.65rem;
  cursor: pointer;
  touch-action: manipulation;
}
.geo-row button[aria-selected="true"] {
  color: #fffdf8;
  background: var(--seal);
  border-color: var(--seal);
}
.geo-row.lv3 button {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  background: transparent;
  border-style: dashed;
}
.geo-row.lv3 button[aria-selected="true"] {
  color: var(--seal);
  background: rgba(156, 43, 24, 0.06);
  border-style: solid;
  border-color: var(--seal);
}
.geo-row button:active { opacity: 0.75; }
.qg-nav .geo-row,
.chip-wrap {
  flex-wrap: wrap;
  overflow: visible;
  align-items: stretch;
}
.qg-nav .geo-row button,
.chip-wrap button {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.32rem 0.55rem;
  min-width: 0;
  max-width: none;
  flex: 0 1 auto;
}
.qg-nav .geo-row.lv3 button {
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  background: transparent;
  border-style: dashed;
}
.qg-nav .geo-row.lv3 button[aria-selected="true"] {
  color: var(--seal);
  background: rgba(156, 43, 24, 0.06);
  border-style: solid;
  border-color: var(--seal);
}
#qg-chs.is-hidden { display: none; }
.sec-lab {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--seal);
  font-weight: 600;
}
.place-block {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0;
  border: 0;
  border-bottom: 0.0625rem dashed var(--rule);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.place-block:last-child { border-bottom: 0; }
.place-block:active { opacity: 0.75; }
.detail .group-lab {
  padding-left: 0;
  padding-right: 0;
}
.detail-body .body-prose {
  margin-bottom: 0.85rem;
}
.detail-body .body-prose .body-rest {
  font-size: 0.95rem;
  line-height: 1.7;
}
.body-dots {
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0;
}
.body-dots > li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.2rem;
  line-height: 1.7;
}
.body-dots > li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.78rem;
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 50%;
  background: var(--seal);
}
.body-ol > li > .body-dots {
  grid-column: 2;
}
.body-subs {
  list-style: none;
  padding: 0;
  margin: 0.18rem 0 0;
}
.body-subs > li {
  position: relative;
  padding: 0.22rem 0 0.22rem 1rem;
  font-size: 0.9rem;
  line-height: 1.65;
}
.body-subs > li::before {
  content: "";
  position: absolute;
  left: 0.16rem;
  top: 0.7rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: #8a8278;
}
.body-ol .assoc-line {
  border-top: 0.0625rem dashed var(--rule);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}
.body-ol .assoc-line .body-head {
  color: var(--seal);
}
.place-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--seal);
  margin: 0 0 0.25rem;
}
.place-title {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.group-lab {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--seal);
  padding: 0.85rem var(--pad) 0.2rem;
}
.hit-group + .hit-group { margin-top: 0.25rem; }

.recall-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  margin-top: 0.75rem;
}
.recall-draw {
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  color: #fffdf8;
  background: var(--seal);
  border: 0.0625rem solid var(--seal);
  padding: 0.45rem 1rem;
  cursor: pointer;
}
.recall-draw:active { opacity: 0.75; }
.tip-btn {
  margin-left: auto;
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  background: #fffdf8;
  border: 0.0625rem solid var(--seal);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.tip-btn:active { opacity: 0.75; }
.recall-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.recall-stage {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--seal);
  margin-bottom: 0.45rem;
}
.recall-prompt {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.35rem 0 0.9rem;
  max-width: 40rem;
}
.recall-reveal,
.recall-next,
.recall-grade button {
  font: inherit;
  cursor: pointer;
  border: 0.0625rem solid var(--ink);
  background: #fffdf8;
  color: var(--ink);
  padding: 0.55rem 0.9rem;
}
.recall-reveal {
  letter-spacing: 0.12em;
  background: var(--ink);
  color: #fffdf8;
  border-color: var(--ink);
}
.recall-reveal:active,
.recall-next:active,
.recall-grade button:active { opacity: 0.75; }
.recall-answer { margin-top: 0.35rem; }
.recall-grade {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-top: 1.1rem;
  max-width: 40rem;
}
.recall-grade button:disabled { opacity: 0.45; cursor: default; }
.recall-grade button[data-grade="again"] {
  border-color: var(--rule);
  color: var(--ink-soft);
}
.recall-grade button[data-grade="good"] {
  background: var(--seal);
  border-color: var(--seal);
  color: #fffdf8;
}
.recall-next {
  margin-top: 0.85rem;
  letter-spacing: 0.12em;
}
.recall-feedback {
  font-size: 0.8125rem;
  color: var(--seal);
  margin-top: 0.75rem;
}
.is-hidden { display: none !important; }

.place-box { margin: 0.35rem 0 0.85rem; max-width: 40rem; }
.place-where {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--seal);
  margin-bottom: 0.4rem;
}
.place-intro {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 0.4rem;
}
.place-img {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  margin: 0.5rem 0;
  background: var(--paper-2);
}
.body-ol > li > .terrain-in-loc,
.body-ol > li > .place-img {
  grid-column: 2;
  width: 100%;
  max-width: 36rem;
  height: auto;
  margin: 0.45rem 0 0.75rem;
  border-radius: 2px;
}

.stage {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.pane {
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.list-pane {
  border-right: 0.0625rem solid var(--rule);
  display: flex;
  flex-direction: column;
}
.pane-head {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem var(--pad) 0.4rem;
  background: var(--paper);
}
.pane-head h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  font-weight: 600;
}
.meta { font-size: 0.75rem; color: var(--ink-soft); }

.results {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0 1.5rem;
}
.hit {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  background: transparent;
  border: 0;
  border-bottom: 0.0625rem solid rgba(201, 187, 166, 0.7);
  padding: 0.85rem var(--pad);
  cursor: pointer;
  color: inherit;
  transition: background 0.35s var(--ease);
}
.hit:hover { background: rgba(255, 253, 248, 0.7); }
.hit[aria-current="true"] { background: #fffdf8; }
.hit:active { opacity: 0.85; }
.hit-kicker {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--seal-soft);
  margin-bottom: 0.2rem;
}
.hit-title {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.hit-body {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hit-title strong, .hit-body strong {
  font-weight: 600;
}
.hit-title u, .hit-body u {
  text-decoration: underline wavy;
  text-decoration-color: var(--seal);
  text-underline-offset: 0.12em;
}
mark {
  background: rgba(156, 43, 24, 0.16);
  color: inherit;
  padding: 0 0.08rem;
}

.detail-pane {
  display: flex;
  flex-direction: column;
  padding: 1rem var(--pad-r) 1.5rem 1.25rem;
  overflow: hidden;
  background: #fffdf8;
}
.detail-toolbar {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: var(--paper);
}
.detail-actions {
  flex-shrink: 0;
  padding: 0.75rem 0 0;
  max-width: 40rem;
}
.detail-actions .recall-grade { margin-top: 0.55rem; }
.detail-actions .recall-next { width: 100%; }
.detail-actions .recall-reveal { width: 100%; }

.dock {
  display: none;
}
.detail-pane .detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.back {
  display: none;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--seal);
  background: none;
  border: 0;
  padding: 0.4rem 0 0.8rem;
  cursor: pointer;
}
.back:active { opacity: 0.7; }
.recall-back {
  display: inline-block;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--seal);
  background: none;
  border: 0.0625rem solid var(--seal);
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.08em;
}
.recall-back:active { opacity: 0.7; }

.detail.empty .hint {
  color: var(--ink-soft);
  max-width: 28rem;
  font-size: 0.9375rem;
}
.crumb {
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.detail h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.kind {
  display: inline-block;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.detail-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 42rem;
  white-space: normal;
}
.detail-body strong, .body-ol strong {
  font-weight: 600;
}
.detail-body u, .body-ol u {
  text-decoration: underline wavy;
  text-decoration-color: var(--seal);
  text-underline-offset: 0.15em;
}
.body-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.65rem;
}
.body-ol {
  list-style: none;
  counter-reset: bi;
  padding: 0;
  margin: 0;
}
.body-ol > li {
  counter-increment: bi;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 0.0625rem solid var(--rule);
}
.body-ol > li:last-child { border-bottom: 0; }
.body-ol > li.is-group {
  counter-increment: none;
  padding-top: 1rem;
  padding-bottom: 0.1rem;
  border-bottom: 0;
}
.body-ol > li.is-group::before { content: ""; }
.body-ol > li.is-group .body-head {
  color: var(--seal);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.body-ol > li::before {
  content: counter(bi);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--seal);
  padding-top: 0.2rem;
}
.body-head {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.45;
  margin-bottom: 0.3rem;
  grid-column: 2;
}
.body-ol > li > .body-cat,
.body-ol > li > .body-bits,
.body-ol > li > .body-sub,
.body-sub > li > .body-sub,
.body-ol > li > .body-rest,
.body-ol > li > .body-note,
.body-ol > li > .body-prose,
.body-ol > li > .place-img,
.body-ol > li > .terrain-in-loc {
  grid-column: 2;
}
.body-sub {
  list-style: none;
  padding: 0;
  margin: 0.12rem 0 0;
}
.body-sub > li {
  position: relative;
  padding: 0.28rem 0 0.28rem 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.body-sub > li::before {
  content: "";
  position: absolute;
  left: 0.12rem;
  top: 0.72rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--seal);
}
.body-cat {
  margin-top: 0.45rem;
}
.body-cat-name {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin: 0 0 0.2rem;
}
.body-bits {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  padding: 0;
  margin: 0;
}
.body-bits li {
  background: var(--paper-2);
  padding: 0.2rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
}
.body-rest {
  margin: 0.15rem 0 0;
  line-height: 1.7;
}
.body-note {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.body-prose .body-cat:first-child { margin-top: 0; }
.assoc {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--rule);
  max-width: 40rem;
}
.assoc h4 {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  margin-bottom: 0.45rem;
}
.assoc-lab {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin: 0.7rem 0 0.3rem;
}
.assoc-lab:first-of-type { margin-top: 0.15rem; }
.assoc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.assoc-chip {
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: #fffdf8;
  border: 0.0625rem solid var(--rule);
  padding: 0.28rem 0.65rem;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  line-height: 1.45;
}
.assoc-chip:active { opacity: 0.75; }
.assoc-item {
  display: none;
}
.assoc-why, .assoc-title, .assoc-sub { display: none; }

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem var(--pad) 1rem;
}
.examples button {
  font: inherit;
  font-size: 0.8125rem;
  background: #fffdf8;
  border: 0.0625rem solid var(--rule);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  color: var(--ink);
}
.examples button:active { opacity: 0.7; }

.empty-list {
  padding: 1.25rem var(--pad);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 52rem) {
  .stage { grid-template-columns: 1fr; }
  .list-pane { border-right: 0; }
  html, body, #app { height: 100dvh; overflow: hidden; }

  .eyebrow { display: none; }
  h1 {
    font-size: 1.125rem;
    letter-spacing: 0.06em;
  }
  .brand-title {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "title jump"
      "count count";
    align-items: center;
    margin: 0 0 0.5rem;
  }
  .brand-title h1 { grid-area: title; }
  .exam-count { grid-area: count; }
  .brand-title .cross-jump {
    grid-area: jump;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    white-space: nowrap;
    font-size: 0.625rem;
    line-height: 1.2;
    min-height: 1.75rem;
    padding: 0.22rem 0.4rem;
  }
  .top {
    padding: calc(0.45rem + env(safe-area-inset-top)) var(--pad-r) 0.5rem var(--pad);
  }
  .search-kicker {
    display: flex;
    padding: 0 0.55rem;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
  }
  .search-shell { min-height: 2.75rem; }
  #q { font-size: 1rem; padding: 0.55rem 0.7rem; }
  .filters {
    display: block;
    overflow: visible;
    margin-top: 0.45rem;
    padding-bottom: 0;
  }
  .filter-row {
    flex-wrap: nowrap;
  }
  .filters button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.1rem;
    padding: 0.32rem 0.12rem;
    text-align: center;
    letter-spacing: 0.02em;
  }
  .geo-row.lv2,
  .geo-row.lv3 {
    flex-wrap: wrap;
    overflow: visible;
  }
  .geo-row button {
    flex-shrink: 1;
    min-height: 2rem;
  }
  .geo-row.lv3 button {
    min-height: 1.75rem;
  }
  .qg-nav .geo-row,
  .chip-wrap {
    flex-wrap: wrap !important;
    overflow: visible;
  }
  .qg-nav .geo-row button,
  .chip-wrap button {
    flex-shrink: 1;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 2rem;
    font-size: 0.75rem;
    max-width: none;
  }
  .recall-bar { display: none; }

  .pane-head { padding: 0.55rem var(--pad) 0.25rem; }
  .pane-head h2 { font-size: 0.95rem; }
  .hit {
    padding: 0.95rem var(--pad);
    min-height: 4.25rem;
  }
  .hit-title { font-size: 1.0625rem; }
  .results { padding: 0.15rem 0 5.5rem; }

  .dock {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0.55rem var(--pad) calc(0.55rem + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 0.0625rem solid var(--rule);
  }
  .dock .recall-draw {
    min-height: 2.75rem;
    min-width: 5.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.9375rem;
  }
  .dock .recall-meta { flex: 1; min-width: 0; }
  .dock .tip-btn {
    margin-left: 0;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    letter-spacing: 0.1em;
  }
  body.showing-detail .dock { display: none; }

  body.compact-head .exam-count {
    display: none !important;
  }
  body.compact-head .brand-title {
    grid-template-columns: auto 1fr;
    grid-template-areas: "title jump";
    margin: 0 0 0.35rem;
  }
  body.compact-head h1 { font-size: 0.95rem; }
  body.compact-head .top {
    padding-bottom: 0.4rem;
  }
  body.compact-head .search-shell {
    min-height: 2.4rem;
  }

  .detail-pane {
    position: fixed;
    inset: 0;
    z-index: 4;
    height: 100dvh;
    background: var(--paper);
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  .detail-toolbar {
    display: flex;
    padding: calc(0.35rem + env(safe-area-inset-top)) var(--pad) 0.35rem;
    border-bottom: 0.0625rem solid var(--rule);
  }
  .back {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.4rem 0.2rem;
    font-size: 0.9375rem;
  }
  .detail-pane .detail {
    padding: 0.85rem var(--pad) 1rem;
  }
  .detail h3 { font-size: 1.25rem; }
  .detail-body { font-size: 1rem; line-height: 1.7; }
  .detail-actions {
    max-width: none;
    padding: 0.65rem var(--pad) calc(0.65rem + env(safe-area-inset-bottom));
    border-top: 0.0625rem solid var(--rule);
    background: var(--paper);
  }
  .recall-grade {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }
  .recall-grade button,
  .recall-reveal,
  .recall-next {
    min-height: 2.75rem;
    font-size: 0.8125rem;
    padding: 0.5rem 0.3rem;
  }
  .assoc-chip {
    min-height: 2.25rem;
  }

  body.showing-detail .list-pane { visibility: hidden; }
  body:not(.showing-detail) .detail-pane { display: none; }
}

.calc {
  margin-top: 0.9rem;
  padding: 0.85rem 0.9rem 1rem;
  background: #fffdf8;
  border: 0.0625rem solid var(--ink);
}
.calc-rule {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
  letter-spacing: 0.02em;
}
.calc-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  align-items: stretch;
}
.calc-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.calc input, .calc select {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 0.0625rem solid var(--rule);
  padding: 0.55rem 0.65rem;
  min-height: 2.75rem;
  width: 100%;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.calc input:focus, .calc select:focus {
  border-color: var(--ink);
}
.calc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.65rem;
}
.calc-chips button {
  font: inherit;
  font-size: 0.75rem;
  color: var(--ink);
  background: transparent;
  border: 0.0625rem solid var(--rule);
  padding: 0.35rem 0.55rem;
  min-height: 2.1rem;
  cursor: pointer;
}
.calc-chips button.is-on {
  color: var(--seal);
  border-color: var(--seal);
  background: rgba(156, 43, 24, 0.06);
}
.calc-chips button:active { opacity: 0.75; }
.calc-out {
  margin-top: 0.65rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--seal);
  line-height: 1.55;
}
.calc-out small {
  display: block;
  margin-top: 0.25rem;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.7rem;
  margin-top: 0.55rem;
}
.calc-grid div {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.875rem;
  padding: 0.35rem 0;
  border-bottom: 0.0625rem solid var(--rule);
}
.calc-grid b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.body-jump {
  color: var(--seal);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font: inherit;
  cursor: pointer;
}
.body-jump:active { opacity: 0.75; }
.tool-jumps {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tool-jump { margin: 0; }
.tool-jump-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  color: var(--seal);
  background: #fffdf8;
  border: 0.0625rem solid var(--seal);
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.tool-jump-link::after { content: "\2192"; }
.tool-jump-link:active { opacity: 0.75; }

.exam-count { color: var(--ink); }
.exam-count-kicker {
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin: 0 0 0.22rem;
  font-weight: 500;
}
.flip-board {
  display: flex;
  align-items: flex-end;
  gap: 0.42rem;
  flex-wrap: nowrap;
}
.flip-group {
  display: flex;
  align-items: flex-end;
  gap: 0.18rem;
}
.flip-pair { display: flex; gap: 0.1rem; }
.flip-lab {
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--seal);
  padding-bottom: 0.12rem;
  font-weight: 500;
}
.flip-digit {
  position: relative;
  width: 1.12rem;
  height: 1.7rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffdf8;
  border: 0.0625rem solid var(--ink);
  perspective: 10rem;
  overflow: hidden;
  box-shadow: inset 0 -0.55rem 0 rgba(27, 22, 16, 0.04);
}
.flip-digit::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.0625rem;
  background: var(--rule);
  z-index: 4;
  pointer-events: none;
}
.flip-digit i {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-digit .base,
.flip-digit .fly-top,
.flip-digit .fly-bot {
  font-style: normal;
  font-weight: 700;
}
.flip-digit .base {
  inset: 0;
  align-items: center;
  line-height: 1.7rem;
  background: #fffdf8;
}
.flip-digit .fly-top,
.flip-digit .fly-bot {
  height: 50%;
  line-height: 1.7rem;
  background: #fffdf8;
}
.flip-digit .fly-top {
  top: 0;
  align-items: flex-start;
  transform-origin: bottom center;
  z-index: 3;
}
.flip-digit .fly-bot {
  bottom: 0;
  align-items: flex-end;
  transform-origin: top center;
  z-index: 2;
  background: #f6eee1;
}
.flip-digit .fly-bot { line-height: 0; }
.flip-digit .fly-bot::before {
  content: attr(data-n);
  display: block;
  height: 1.7rem;
  line-height: 1.7rem;
  margin-top: -0.85rem;
  text-align: center;
}
.flip-digit.is-flip .fly-top {
  animation: flapTop 0.28s var(--ease) forwards;
}
.flip-digit.is-flip .fly-bot {
  transform: rotateX(90deg);
  animation: flapBot 0.28s 0.14s var(--ease) forwards;
}
@keyframes flapTop {
  from { transform: rotateX(0); }
  to { transform: rotateX(-90deg); }
}
@keyframes flapBot {
  from { transform: rotateX(90deg); }
  to { transform: rotateX(0); }
}
.ai-banner {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.85rem;
  background: #fffdf8;
  border: 0.0625rem solid var(--ink);
}
.ai-banner .ai-kicker {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin: 0 0 0.4rem;
  font-weight: 500;
}
.ai-banner .ai-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}
.ai-banner.is-wait .ai-body { color: var(--ink-soft); }
@media (max-width: 52rem) {
  .flip-digit { width: 0.95rem; height: 1.42rem; font-size: 0.9rem; }
  .flip-digit .base { line-height: 1.42rem; }
  .flip-digit .fly-top,
  .flip-digit .fly-bot { line-height: 1.42rem; }
  .flip-digit .fly-bot::before { height: 1.42rem; line-height: 1.42rem; margin-top: -0.71rem; }
  .exam-count-kicker { font-size: 0.5625rem; }
}
@media (prefers-reduced-motion: reduce) {
  .flip-digit.is-flip .fly-top,
  .flip-digit.is-flip .fly-bot { animation: none; transform: none; }
}

.tip-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(27, 22, 16, 0.45);
}
.tip-layer[hidden] { display: none; }
.tip-sheet {
  width: min(22rem, 100%);
  background: #fffdf8;
  border: 0.0625rem solid var(--rule);
  padding: 1.2rem 1.15rem 1.15rem;
}
.tip-sheet h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
}
.tip-sheet p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.tip-qrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
.tip-qrs-one {
  grid-template-columns: 1fr;
  max-width: 13.5rem;
  margin-left: auto;
  margin-right: auto;
}
.tip-qrs figure { margin: 0; text-align: center; }
.tip-qrs img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 0.0625rem solid var(--rule);
}
.tip-qrs figcaption {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--seal);
}
.copy-v {
  font: inherit;
  color: var(--seal);
  background: none;
  border: 0;
  border-bottom: 0.0625rem dashed var(--seal);
  padding: 0;
  cursor: pointer;
}
.tip-close {
  width: 100%;
  min-height: 2.5rem;
  font: inherit;
  letter-spacing: 0.12em;
  color: #fffdf8;
  background: var(--seal);
  border: 0;
  cursor: pointer;
}
.tip-close:active { opacity: 0.75; }
