/* readeasy — 纸上书斋 / paper study
   The page is a well-set book spread: warm paper, ink Georgia, hairline rules,
   small caps, dotted leaders, almanac tables. Rust is ink accent, never paint. */
:root {
  --ink: #1f2430;
  --ink-soft: #4d4a44;
  --paper: #faf8f4;
  --paper-deep: #f3ede0;
  --card: #fffdf8;
  --note: #f6efe1;
  --accent: #b3541e;
  --accent-deep: #8f3f12;
  --line: #e4dccd;
  --rule: #c9bfa9;
  --rule-strong: #b3a789;
  --good: #3a6b40;
  --good-tint: #edf2e6;
  --bad: #a33d2f;
  --bad-tint: #f7e9e2;
  --radius: 2px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}
::selection {
  background: var(--accent);
  color: var(--paper);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input,
textarea,
select {
  caret-color: var(--accent);
}

/* ---- masthead: double rule, like a printed running head ---- */
.site-header {
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 3px 0 -2px var(--rule);
  background: var(--paper);
}
.site-header .inner {
  max-width: 58rem;
  margin: 0 auto;
  padding: 18px 20px 14px;
  display: flex;
  align-items: baseline;
  gap: 26px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}
.brand-mark {
  display: block;
  flex: none;
}
.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.site-nav a:hover {
  color: var(--accent);
}

/* ---- the sheet ---- */
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 44px 20px 56px;
}
h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
main h1::after {
  content: "";
  display: block;
  width: 3.4rem;
  height: 3px;
  background: var(--accent);
  margin-top: 20px;
}
h2 {
  font-size: 1.02rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  color: var(--ink);
  margin: 48px 0 16px;
}
h3 {
  font-size: 1.12rem;
  margin: 24px 0 8px;
}
p,
li {
  color: var(--ink-soft);
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(179, 84, 30, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}
.lede {
  font-size: 1.12rem;
  font-style: italic;
  color: var(--ink);
  margin: 14px 0 30px;
}
.lede em {
  font-style: normal;
}
.lede::first-letter {
  float: left;
  font-size: 3.3em;
  line-height: 0.8;
  padding: 0.05em 0.12em 0 0;
  color: var(--accent);
}

/* ---- quiz sheet: exam paper ---- */
.quiz-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin: 30px 0 34px;
}
.quiz-progress {
  height: 3px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 20px;
}
.quiz-progress .bar {
  height: 100%;
  background: var(--accent);
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.q-count {
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.q-text {
  font-size: 1.3rem;
  line-height: 1.45;
  margin: 10px 0 20px;
  color: var(--ink);
}
.opts {
  display: grid;
  gap: 10px;
  counter-reset: optl;
}
.opt {
  display: flex;
  align-items: baseline;
  gap: 13px;
  text-align: left;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  counter-increment: optl;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.opt::before {
  content: counter(optl, upper-alpha) ".";
  flex: none;
  min-width: 1.3em;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--note);
}
.opt:disabled {
  cursor: default;
  opacity: 0.7;
}
.opt.correct {
  border-color: var(--good);
  background: var(--good-tint);
  opacity: 1;
}
.opt.correct::before {
  color: var(--good);
}
.opt.wrong {
  border-color: var(--bad);
  background: var(--bad-tint);
  opacity: 1;
}
.opt.wrong::before {
  color: var(--bad);
}
.quiz-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 13px 26px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.btn:hover {
  background: #323a4d;
  color: var(--paper);
}
.btn:active {
  transform: translateY(1px);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.ghost:hover {
  background: var(--ink);
  color: var(--paper);
}
.result-score {
  font-size: 2.9rem;
  line-height: 1.1;
  color: var(--accent);
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}
.result-tier {
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.share-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---- calculator & speed test ---- */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
textarea,
input[type="number"],
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--card);
}
textarea {
  min-height: 140px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.wpm-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.wpm-chip {
  font-family: inherit;
  font-size: 0.88rem;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.wpm-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.wpm-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.result-box {
  background: var(--note);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 18px;
}
.result-big {
  font-size: 1.9rem;
  color: var(--ink);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.result-sub {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 6px 0 0;
}
.st-passage {
  font-size: 1.16rem;
  line-height: 1.8;
  min-height: 60px;
  margin: 14px 0;
}
.st-passage.on {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.st-passage:not(.on) {
  color: var(--ink-soft);
  font-style: italic;
}

/* ---- almanac tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  background: transparent;
  font-size: 0.97rem;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
th {
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-strong);
}
tbody tr:hover {
  background: var(--paper-deep);
}
.num td + td {
  text-align: right;
}

/* ---- rec book ---- */
.rec-book {
  display: flex;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.rec-cover {
  width: 96px;
  height: 145px;
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow:
    inset 0 0 0 3px var(--ink),
    inset 0 0 0 4px rgba(250, 248, 244, 0.4);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  padding: 10px;
}
.rec-info {
  flex: 1;
  min-width: 240px;
}
.rec-info h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}
.rec-why {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 4px 0 10px;
}

/* ---- lists as book entries: hairlines, not cards ---- */
.like-list,
.club-list,
.quote-list,
.hub-list {
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
.like-list li,
.quote-list li {
  padding: 20px 0;
}
.like-list li + li,
.quote-list li + li,
.club-list li + li {
  border-top: 1px solid var(--line);
}
.like-list h3 {
  margin: 0 0 2px;
  font-size: 1.15rem;
}
.like-list .by {
  margin: 0 0 8px;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.like-list li > p:last-child {
  margin: 0;
}
.quote-list blockquote {
  margin: 0 0 10px;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
}
.quote-list .attr {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.club-list li {
  padding: 16px 0;
}
.club-list .q {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

/* ---- hubs: a table of contents with dotted leaders ---- */
.hub-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
}
.hub-list a {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  min-width: 0;
}
.hub-list a::after {
  content: "· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·";
  flex: 1 1 0;
  min-width: 1.6rem;
  margin: 0 10px;
  color: var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}
.hub-list span {
  flex: none;
  margin-left: auto;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: right;
}

/* ---- FAQ & expandables: hairline Q&A ---- */
details {
  border-top: 1px solid var(--line);
  padding: 2px 0;
}
summary {
  padding: 14px 0;
  font-size: 1.02rem;
  color: var(--ink);
  cursor: pointer;
}
summary::marker {
  color: var(--accent);
}
summary:hover {
  color: var(--accent-deep);
}
details p {
  margin: 0 0 14px;
  padding-right: 6px;
}
details ol {
  margin: 0 0 14px;
}

/* ---- passport notes: reader's margin annotations ---- */
.passport-line,
.your-pace {
  background: var(--note);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 18px 0;
  font-size: 0.98rem;
  color: var(--ink);
}
.shelf-score {
  display: inline-block;
  margin-left: 7px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  background: transparent;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ---- colophon ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  box-shadow: 0 -3px 0 -2px var(--rule);
  background: var(--paper);
}
.site-footer .inner {
  max-width: 50rem;
  margin: 0 auto;
  padding: 26px 20px 30px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.site-footer .inner > span {
  display: block;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 10px;
}
.site-footer a:hover {
  color: var(--accent);
}
.site-footer a svg {
  flex: none;
}

@media (max-width: 640px) {
  main {
    padding-top: 32px;
  }
  h1 {
    font-size: 1.68rem;
  }
  main h1::after {
    margin-top: 14px;
  }
  h2 {
    font-size: 0.94rem;
    letter-spacing: 0.12em;
    margin: 38px 0 14px;
  }
  .lede::first-letter {
    font-size: 2.7em;
  }
  .q-text {
    font-size: 1.14rem;
  }
  .quiz-card {
    padding: 20px 16px;
  }
  table {
    font-size: 0.85rem;
  }
  th,
  td {
    padding: 8px;
  }
  .hub-list span {
    font-size: 0.78rem;
  }
  .rec-cover {
    width: 78px;
    height: 118px;
  }
}

.badge-row {
  text-align: center;
  margin: 26px auto 0;
}
.badge-row img {
  width: 126px;
  height: auto;
  opacity: 0.95;
}

/* ---- 404: missing from the shelf ---- */
.nf {
  text-align: center;
  padding-top: 8px;
}
.nf-code {
  display: inline-block;
  font-size: clamp(4.4rem, 13vw, 6rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
  padding: 26px 38px 22px;
  margin: 34px 0 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  box-shadow:
    0 3px 0 -2px var(--rule),
    0 -3px 0 -2px var(--rule);
}
.nf h1 {
  margin-top: 26px;
}
.nf h1::after {
  margin-left: auto;
  margin-right: auto;
}
.nf .lede {
  margin-bottom: 32px;
}
.nf .lede::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
}
.nf-actions {
  margin: 0 0 44px;
}
.nf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.nf-list li {
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.nf-list li:last-child {
  border-bottom: none;
}

/* ---- author checklist + print (batch 50) ---- */
table.num td.box {
  width: 26px;
}
table.num td.box span {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  vertical-align: middle;
  opacity: 0.45;
}
.check-note {
  font-size: 0.9rem;
  color: var(--muted, #6b7280);
}
.pbtn {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.print-head {
  display: none;
}
.club-print-source {
  display: none;
}
@media print {
  body:has(.club-list)
    main
    > :not(.club-print-title):not(.club-print-source):not(.club-list) {
    display: none !important;
  }
  .club-list {
    margin-top: 0;
  }
  .club-print-title {
    margin-top: 0;
  }
  .club-print-source {
    display: block;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.4rem;
  }
  .site-header,
  .site-footer,
  .print-hide,
  .club-print-hide,
  .pbtn,
  .check-note,
  ins.adsbygoogle,
  iframe {
    display: none !important;
  }
  .print-head {
    display: block;
    font-weight: 700;
    margin-bottom: 0.6rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.4rem;
  }
}
