/* momentsregained.com — the book's own paper and type (apple/App/Theme.swift, tools/make_cover.py).
   Tokens: paper #FBF8F2 / ink #1F1B16 / mist #6B665E / amber #A8692E (the app's accent) / film #1D1915 (the cover's strip).
   Type: Songti for Chinese display, Baskerville for Latin, the system sans for reading. No webfonts. */
:root {
  --paper: #FBF8F2; --panel: #F2EFE8; --ink: #1F1B16; --mist: #6B665E; --rule: rgba(31, 27, 22, .16);
  --amber: #A8692E; --film: #1D1915; --film-ink: #CFC7BA; --wxname: #576B95; --ok: #3F6B3A;
  --serif-zh: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --serif-latin: Baskerville, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1B1A18; --panel: #272522; --ink: #ECE6DC; --mist: #A39D93; --rule: rgba(236, 230, 220, .18);
          --amber: #D29A63; --film: #0F0E0D; --film-ink: #A39D93; --wxname: #8FA3CF; --ok: #8DB987; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.8; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif-zh); font-weight: 600; line-height: 1.3; letter-spacing: .03em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h2 { font-size: 1.55rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.en { font-family: var(--serif-latin); font-weight: 400; letter-spacing: .02em; }
p + p { margin-top: 1em; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 42rem; }
.mist { color: var(--mist); }
.small { font-size: .92rem; }

/* header */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 1.4rem 0 1rem; }
.mark { color: var(--ink); font-family: var(--serif-zh); font-weight: 600; font-size: 1.2rem; letter-spacing: .08em; white-space: nowrap; }
.mark .en { color: var(--mist); font-size: .9rem; margin-left: .6em; letter-spacing: .04em; }
.top nav { display: flex; gap: 1.6rem; }
.top nav a { color: var(--ink); }
.top nav a[aria-current] { border-bottom: 2px solid var(--amber); }

/* the double rule of the cover, between chapters */
.dbl { height: 5px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 4rem 0 2.5rem; }

/* hero: the book standing on a shelf. The band is full width; the shelf is its bottom 5.2rem. */
.hero-band { background: linear-gradient(to top, var(--film) 5.2rem, transparent 5.2rem); }
.hero { display: grid; grid-template-columns: minmax(14rem, 21rem) 1fr; gap: 2rem 4rem; align-items: end; padding-top: 2.5rem; }
.cover { position: relative; margin-bottom: 5.2rem; box-shadow: -10px 14px 32px rgba(30, 20, 10, .38), 0 1px 2px rgba(0, 0, 0, .3); border-radius: 2px 5px 5px 2px; overflow: hidden; }
.cover img { width: 100%; height: auto; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .30), rgba(255, 255, 255, .22) 2.5%, rgba(0, 0, 0, .10) 5%, transparent 9%); }
.hero-text { padding-bottom: 7.2rem; }
.hero-text h1 { margin-bottom: 1rem; }
.hero-text .lead { font-size: 1.1rem; max-width: 34rem; }
.cta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 1.8rem; }
.btn { display: inline-block; background: var(--amber); color: #fff; padding: .65rem 1.25rem; border-radius: 4px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--amber); border-color: currentColor; }
.btn[disabled] { opacity: .55; cursor: default; }
.fine { color: var(--mist); font-size: .92rem; margin-top: .9rem; }
@media (max-width: 44rem) {
  .hero-band { background: linear-gradient(to top, var(--film) 4rem, transparent 4rem); }
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 1.5rem; }
  .hero-text { order: 1; padding-bottom: 2.5rem; }
  .cover { order: 2; max-width: 15rem; margin: 0 auto 4rem; }
}

/* the three steps: a real sequence */
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem 3rem; }
.steps li { display: grid; grid-template-columns: 2.2rem 1fr; gap: .4rem .6rem; align-items: baseline; }
.steps .n { font-family: var(--serif-zh); font-size: 1.6rem; color: var(--amber); line-height: 1; grid-row: span 2; }
.steps h3 { margin: 0; }
.steps p { grid-column: 2; margin: 0; }

/* plain lists with air */
.points { list-style: none; display: grid; gap: .9rem; }
.points li { padding-left: 1.2rem; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: .78em; width: .45rem; height: .45rem; background: var(--amber); border-radius: 50%; }

/* prices, set like a 目录 */
.toc { list-style: none; max-width: 42rem; }
.toc li { padding: 1rem 0; border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc .row { display: flex; align-items: baseline; gap: .6rem; }
.toc .name { font-family: var(--serif-zh); font-weight: 600; font-size: 1.1rem; white-space: nowrap; }
.toc .leader { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-.4em); min-width: 2rem; }
.toc .price { font-family: var(--serif-latin); font-size: 1.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 44rem) { .toc .price { white-space: normal; } }
.toc .what { color: var(--mist); margin-top: .2rem; }

/* download table, FAQ, forms */
.panel { background: var(--panel); border-radius: 6px; padding: 1.4rem 1.6rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.4rem; }
.kv dt { color: var(--mist); }
.kv dd code { font-size: .85rem; word-break: break-all; }
code { overflow-wrap: anywhere; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--panel); padding: .1em .35em; border-radius: 3px; }
details { border-top: 1px solid var(--rule); padding: .9rem 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { font-family: var(--serif-zh); font-weight: 600; font-size: 1.05rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--mist); font-family: var(--serif-latin); }
details[open] summary::after { content: "−"; }
details p { margin-top: .6rem; max-width: 40rem; }
form { display: grid; gap: 1.1rem; max-width: 34rem; }
label { display: grid; gap: .35rem; }
label span { color: var(--mist); font-size: .95rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: .6rem .8rem; width: 100%; }
textarea { min-height: 9rem; resize: vertical; }
.msg { padding: .8rem 1rem; border-radius: 4px; background: var(--panel); }
.msg.ok { color: var(--ok); }
.msg.err { color: #9A3B2E; }
@media (prefers-color-scheme: dark) { .msg.err { color: #E39A8E; } }

/* footer */
.foot { background: var(--film); color: var(--film-ink); margin-top: 5rem; padding: 2.4rem 0 2.8rem; font-size: .95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; align-items: baseline; justify-content: space-between; }
.foot a { color: var(--film-ink); }
.foot nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) { details p { animation: fade .25s ease; } }
@keyframes fade { from { opacity: 0; } }

/* the shop */
.choices { border: 0; display: grid; gap: .6rem; }
.choices legend { color: var(--mist); font-size: .95rem; margin-bottom: .5rem; }
.choices.inline { grid-template-columns: 1fr 1fr; }
.choice { display: grid; grid-template-columns: 1.2rem 1fr; gap: .7rem; align-items: start; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.choice input { margin-top: .45rem; accent-color: var(--amber); }
.choice span { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; color: var(--ink); font-size: 1rem; }
.choice b { font-family: var(--serif-zh); font-weight: 600; }
.choice em { font-style: normal; font-family: var(--serif-latin); font-size: 1.1rem; white-space: nowrap; }
.choice small { grid-column: 1 / -1; color: var(--mist); font-size: .9rem; line-height: 1.5; }
.order-view dl.kv { margin-bottom: 1.2rem; }
.cert { background: var(--panel); border-radius: 6px; padding: 1.2rem 1.4rem; margin-top: 1rem; }
.cert .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.cert code { display: block; white-space: pre-wrap; word-break: break-all; font-size: .72rem; margin-top: .8rem; color: var(--mist); background: none; padding: 0; }
