/* The site's own pages (welcome, sign-in), shared by both. Same warm paper and terracotta as the app. */
:root {
  --paper: #f7f2e9;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #1f1a15;
  --ink-2: #51483e;
  --muted: #8a7f72;
  --line: #e5dbcc;
  --line-2: #d6cab8;
  --accent: #c0562f;
  --accent-hover: #a9481f;
  --accent-ink: #9c4220;
  --accent-soft: #f6e3d8;
  --c1: #d9694c;
  --c2: #3d7fc2;
  --c3: #4f9a7b;
  --ok: #2f8a5f;
  --ok-soft: #dcefe4;
  --bad: #c23a2b;
  --bad-soft: #f8dfdb;
  --warn: #b7791f;
  --warn-soft: #f6ead2;
  --serif-en: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif-zh: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(40, 30, 18, 0.06), 0 10px 30px rgba(40, 30, 18, 0.09);
  --shadow-lg: 0 34px 90px rgba(40, 30, 18, 0.2), 0 8px 22px rgba(40, 30, 18, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1180px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #14120f;
  --paper-2: #1b1915;
  --card: #211e1a;
  --ink: #efe9df;
  --ink-2: #c8bfb2;
  --muted: #918779;
  --line: #34302a;
  --line-2: #464038;
  --accent: #e07b52;
  --accent-hover: #ea8f69;
  --accent-ink: #f0a07d;
  --accent-soft: #3a2a21;
  --c1: #ec8a6e;
  --c2: #6aa6e6;
  --c3: #6fc29f;
  --ok: #5cc192;
  --ok-soft: #1f3a2d;
  --bad: #ef6b5b;
  --bad-soft: #43231f;
  --warn: #e0a84a;
  --warn-soft: #3b2f1b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.6), 0 8px 22px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* One language at a time: text is written in both, marked with lang. */
html[data-lang="zh"] body [lang="en"],
html[data-lang="en"] body [lang="zh-CN"] { display: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* Paper grain. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { opacity: 0.25; }
body > * { position: relative; z-index: 1; }
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin: 0 auto; }
.serif { font-family: var(--serif-en); }
html[data-lang="zh"] .serif { font-family: var(--serif-zh); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--card); border-color: var(--ink-2); }
.btn.small { height: 36px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }
.btn .arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Top bar ---- */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.3) blur(12px); background: color-mix(in srgb, var(--paper) 78%, transparent); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-links { display: flex; gap: 22px; margin-left: 12px; font-size: 14.5px; color: var(--ink-2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-btn { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.lang-btn:hover { border-color: var(--line-2); color: var(--ink); }

/* ---- Hero ---- */
.hero { padding: 64px 0 104px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 64px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
html[data-lang="zh"] .eyebrow { letter-spacing: 0.12em; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
h1 { font-family: var(--serif-en); font-weight: 600; font-size: clamp(42px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -0.012em; margin: 18px 0 22px; text-wrap: balance; }
html[data-lang="zh"] h1 { font-family: var(--serif-zh); font-weight: 700; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.22; letter-spacing: 0.01em; }
h1 em { font-style: italic; font-weight: 500; color: var(--accent); position: relative; white-space: nowrap; }
html[data-lang="zh"] h1 em { font-style: normal; }
h1 em::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -0.08em; height: 0.22em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2, 80 11, 120 5 S 180 4, 198 7' fill='none' stroke='%23c0562f' stroke-width='3' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transform-origin: left; animation: draw-under 0.9s 0.5s var(--ease) both;
}
@keyframes draw-under { from { transform: scaleX(0); } }
.lede { font-size: 18.5px; line-height: 1.7; color: var(--ink-2); max-width: 34em; margin: 0 0 30px; }
html[data-lang="zh"] .lede { font-size: 17.5px; line-height: 1.9; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fine { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fine > span { display: inline-flex; align-items: center; gap: 6px; }
.fine > span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }

/* The living manuscript */
.stage { position: relative; min-height: 540px; perspective: 1600px; }
.sheet {
  position: relative; margin: 28px 34px 0 40px; padding: 30px 38px 40px; background: var(--card); border-radius: 8px 8px 22px 8px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: rotate(-1.4deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease);
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, color-mix(in srgb, var(--line) 55%, transparent) 35px 36px);
  background-position: 0 70px;
}
.sheet::after { content: ""; position: absolute; right: 0; bottom: 0; width: 46px; height: 46px; border-radius: 0 0 22px 0; background: linear-gradient(135deg, transparent 50%, var(--paper-2) 50%); box-shadow: -2px -2px 6px rgba(40, 30, 18, 0.08); }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 18px; }
.sheet-head b { color: var(--ink-2); font-weight: 600; }
.sheet-text { font-family: var(--serif-en); font-size: 19.5px; line-height: 36px; min-height: 216px; color: var(--ink); }
html[data-lang="zh"] .sheet-text { font-family: var(--serif-zh); font-size: 19px; text-indent: 2em; }
.who {
  --c: var(--c1); background: linear-gradient(var(--c), var(--c)) left bottom / 0% 2.5px no-repeat; transition: background-size 0.5s var(--ease), color 0.4s;
  padding-bottom: 1px; white-space: nowrap;
}
.who.lit { background-size: 100% 2.5px; color: color-mix(in srgb, var(--c) 72%, var(--ink)); }
.flag { border-radius: 3px; transition: background 0.5s, box-shadow 0.5s; }
.flag.on { background: var(--warn-soft); box-shadow: 0 0 0 3px var(--warn-soft); }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.float { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px) scale(0.98); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.float.in { opacity: 1; transform: none; }
.float-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.map { left: 0; bottom: 6px; width: 292px; }
.map svg { width: 100%; height: auto; padding: 2px 6px 8px; }
.map .node { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: center; transition: opacity 0.4s, transform 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
.map .node.in { opacity: 1; transform: none; }
.map .node text { font: 600 13px var(--sans); fill: #fff; }
.map .node .label { font: 500 11px var(--sans); fill: var(--ink-2); }
.map .link { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.9s var(--ease); }
.map .link.in { stroke-dashoffset: 0; }
.map .link.tense { stroke: var(--bad); stroke-dasharray: 1; }
.map .link.close { stroke: var(--ok); }
.map .tag { opacity: 0; transition: opacity 0.4s 0.5s; }
.map .tag.in { opacity: 1; }
.map .tag rect { fill: var(--card); stroke: var(--line-2); }
.map .tag text { font: 600 10.5px var(--sans); fill: var(--ink-2); }
.note { right: 0; top: 290px; width: 268px; padding-bottom: 12px; }
.note-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.note p { margin: 9px 14px 10px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.note-actions { display: flex; gap: 6px; padding: 0 14px; }
.note-actions span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.note-actions span:first-child { background: var(--ink); color: var(--card); border-color: var(--ink); }
.thread { left: 8px; top: 0; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-radius: 999px; }
.thread i { width: 8px; height: 8px; border-radius: 50%; background: var(--c2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c2) 22%, transparent); }
.replay { position: absolute; right: 30px; bottom: -6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; opacity: 0; transition: opacity 0.4s; }
.stage.done .replay { opacity: 1; }
.replay:hover { color: var(--ink); border-color: var(--line-2); }

/* ---- Sections ---- */
.section { padding: 104px 0; }
.section.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 12px; }
h2 { font-family: var(--serif-en); font-weight: 600; font-size: clamp(32px, 3.8vw, 50px); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 18px; text-wrap: balance; }
html[data-lang="zh"] h2 { font-family: var(--serif-zh); font-weight: 700; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.3; letter-spacing: 0.01em; }
/* A Chinese phrase that wraps as a whole, so a heading never splits a word. */
.ph { display: inline-block; }
.section-lede { font-size: 17.5px; color: var(--ink-2); max-width: 40em; margin: 0; }
.head-center { text-align: center; margin: 0 auto 56px; max-width: 760px; }
.head-center .section-lede { margin: 0 auto; }

.forget { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 26px; box-shadow: 0 1px 2px rgba(40, 30, 18, 0.04); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.fcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.fcard h3 { font-family: var(--serif-en); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 20px 0 8px; }
html[data-lang="zh"] .fcard h3 { font-family: var(--serif-zh); font-size: 20px; }
.fcard p { margin: 0; color: var(--ink-2); font-size: 15px; }
.mini { height: 172px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); position: relative; overflow: hidden; padding: 16px; }
.mini-people { display: flex; flex-direction: column; gap: 10px; }
.mp { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.mp b { font-weight: 600; }
.mp small { color: var(--muted); font-size: 12px; }
.pill { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.mini-time { display: flex; flex-direction: column; justify-content: center; gap: 0; }
.track { position: relative; height: 2px; background: var(--line-2); margin: 46px 6px 0; }
.ev { position: absolute; top: -6px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--line-2); }
.ev > span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; color: var(--ink-2); font-weight: 600; text-align: center; }
.ev > span small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; }
.ev.up > span { top: auto; bottom: 18px; }
.ev.first > span { left: -4px; transform: none; text-align: left; }
.ev.last > span { left: auto; right: -4px; transform: none; text-align: right; }
.mini-threads { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.th { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.th .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.th em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* Edits you stay in charge of */
.edit-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.ticks li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f8a5f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.demo { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px; }
.demo-text { font-family: var(--serif-en); font-size: 19px; line-height: 1.9; margin: 0 0 22px; color: var(--ink); }
html[data-lang="zh"] .demo-text { font-family: var(--serif-zh); font-size: 18px; text-indent: 2em; }
.swap { position: relative; border-radius: 3px; transition: background 0.5s; }
.swap .old { text-decoration: underline wavy color-mix(in srgb, var(--warn) 70%, transparent); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.swap .new { display: none; background: var(--ok-soft); border-radius: 3px; animation: settle 1.6s var(--ease) forwards; }
@keyframes settle { 0% { background: color-mix(in srgb, var(--ok) 35%, transparent); } 100% { background: transparent; } }
.demo.applied .swap .old { display: none; }
.demo.applied .swap .new { display: inline; }
.edit-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 14px 16px; transition: opacity 0.35s, transform 0.35s var(--ease); }
.ec-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.kind { padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, #8e5cc0 15%, var(--card)); color: color-mix(in srgb, #8e5cc0 85%, var(--ink)); font-weight: 700; }
.diff { font-family: var(--serif-en); font-size: 16px; line-height: 1.75; margin: 0; }
html[data-lang="zh"] .diff { font-family: var(--serif-zh); font-size: 15.5px; }
.diff del { background: var(--bad-soft); color: var(--bad); text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); border-radius: 3px; padding: 0 2px; }
.diff ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 0 2px; }
.why { margin: 8px 0 12px; font-size: 13.5px; color: var(--ink-2); }
.ec-actions { display: flex; gap: 8px; }
.ec-actions button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.ec-actions button.apply { background: var(--ok); color: #fff; border-color: var(--ok); }
.ec-actions button:hover { filter: brightness(1.05); }
.done-bar { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 14px; }
.done-bar button { border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.demo.applied .edit-card { display: none; }
.demo.applied .done-bar { display: flex; }
.demo.ignored .edit-card { display: none; }
.demo.ignored .done-bar { display: flex; background: var(--paper-2); color: var(--muted); }
.demo-hint { position: absolute; top: -14px; right: 22px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.demo.applied .demo-hint, .demo.ignored .demo-hint { opacity: 0; transition: opacity 0.3s; }

/* Everything else */
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.feat { background: var(--card); padding: 28px 26px 30px; }
.feat .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 16px; }
.feat h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.feat p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.facts span { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; color: var(--ink-2); }

/* Pricing */
.price-wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.big-num { font-family: var(--serif-en); font-size: clamp(56px, 7vw, 92px); font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin: 22px 0 6px; }
.big-num small { font-size: 0.32em; letter-spacing: 0; color: var(--muted); font-weight: 500; margin-left: 8px; }
.price-notes { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: var(--ink-2); font-size: 15px; }
.price-notes li { display: flex; gap: 10px; }
.price-notes li::before { content: "—"; color: var(--accent); }
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pack { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; position: relative; transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; }
.pack:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.pack.best { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.pack .p-credits { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pack .p-unit { font-size: 13px; color: var(--muted); }
.pack .p-price { margin-top: 12px; font-size: 17px; font-weight: 650; color: var(--accent-ink); }
.pack .p-bonus { position: absolute; top: 18px; right: 18px; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 9px; border-radius: 999px; }
.rates { margin: 18px 0 0; padding: 16px 18px; border-radius: 16px; border: 1px dashed var(--line-2); font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.rates b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 22px; transition: border-color 0.2s; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 16.5px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: -4px 0 18px; color: var(--ink-2); }

/* Closing */
.closing { padding: 120px 0 110px; text-align: center; }
.closing h2 { font-size: clamp(36px, 5vw, 64px); margin-bottom: 26px; }
.closing .closing-contact { margin: 22px 0 0; color: var(--ink-2); font-size: 15px; }
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13.5px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }

/* Revealed as they scroll into view */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }
.rise.seen { opacity: 1; transform: none; }

@media (max-width: 1020px) {
  .hero .wrap, .edit-split, .price-wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding-top: 40px; }
  .stage { max-width: 620px; width: 100%; margin: 0 auto; }
  .forget { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .grid6 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav .wrap { gap: 10px; }
  .hero { padding-bottom: 72px; }
  .lede { font-size: 17px; }
  /* On a phone the cards follow the page instead of floating over it: the note tucked under the
     page's corner, the map below. */
  .stage { min-height: 0; display: flex; flex-direction: column; }
  .sheet { order: 1; margin: 34px 0 0; padding: 22px 20px 28px; }
  .sheet-text, html[data-lang="zh"] .sheet-text { font-size: 17px; line-height: 32px; min-height: 192px; }
  html[data-lang="en"] .sheet-text { min-height: 256px; }
  .sheet { background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--line) 55%, transparent) 31px 32px); background-position: 0 58px; }
  .float.note { order: 2; position: relative; inset: auto; width: min(300px, 86%); margin: -26px 0 0 auto; }
  .float.map { order: 3; position: relative; inset: auto; width: min(320px, 88%); margin: 14px 0 0; }
  .replay { order: 4; position: static; align-self: flex-end; margin-top: 12px; }
  .section { padding: 76px 0; }
  .grid6 { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pack { padding: 16px; }
  .pack .p-credits { font-size: 22px; }
  .pack .p-bonus { position: static; align-self: flex-start; margin-bottom: 6px; }
  .demo { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise { opacity: 1; transform: none; }
}

/* ---- Sign-in page ---- */
.login-body { min-height: 100vh; display: flex; flex-direction: column; }
.login-main { flex: 1; display: grid; place-items: center; padding: 32px 16px 64px; }
.login-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 34px 32px 30px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--c1), var(--accent), var(--c2), var(--c3)); }
.login-card h1 { font-size: 32px; margin: 4px 0 8px; line-height: 1.15; }
html[data-lang="zh"] .login-card h1 { font-size: 28px; }
.login-card .sub { margin: 0 0 24px; color: var(--ink-2); font-size: 15px; }
.login-card .sub b { color: var(--ink); }
.lfield label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.lfield input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--paper);
  font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
.lfield input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.code-input { text-align: center; font-size: 28px !important; font-weight: 700; letter-spacing: 0.5em; padding-left: calc(16px + 0.5em) !important; font-variant-numeric: tabular-nums; height: 64px !important; }
.login-card .btn { width: 100%; margin-top: 16px; height: 50px; }
.login-msg { margin: 14px 0 0; font-size: 14px; line-height: 1.55; min-height: 0; }
.login-msg:empty { display: none; }
.login-msg.err { color: var(--bad); }
.login-msg.dev { padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.login-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: 13.5px; }
.linkish { border: 0; background: transparent; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.linkish:hover { color: var(--ink); }
.linkish[disabled] { color: var(--muted); cursor: default; text-decoration: none; }
.login-fine { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.step[hidden] { display: none; }
.signed { text-align: center; padding: 10px 0; }
.signed .check { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.consent a { color: var(--accent-ink); font-weight: 600; text-underline-offset: 2px; }
.login-legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); padding: 0 16px 32px; }
.login-legal a { text-decoration: none; }
.login-legal a:hover { color: var(--ink); text-decoration: underline; }

/* =================================================================================================
   The publisher's pages: catalog, book, reader, plans, billing history, legal. Same paper, more room to read.
   ================================================================================================= */
.ic { flex: none; }
.sandbox-bar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; padding: 7px 16px; font-size: 13px; line-height: 1.45;
  text-align: center; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 65%, var(--ink)); border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, var(--line));
}
.sandbox-bar a { font-weight: 650; }
.sb-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.site-links a { position: relative; padding: 6px 0; }
.site-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.btn.block { width: 100%; }
.btn.quiet { height: auto; padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--card); }
.icon-btn[aria-expanded="true"] { background: var(--card); border-color: var(--line-2); color: var(--ink); }

.page { padding: 52px 0 104px; min-height: 62vh; }
.page-head { margin-bottom: 34px; }
.page-title { font-family: var(--serif-en); font-weight: 600; font-size: clamp(32px, 4vw, 48px); line-height: 1.12; letter-spacing: -0.01em; margin: 8px 0 12px; text-wrap: balance; }
html[data-lang="zh"] .page-title { font-family: var(--serif-zh); font-weight: 700; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.3; letter-spacing: 0.01em; }
.page-lede { color: var(--ink-2); font-size: 17px; line-height: 1.7; max-width: 40em; margin: 0; }
.sec-title { font-family: var(--serif-en); font-weight: 600; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; margin: 0 0 6px; }
html[data-lang="zh"] .sec-title { font-family: var(--serif-zh); font-weight: 700; font-size: clamp(22px, 2.4vw, 26px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sec-head p { margin: 0; color: var(--ink-2); }

/* Search */
.search {
  display: flex; align-items: center; gap: 10px; max-width: 580px; height: 52px; padding: 0 8px 0 18px; margin-top: 26px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); box-shadow: 0 1px 2px rgba(40, 30, 18, 0.04);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; outline: none; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search > .ic { color: var(--muted); }
.search-meta { margin: 14px 0 0; font-size: 14px; color: var(--muted); min-height: 1.6em; }

/* Covers, drawn from the title */
.cover {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; aspect-ratio: 2 / 3; padding: 11px 10px 10px;
  border-radius: 3px 8px 8px 3px; color: #fff; overflow: hidden; box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.12), 0 8px 20px rgba(40, 30, 18, 0.2);
}
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 7%, transparent 93%, rgba(0, 0, 0, 0.08)), radial-gradient(120% 70% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%); }
.cover-title { font-family: var(--serif-en); font-weight: 600; font-size: 13.5px; line-height: 1.22; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.cover-title[lang="zh-Hans"] { font-family: var(--serif-zh); }
.cover-author { font-size: 10.5px; opacity: 0.88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover.large { padding: 20px 18px 16px; border-radius: 4px 12px 12px 4px; box-shadow: inset 7px 0 0 rgba(0, 0, 0, 0.12), var(--shadow-lg); }
.cover.large .cover-title { font-size: 24px; -webkit-line-clamp: 6; }
.cover.large .cover-author { font-size: 13.5px; }

/* The catalog */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.book-card {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 18px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--line); text-decoration: none; transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.book-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.bc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bc-title { font-family: var(--serif-en); font-size: 20px; font-weight: 600; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.bc-title[lang="zh-Hans"] { font-family: var(--serif-zh); font-size: 18.5px; }
.bc-author { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.bc-syn { margin: 6px 0 0; font-size: 14px; line-height: 1.62; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.free { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.tag.test { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); border-color: transparent; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.sk { pointer-events: none; }
.sk .cover, .sk-line { background: linear-gradient(90deg, var(--paper-2), var(--line), var(--paper-2)) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; box-shadow: none; }
.sk-line { display: block; height: 12px; border-radius: 6px; margin: 6px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* The catalog's next page */
.more-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; text-align: center; }
.more-row .search-meta, .more-row .form-msg { margin: 0; }
.more-row .search-meta:empty, .more-row .form-msg:empty { display: none; }
.more-row .btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

/* Loading, empty, failed */
.state-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: 22px; background: color-mix(in srgb, var(--card) 55%, transparent); color: var(--ink-2); }
.state-box > .ic { color: var(--muted); }
.state-box.error > .ic { color: var(--bad); }
.state-box.loading { border-style: solid; border-color: transparent; background: none; }
.state-title { font-family: var(--serif-en); font-size: 24px; font-weight: 600; line-height: 1.3; margin: 4px 0 0; color: var(--ink); }
html[data-lang="zh"] .state-title { font-family: var(--serif-zh); font-size: 21px; }
.state-box p { margin: 0; max-width: 34em; }
.state-box .btn { margin-top: 8px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2); }
.notice > .ic { margin-top: 3px; }
.notice p { margin: 0; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); color: color-mix(in srgb, var(--warn) 62%, var(--ink)); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.signout-failed { position: fixed; z-index: 80; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); align-items: center; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); }
.signout-failed p { flex: 1; }
.fineprint { font-size: 13px; line-height: 1.6; color: var(--muted); }

/* A book */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.book-hero { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
.book-title { font-family: var(--serif-en); font-weight: 600; font-size: clamp(32px, 4.2vw, 50px); line-height: 1.1; letter-spacing: -0.012em; margin: 4px 0 10px; overflow-wrap: anywhere; text-wrap: balance; }
.book-title[lang="zh-Hans"] { font-family: var(--serif-zh); font-weight: 700; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.28; letter-spacing: 0.01em; }
.book-author { font-size: 17px; color: var(--ink-2); margin: 0; overflow-wrap: anywhere; }
.book-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; }
.book-syn { margin: 22px 0 0; max-width: 40em; font-size: 17px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.book-syn p { margin: 0 0 0.8em; }
.book-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.book-hero .notice { margin-top: 20px; max-width: 40em; }
.toc { margin-top: 64px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 15px 10px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background 0.15s; }
.toc a:hover { background: var(--card); }
.toc .n { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.toc .t { font-family: var(--serif-en); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc[data-book-lang="zh"] .t { font-family: var(--serif-zh); font-size: 16px; }
.toc .w { color: var(--muted); font-size: 13px; white-space: nowrap; }
.toc li.last-read a { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }

/* The reader */
html[data-reader="sepia"]:not([data-theme="dark"]) { --paper: #f4e9d5; --paper-2: #ecdfc6; --card: #faf2e2; --ink: #3a2e22; --ink-2: #5b4936; --muted: #8a765d; --line: #e3d3b6; --line-2: #d4bf9c; }
.reader-body { background: var(--paper); }
.rbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.rbar .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.rbar-back { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 42%; font-size: 14.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.rbar-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbar-back:hover { color: var(--ink); }
.rbar-mid { flex: 1; min-width: 0; text-align: center; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbar-tools { display: flex; gap: 6px; margin-left: auto; }
.rprogress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); }
.rprefs { position: absolute; right: max(16px, calc((100% - var(--wrap)) / 2)); top: 64px; width: min(300px, calc(100% - 32px)); padding: 16px; display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.rprefs .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.seg-s { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.seg-s button { min-width: 36px; height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg-s button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.seg-s button:disabled { opacity: 0.4; cursor: default; }
.reader { --rs: 19px; font-size: var(--rs); width: min(35em, 100% - 40px); margin: 0 auto; padding: 60px 0 32px; }
.reader[data-book-lang="zh"] { width: min(33em, 100% - 40px); }
.ch-kicker { font: 700 12.5px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0; }
html[data-lang="zh"] .ch-kicker { letter-spacing: 0.14em; }
.ch-title { font-family: var(--serif-en); font-size: 1.7em; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; margin: 12px 0 1.6em; overflow-wrap: anywhere; text-wrap: balance; }
.reader[data-book-lang="zh"] .ch-title { font-family: var(--serif-zh); font-weight: 700; letter-spacing: 0.02em; }
.ch-text { font-family: "Literata", var(--serif-en); line-height: 1.85; color: var(--ink); overflow-wrap: break-word; hyphens: auto; font-feature-settings: "kern", "liga", "onum"; }
.reader[data-book-lang="zh"] .ch-text { font-family: var(--serif-zh); line-height: 2; text-align: justify; font-weight: 400; }
.reader.sans .ch-text, .reader.sans .ch-title { font-family: var(--sans) !important; }
.ch-text p { margin: 0 0 1.05em; }
.reader[data-book-lang="zh"] .ch-text p { text-indent: 2em; margin: 0 0 0.85em; }
.ch-text h2, .ch-text h3, .ch-text h4 { font-family: inherit; font-size: 1.15em; font-weight: 600; line-height: 1.45; text-align: center; margin: 2.2em 0 1.1em; }
.ch-text hr { border: 0; margin: 2.2em 0; text-align: center; color: var(--muted); }
.ch-text hr::after { content: "⁂"; font-size: 1.1em; }
.ch-text blockquote { margin: 1.2em 0; padding: 0 0 0 1.1em; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.ch-text blockquote p { text-indent: 0 !important; }
.ch-end { text-align: center; color: var(--muted); font-size: 14px; margin: 3em 0 0; letter-spacing: 0.3em; }
.ch-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 40px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); font-size: 15px; }
.ch-nav .prev { justify-self: start; }
.ch-nav .next { justify-self: end; }
.ch-nav .btn { max-width: 100%; }
.ch-nav .btn > span:not(.arrow) { overflow: hidden; text-overflow: ellipsis; }
.reader-foot { padding-top: 40px; }

/* Billing history, and the plan cards */
.member-wrap { display: grid; gap: 30px; max-width: 920px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 22px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.plan.best { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.plan-name { font-weight: 700; font-size: 17px; padding-right: 76px; }
.plan-price { font-family: var(--serif-en); font-size: 42px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.plan-price small { font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; }
.plan li .ic { color: var(--ok); margin-top: 4px; }
.plan .btn { margin-top: auto; }
/* The action row sits at the card's foot, so buttons line up across cards whatever wraps above. */
.plan .plan-act { margin-top: auto; padding-top: 18px; }
.plan .test-badge { position: absolute; top: 20px; right: 20px; }
.sub-card { display: grid; gap: 10px; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.sub-card.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 10%, transparent); }
.sub-status { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; margin: 0; }
.sub-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sub-card.ok .sub-status .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.sub-card p { margin: 0; color: var(--ink-2); }
.sub-card .cta { margin-top: 6px; }

/* AI writing plans (/pricing) */
.pricing-wrap { max-width: 1040px; }
.plans-wrap { display: grid; gap: 16px; }
.plans-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.plan-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.plan.current { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.plans-wrap > .fineprint { margin: 0; }
.stat .stat-sub { font-size: 12.5px; color: var(--muted); }
.wb-panel { gap: 18px; }
.wb-plan { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }
.wb-plan p { margin: 0; color: var(--ink-2); }
.wb-plan .wb-plan-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink); }
.wb-plan .cta { margin-top: 4px; }
.wb-history { border-top: 1px solid var(--line); }
.wb-history .sl-meta { overflow-wrap: anywhere; }
.wb-amount { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.wb-amount.plus { color: var(--ok); }
.topup { gap: 14px; }
.topup-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.topup-intro p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.topup-form { display: grid; gap: 12px; }
.topup-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.topup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topup-cur { font-weight: 650; color: var(--ink-2); }
.topup-row input { width: 160px; max-width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: inherit; font-size: 17px; font-variant-numeric: tabular-nums; }
.topup-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.topup-row input:disabled { opacity: 0.6; }
.topup-preview { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.topup-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.topup-err { margin: 0; }
.topup .cta { margin: 0; }
.topup-foot { display: grid; gap: 4px; }
.topup-foot .fineprint { margin: 0; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.faq.left { margin: 0; max-width: none; }

/* A footer with a Writing column as well (the welcome and pricing pages). */
.foot-main.foot-4 { grid-template-columns: minmax(0, 1.5fr) auto auto auto; gap: 26px 56px; }
@media (max-width: 760px) {
  .foot-main.foot-4 { grid-template-columns: 1fr 1fr; }
}

/* Paddle payment links (/pay) */
.pay-wrap { --wrap: 680px; display: grid; gap: 18px; }
.pay-card { position: relative; overflow: hidden; display: grid; gap: 22px; padding: 34px 32px 30px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pay-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--c1), var(--accent), var(--c2), var(--c3)); }
.pay-mark { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.pay-head .kicker { margin-bottom: 6px; }
.pay-head .page-title { margin: 0 0 12px; }
.pay-head .page-lede { font-size: 16px; }
.pay-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.pay-status p { flex: 1; min-width: 0; margin: 0; }
.pay-status .spinner { flex: none; width: 20px; height: 20px; border-width: 2.5px; }
.pay-status > .ic { flex: none; }
.pay-status .btn { flex: none; }
.pay-status[data-state="ready"], .pay-status[data-state="done"] { background: var(--ok-soft); border-color: transparent; color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.pay-status[data-state="error"] { background: var(--bad-soft); border-color: transparent; color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.pay-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.pay-points li { display: flex; gap: 10px; }
.pay-points .ic { flex: none; margin-top: 4px; color: var(--accent-ink); }
.pay-help { margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.pay-card a:not(.btn), .pay-fine a { color: var(--accent-ink); text-underline-offset: 2px; }
.pay-fine { margin: 0; text-align: center; }
@media (max-width: 520px) {
  .pay-card { padding: 28px 20px 22px; gap: 18px; }
  .pay-status { flex-wrap: wrap; }
  .pay-card .cta .btn { flex: 1 1 100%; }
}

/* Legal pages */
.legal { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; align-items: start; }
.legal-toc { position: sticky; top: 92px; display: grid; gap: 4px; font-size: 14px; }
.legal-toc b { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.legal-toc a { text-decoration: none; color: var(--ink-2); padding: 3px 0; }
.legal-toc a:hover, .legal-toc a[aria-current="page"] { color: var(--accent-ink); }
.legal-doc { max-width: 44em; font-size: 16.5px; line-height: 1.78; }
.legal-doc h2 { font-family: var(--sans); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; margin: 44px 0 10px; scroll-margin-top: 96px; }
html[data-lang="zh"] .legal-doc h2 { font-family: var(--sans); font-size: 20px; letter-spacing: 0.01em; }
.legal-doc p, .legal-doc li { color: var(--ink-2); }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul { padding-left: 1.3em; margin: 0 0 12px; display: grid; gap: 6px; }
.legal-doc a { color: var(--accent-ink); text-underline-offset: 2px; }
.legal-meta { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.legal-summary { margin: 26px 0 0; padding: 20px 22px 8px; border-radius: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.legal-doc .legal-summary h2 { margin: 0 0 10px; font-size: 17px; }
.legal-summary li { color: var(--ink); }
.legal-contents { margin: 22px 0 0; padding: 16px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 15px; }
.legal-contents b { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
html[data-lang="zh"] .legal-contents b { letter-spacing: 0.02em; }
.legal-contents ol { margin: 0; padding-left: 1.4em; columns: 2 16em; column-gap: 28px; line-height: 1.8; }
.legal-contents li { break-inside: avoid; }
.legal-contents a { text-decoration: none; }
.legal-contents a:hover { text-decoration: underline; }
.legal-doc li > b:first-child, .legal-doc p > b:first-child { color: var(--ink); }
.legal-formula { margin: 4px 0 14px; padding: 12px 16px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.legal-example { margin: 6px 0 12px; padding: 14px 18px 4px; border-radius: 14px; border: 1px dashed var(--line-2); }
.legal-example p { margin: 0 0 6px; }
.legal-doc .fineprint { margin-top: 28px; }
/* Anchors kept so older links still land on the right section */
.legal-doc [id] { scroll-margin-top: 96px; }
.legal-doc span[id]:empty { display: block; }
/* Legal details folded inside a policy section: closed by default, opened by a link to its id */
.legal-details { margin: 4px 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); scroll-margin-top: 96px; }
.legal-details > summary { display: flex; align-items: center; gap: 8px; padding: 12px 18px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--accent-ink); border-radius: 14px; }
.legal-details > summary::-webkit-details-marker { display: none; }
.legal-details > summary::before { content: "+"; width: 1em; text-align: center; font-size: 17px; line-height: 1; }
.legal-details[open] > summary::before { content: "−"; }
.legal-details > dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; padding: 4px 18px 14px; font-size: 15px; line-height: 1.6; }
.legal-details dt { color: var(--muted); }
.legal-details dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.legal-details > p { margin: 0; padding: 0 18px 14px; font-size: 14px; color: var(--muted); }
@media (max-width: 520px) {
  .legal-details > dl { grid-template-columns: 1fr; gap: 2px; }
  .legal-details dd + dt { margin-top: 8px; }
}

/* The publisher's front page */
.home-hero { padding: 56px 0 88px; }
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
.shelf { position: relative; min-height: 380px; display: grid; place-items: center; }
.shelf-books { display: flex; align-items: flex-end; gap: 14px; transform: rotate(-2deg); }
.shelf-books .cover { width: 128px; }
.shelf-books a:nth-child(2) .cover { width: 150px; }
.shelf-books a { transition: transform 0.3s var(--ease); }
.shelf-books a:hover { transform: translateY(-8px); }
.shelf-books a:nth-child(1) { transform: rotate(-3deg) translateY(10px); }
.shelf-books a:nth-child(3) { transform: rotate(3deg) translateY(16px); }
.shelf-plank { position: absolute; left: 6%; right: 6%; bottom: 46px; height: 12px; border-radius: 3px; background: linear-gradient(var(--line-2), var(--line)); box-shadow: 0 10px 24px rgba(40, 30, 18, 0.15); z-index: -1; }
/* With nothing published yet: an open book, blank, rather than made-up titles. */
.open-book { width: min(420px, 100%); aspect-ratio: 1.55; position: relative; display: grid; grid-template-columns: 1fr 1fr; filter: drop-shadow(0 30px 50px rgba(40, 30, 18, 0.18)); transform: rotate(-2deg); }
.open-book i { display: block; background: var(--card) repeating-linear-gradient(to bottom, transparent 0 22px, color-mix(in srgb, var(--line) 80%, transparent) 22px 23px) 0 34px / 100% calc(100% - 64px) no-repeat; border: 1px solid var(--line); }
.open-book i:first-child { border-radius: 14px 2px 2px 14px; transform: skewY(2deg); }
.open-book i:last-child { border-radius: 2px 14px 14px 2px; transform: skewY(-2deg); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px 22px 26px; }
.step-card .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; margin-bottom: 14px; }
.step-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.step-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.plan-strip { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.plan-strip .tag { font-size: 14px; padding: 6px 14px; }

/* Dashboards: a reader's page, an author's page, operations */
.dash-wrap { display: grid; gap: 34px; max-width: 1080px; }
/* #dash is filled by each page's script (reader, author, operations): its sections need the same rhythm. */
.dash-wrap > #dash { display: grid; gap: 34px; align-content: start; min-width: 0; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; }
.dash-head .page-head { margin: 0; }
.dash-head .cta { margin-bottom: 4px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dash-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-col { display: grid; gap: 22px; min-width: 0; }
.panel { display: grid; gap: 16px; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.panel-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.panel-title .ic { color: var(--accent-ink); }
/* Panel titles are h2s: in Chinese, keep them panel-sized over the section-sized `html[data-lang="zh"] h2`. */
html[data-lang="zh"] .panel-title { font-size: 17.5px; line-height: 1.35; letter-spacing: 0.01em; }
.panel > p, .privacy-body > p, .panel-note { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.panel-sub { margin: 8px 0 -6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.panel > .fineprint, .privacy-body > .fineprint { margin: 0; }
.notice ul { margin: 6px 0 0; padding-left: 1.15em; display: grid; gap: 4px; }
.notice > div { min-width: 0; }
.panel .state-box { padding: 30px 18px; border-radius: 16px; }
.panel .state-title { font-size: 19px; }
html[data-lang="zh"] .panel .state-title { font-size: 18px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
/* Where a piece of data lives: only this browser, or the account on the server. */
.scope { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.scope.device { color: color-mix(in srgb, var(--c2) 80%, var(--ink)); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover:not([disabled]) { background: color-mix(in srgb, var(--bad) 86%, #000); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Numbers that exist: projects, words, submissions */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat { display: grid; gap: 2px; padding: 18px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stat b { font-family: var(--serif-en); font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13.5px; color: var(--muted); }

/* Continue reading (this device) */
.resume-list { display: grid; gap: 12px; }
.resume-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.resume-card:hover { border-color: var(--line-2); background: var(--paper); }
.resume-card .cover { padding: 6px 5px; border-radius: 2px 5px 5px 2px; }
.resume-card .cover-title { font-size: 7.5px; -webkit-line-clamp: 4; }
.resume-card .cover-author { display: none; }
.rc-body { display: grid; gap: 2px; min-width: 0; }
.rc-title { font-family: var(--serif-en); font-weight: 600; font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-title[lang="zh-Hans"] { font-family: var(--serif-zh); font-size: 16px; }
.rc-sub { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-meta { font-size: 12.5px; color: var(--muted); }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.resume-card .go { color: var(--muted); }

/* An author's projects and submissions */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.proj-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.proj-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* One manuscript: across the row, words on the left and its actions on the right. */
.proj-grid.solo { grid-template-columns: minmax(0, 1fr); }
.proj-grid.solo .proj-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 36px; padding: 26px 28px; }
.proj-grid.solo .proj-card .btn-row { flex-direction: column; align-items: stretch; margin: 0; padding: 0; }
.proj-title { font-family: var(--serif-en); font-weight: 600; font-size: 21px; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
html[data-lang="zh"] .proj-title { font-family: var(--serif-zh); font-size: 19px; }
.proj-syn { margin: 0; font-size: 14px; line-height: 1.62; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.proj-card .meta-row { margin-top: 0; padding-top: 0; }
.proj-card .btn-row { margin-top: auto; padding-top: 6px; }
.review-note { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line-2); border-radius: 0 10px 10px 0; background: var(--paper); font-size: 14px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.review-note b { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; white-space: normal; }
.review-note.bad { border-left-color: var(--bad); }
.review-note.warn { border-left-color: var(--warn); }
.sub-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.sub-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.sub-list .sl-title { font-weight: 650; overflow-wrap: anywhere; }
.sub-list .sl-meta { font-size: 13px; color: var(--muted); }
.sub-list .meta-row { padding-top: 6px; justify-content: flex-end; }
.sub-list .review-note { grid-column: 1 / -1; }
.sub-list.panel { gap: 0; padding: 4px 22px; }
.sub-list.panel > li:last-child { border-bottom: 0; }

/* The author page: counts with a quiet note, then small cards in one row, then privacy folded away */
.dash-overview { display: grid; gap: 12px; }
.dash-note { margin: 0; max-width: 62em; font-size: 14px; line-height: 1.6; color: var(--muted); }
/* Two or three small cards: one even row on a wide screen; two columns below 1020px, with a third
   (the admin shortcuts, which come first) across the top; one column on a phone. Never 2 + 1. */
.dash-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 18px; align-items: stretch; }
.dash-tiles > .panel { display: flex; flex-direction: column; gap: 14px; }
.dash-tiles > .panel > .btn-row:last-child { margin-top: auto; }
.more-info { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.more-info > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-weight: 600; color: var(--accent-ink); }
.more-info > summary::-webkit-details-marker { display: none; }
.more-info > summary::before { content: "+"; width: 1em; text-align: center; font-size: 16px; line-height: 1; }
.more-info[open] > summary::before { content: "−"; }
.more-info > p { margin: 8px 0 0; max-width: 46em; line-height: 1.65; }
.privacy-fold { border-radius: 22px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.privacy-fold > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 2px 12px; padding: 20px 24px; cursor: pointer; list-style: none; border-radius: 22px; }
.privacy-fold > summary::-webkit-details-marker { display: none; }
.privacy-fold > summary > .ic { grid-row: 1; color: var(--accent-ink); }
.privacy-fold > summary::after { content: "+"; grid-column: 4; grid-row: 1 / span 2; font-size: 22px; line-height: 1; color: var(--muted); transition: transform 0.25s var(--ease); }
.privacy-fold[open] > summary::after { transform: rotate(45deg); }
.pf-title { grid-column: 2; }
.pf-sub { grid-column: 2; font-size: 14px; color: var(--muted); }
.privacy-fold > summary > .tag { grid-column: 3; grid-row: 1 / span 2; }
.privacy-body { display: grid; gap: 16px; margin: 0 24px; padding: 20px 0 24px; border-top: 1px solid var(--line); }
/* The summary above already names the panel. */
.privacy-body > .panel-head { display: none; }

/* Forms */
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.field small { font-weight: 400; color: var(--muted); }
.input, .textarea, .select, .ask-input {
  width: 100%; min-width: 0; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper);
  font: 15px/1.5 var(--sans); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus, .ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: border-color 0.15s, background 0.15s; }
.choice input { grid-row: span 2; margin: 4px 0 0; accent-color: var(--accent); }
.choice b { color: var(--ink); font-weight: 650; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.form-msg { margin: 0; font-size: 14px; min-height: 1.4em; }
.form-msg.bad { color: var(--bad); }
.form-msg.ok { color: var(--ok); }

/* Privacy requests */
.req-list { display: grid; gap: 12px; }
.req-card { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); min-width: 0; }
.req-card.open { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.req-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.req-head b { font-weight: 650; }
.req-head .when { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.req-who { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.req-detail { margin: 0; font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.req-actions { display: grid; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.filter { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.filter button { height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* Backups and isolated recovery */
.run-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.run-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--paper); font-size: 14px; color: var(--ink-2); }
.run-list code, .mono { font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.meter { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.meter .bar { height: 6px; margin: 0; }
.meter .bar.busy > i { width: 35% !important; animation: meter-slide 1.2s ease-in-out infinite; }
@keyframes meter-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.result-box { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.result-box pre { margin: 0; max-height: 220px; overflow: auto; font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* A confirmation */
dialog.ask { width: min(480px, calc(100vw - 32px)); padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.ask::backdrop { background: rgba(20, 15, 10, 0.45); backdrop-filter: blur(2px); }
.ask-title { font-family: var(--serif-en); font-size: 22px; font-weight: 600; line-height: 1.3; margin: 0 0 12px; }
html[data-lang="zh"] .ask-title { font-family: var(--serif-zh); font-size: 20px; }
dialog.ask p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
dialog.ask ul { margin: 0 0 10px; padding-left: 1.2em; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 4px; }
.ask-label { display: grid; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ask-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Footer */
.site-foot { padding-top: 40px; }
.site-foot .wrap { display: block; }
.foot-main { display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto; gap: 26px 64px; padding-bottom: 26px; }
.foot-brand b { color: var(--ink); font-size: 15px; }
.foot-brand p { margin: 6px 0 0; max-width: 34em; line-height: 1.6; }
.foot-links { display: flex; flex-direction: column; gap: 7px; }
.foot-links b { color: var(--ink-2); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.foot-links a { text-decoration: none; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }

@media (max-width: 1020px) {
  .home-hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .shelf { min-height: 300px; }
  .steps { grid-template-columns: 1fr; max-width: 560px; }
  .legal { grid-template-columns: 1fr; gap: 20px; }
  .legal-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .legal-toc b { width: 100%; margin: 0; }
  .dash-grid, .dash-grid.even { grid-template-columns: 1fr; }
  .dash-tiles { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-tiles > :first-child:nth-last-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .form-row { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-grid.solo .proj-card { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .proj-grid.solo .proj-card .btn-row { flex-direction: row; align-items: center; }
  .book-hero { grid-template-columns: 1fr; gap: 26px; }
  .book-hero .cover.large { width: 150px; }
  .foot-main { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* The reading links stay on a phone, on a row of their own. */
  .nav .wrap { flex-wrap: wrap; height: auto; min-height: 58px; padding: 8px 0; row-gap: 2px; }
  .nav .site-links { display: flex; order: 3; width: 100%; margin: 0; gap: 20px; font-size: 14.5px; }
  .nav .brand { font-size: 16px; }
  .nav-right .btn.small { padding: 0 12px; }
  .nav-right { gap: 6px; }
  .page { padding: 32px 0 80px; }
  .panel { padding: 18px 16px; border-radius: 18px; }
  .dash-wrap > #dash { gap: 26px; }
  .dash-tiles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sub-list.panel { padding: 2px 16px; }
  .privacy-fold { border-radius: 18px; }
  .privacy-fold > summary { padding: 16px; border-radius: 18px; }
  .privacy-fold > summary > .tag { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 4px; }
  .privacy-body { margin: 0 16px; padding: 18px 0 20px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 26px; }
  .resume-card { grid-template-columns: 44px minmax(0, 1fr); }
  .resume-card .go { display: none; }
  .sub-list > li { grid-template-columns: 1fr; }
  .sub-list .meta-row { justify-content: flex-start; }
  .req-head .when { margin-left: 0; width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .dash-head .cta { width: 100%; }
  .book-grid { grid-template-columns: 1fr; gap: 14px; }
  .book-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 16px; }
  .bc-title { font-size: 18px; }
  .toc a { grid-template-columns: 2.4em minmax(0, 1fr) auto; padding: 14px 4px; gap: 10px; }
  .toc .w { display: none; }
  .rbar-mid { display: none; }
  .rbar-back { max-width: none; flex: 1; }
  .reader { padding-top: 36px; width: calc(100% - 36px); }
  .reader[data-book-lang="zh"] { width: calc(100% - 36px); }
  .ch-nav { grid-template-columns: 1fr 1fr; }
  .ch-nav .toc-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .plan-price { font-size: 36px; }
  .shelf-books .cover { width: 96px; }
  .shelf-books a:nth-child(2) .cover { width: 112px; }
  .shelf { min-height: 240px; }
  .shelf-plank { bottom: 30px; }
}
@media print {
  .nav, .rbar, .sandbox-bar, .site-foot, .ch-nav, .rprefs { display: none !important; }
}

/* A reader's page (/dashboard): continue reading across the top, then even cards, then privacy folded */
[data-page="dashboard"] .dash-resume { gap: 14px; }
[data-page="dashboard"] .dash-resume .resume-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
[data-page="dashboard"] .dash-resume .more-info { margin-top: 0; }
[data-page="dashboard"] .dash-resume-foot { justify-content: space-between; }
[data-page="dashboard"] .dash-resume-foot > .btn.small { margin-left: auto; }
[data-page="dashboard"] .dash-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
[data-page="dashboard"] .dash-empty > .ic { flex: none; color: var(--muted); }
[data-page="dashboard"] .dash-empty > p { flex: 1 1 16em; min-width: 0; margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
[data-page="dashboard"] .dash-empty > p > b { display: block; font-weight: 650; color: var(--ink); }
/* The small cards: header, content that grows, then one footer row of actions at the bottom. Cards in
   a row stretch to the tallest, so every footer, and the first action in it, sits on the same line. */
[data-page="dashboard"] .dash-tiles > .dash-card { display: flex; flex-direction: column; gap: 0; }
[data-page="dashboard"] .dash-card > .panel-head { min-height: 30px; margin-bottom: 14px; }
[data-page="dashboard"] .dash-card-body { flex: 1 1 auto; display: grid; gap: 10px; align-content: start; min-width: 0; }
[data-page="dashboard"] .dash-card-body > p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
[data-page="dashboard"] .dash-card-body > .fineprint { font-size: 13px; color: var(--muted); }
[data-page="dashboard"] .dash-card-body > .form-msg { min-height: 0; line-height: 1.55; }
[data-page="dashboard"] .dash-card-body > .form-msg.bad { color: var(--bad); }
[data-page="dashboard"] .dash-card-body > .form-msg.ok { color: var(--ok); }
/* Over the shared `.dash-tiles > .panel > .btn-row:last-child { margin-top: auto }`: the body grows instead. */
[data-page="dashboard"] .dash-tiles > .dash-card > .dash-card-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); gap: 10px; }
[data-page="dashboard"] .dash-card-foot > .btn { height: 36px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
[data-page="dashboard"] .dash-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  [data-page="dashboard"] .dash-empty { padding: 14px; }
  [data-page="dashboard"] .dash-empty > .btn { width: 100%; justify-content: center; }
  [data-page="dashboard"] .dash-resume-foot > .btn.small { margin-left: 0; }
}
