:root {
  /* wha1e.asia · 纸白 / 墨 / 红编号 / 橙状态 */
  --bg: #fbfbf9;
  --paper: #fbfbf9;
  --ink: #0c0c0c;
  --muted: #6f6b64;
  --coral: #e4261a;
  --orange: #ff5c1b;
  --sage: #dfdcd5;
  --line: rgba(12, 12, 12, 0.14);
  --hair: #dfdcd5;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-loading { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.055; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.rule-top {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none;
  background: linear-gradient(90deg, var(--ink) 0 38%, var(--coral) 38% 72%, var(--orange) 72% 100%);
}
.topbar {
  position: fixed; z-index: 20; top: 3px; left: 0; right: 0; display: flex; align-items: baseline; justify-content: space-between;
  padding: 23px 4.4vw 0; pointer-events: none;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand b { font-size: 21px; font-weight: 600; letter-spacing: 0.12em; }
.brand b em { font-style: normal; color: var(--coral); text-shadow: 3px 2px 0 var(--orange); }
.brand span { font-size: 9px; letter-spacing: 0.32em; color: var(--coral); }
.brand .free { color: var(--muted); letter-spacing: 0.14em; margin-left: 4px; }
.brand .free b { font-weight: 600; color: var(--ink); font-size: 9px; letter-spacing: 0.06em; }
.top-right { font-size: 9px; letter-spacing: 0.26em; color: var(--muted); }
.top-right a { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.top-right a:hover { color: var(--coral); border-color: var(--coral); }

.hero {
  position: relative; z-index: 5; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 0 7vw; pointer-events: none; max-width: 760px;
}
.eyebrow { margin: 0 0 24px; font-size: 10px; letter-spacing: 0.28em; color: var(--coral); font-weight: 500; }
.hero h1 {
  margin: 0; font-size: clamp(48px, 6.4vw, 94px); line-height: 1.02; font-weight: 500; letter-spacing: -0.03em;
}
.hero h1 em { font-style: normal; color: var(--coral); }
.lede { margin: 30px 0 0; font-size: 15px; line-height: 1.9; color: var(--muted); letter-spacing: 0.02em; }
.cta {
  pointer-events: auto; align-self: flex-start; margin-top: 38px; display: inline-flex; align-items: center; gap: 18px;
  padding: 15px 26px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: 0.14em;
  transition: background 0.3s ease, transform 0.3s ease;
}
.cta span { color: var(--coral); font-size: 14px; }
.cta:hover { background: var(--coral); transform: translateY(-2px); }
.cta:hover span { color: var(--paper); }

.story { position: relative; z-index: 4; height: 460vh; }
.story-stage { position: sticky; top: 0; height: 100svh; pointer-events: none; overflow: hidden; }
.captions { position: absolute; left: 7vw; top: 16vh; width: min(320px, 32vw); }
.caption { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; will-change: opacity, transform; }
.caption .rule { width: 36px; height: 2px; background: var(--coral); margin-bottom: 18px; }
.caption .cap-eyebrow { margin: 0 0 12px; font-size: 9.5px; letter-spacing: 0.24em; color: var(--coral); text-transform: uppercase; }
.caption h2 { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.18; font-weight: 500; letter-spacing: -0.02em; }
.caption p { margin: 14px 0 0; font-size: 13px; line-height: 1.9; color: var(--muted); max-width: 250px; }
.caption .cap-meta { margin-top: 14px; font-size: 9px; letter-spacing: 0.2em; color: rgba(43, 39, 35, 0.42); }

.meter { position: absolute; right: 4.4vw; bottom: 4.6vh; display: flex; align-items: center; gap: 12px; font-size: 9px; letter-spacing: 0.22em; color: var(--muted); }
.meter-track { width: 130px; height: 1px; background: var(--line); overflow: hidden; }
.meter-track i { display: block; width: 0%; height: 100%; background: var(--coral); }
.meter b { font-weight: 400; font-variant-numeric: tabular-nums; font-size: 10px; color: var(--ink); width: 18px; }

.outro {
  position: relative; z-index: 10; background: var(--paper); padding: 16vh 7vw 12vh;
}
.outro h2 { margin: 0 0 26px; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.18; font-weight: 500; letter-spacing: -0.02em; }
.outro p { max-width: 560px; font-size: 14px; line-height: 2; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 48px; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.swatches span { display: inline-flex; align-items: center; gap: 9px; }
.swatches i { display: block; width: 14px; height: 14px; border-radius: 50%; }

.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.7s ease;
}
.loader.done { opacity: 0; pointer-events: none; }
.loader-mark { font-size: 38px; font-weight: 600; letter-spacing: 0.36em; padding-left: 0.36em; }
.loader p { margin: 0; font-size: 9.5px; letter-spacing: 0.22em; color: var(--muted); }
.loader-line { width: 150px; height: 1px; background: var(--line); overflow: hidden; }
.loader-line i { display: block; width: 40%; height: 100%; background: var(--coral); animation: load 1.3s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

@media (max-width: 900px) {
  .topbar { padding: 18px 20px; }
  .top-right { display: none; }
  .hero { padding: 12vh 24px 0; justify-content: flex-start; max-width: 100%; }
  .hero h1 { font-size: clamp(44px, 12.6vw, 62px); }
  .lede { margin-top: 20px; font-size: 13px; }
  .cta { margin-top: 24px; padding: 13px 20px; font-size: 11px; }
  .hero > .cta { position: absolute; left: 24px; right: 24px; bottom: 5vh; width: auto; justify-content: center; margin: 0; }
  .story { height: 430vh; }
  .captions { left: 20px; right: 20px; top: auto; bottom: 4.5vh; width: auto; }
  .caption {
    top: auto;
    bottom: 0;
    padding: 15px 17px 14px;
    background: rgba(251, 251, 249, 0.95);
    box-shadow: 0 14px 34px rgba(70, 45, 25, 0.16);
    border-radius: 2px;
  }
  .caption .rule { width: 26px; margin-bottom: 10px; }
  .caption .cap-eyebrow { margin-bottom: 7px; font-size: 8.5px; }
  .caption h2 { font-size: 22px; }
  .caption p { font-size: 11.5px; line-height: 1.7; max-width: 100%; margin-top: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .caption .cap-meta { display: none; }
  .meter { right: 20px; top: 84px; bottom: auto; }
  .meter-track { width: 70px; }
  .meter-label { display: none; }
  .outro { padding: 12vh 24px 10vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body.clean .topbar, body.clean .hero, body.clean .story, body.clean .outro, body.clean .grain { display: none !important; }
body.clean { overflow: hidden; }

/* ------------------------------------------------------------ 顶部编辑入口 */
.top-actions { display: flex; align-items: center; gap: 22px; pointer-events: auto; }
.edit-btn {
  pointer-events: auto; font-size: 9.5px; letter-spacing: 0.16em; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; transition: 0.25s;
}
.edit-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ------------------------------------------------------------ 结尾：四段记忆 */
.outro {
  padding: 15vh 7vw 12vh;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -30px 70px rgba(60, 40, 20, 0.12);
}
.outro-head { max-width: 860px; }
.outro h2 { margin: 0 0 24px; }
.outro-lede { max-width: 560px; font-size: 14px; line-height: 2; color: var(--muted); }
.memory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; margin-top: 7vh; }
.mem-item { display: grid; grid-template-columns: 116px 1fr; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); align-items: start; }
.mem-photo { aspect-ratio: 9 / 10; overflow: hidden; background: #efe4d2; }
.mem-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem-date { font-size: 9px; letter-spacing: 0.16em; color: var(--coral); }
.mem-copy h3 { margin: 8px 0 7px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.mem-copy p { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--muted); }
.outro-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6vh; }
.outro-actions .cta { margin: 0; }
.outro-note { margin: 24px 0 0; font-size: 10px; letter-spacing: 0.06em; color: rgba(43, 39, 35, 0.4); }

.ghost {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 11px; letter-spacing: 0.12em; color: var(--ink); transition: 0.25s;
}
.ghost:hover { border-color: var(--coral); color: var(--coral); }

/* ------------------------------------------------------------ 字幕正文 */
.caption .cap-body { margin: 14px 0 0; font-size: 13px; line-height: 1.9; color: var(--muted); max-width: 250px; }
.caption .memlist { display: flex; flex-direction: column; gap: 7px; }
.caption .memrow { display: grid; grid-template-columns: 18px 72px 1fr; gap: 6px; align-items: baseline; white-space: nowrap; }
.caption .memrow i { font-style: normal; font-size: 9px; color: rgba(43, 39, 35, 0.32); }
.caption .memrow b { font-weight: 400; font-size: 9.5px; letter-spacing: 0.02em; color: var(--coral); }
.caption .memrow em { font-style: normal; font-size: 10.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.caption.list .cap-body { max-width: 290px; }

/* ------------------------------------------------------------ 编辑器 */
.editor { position: fixed; inset: 0; z-index: 70; visibility: hidden; pointer-events: none; }
.editor.open { visibility: visible; pointer-events: auto; }
.editor-scrim {
  position: absolute; inset: 0; background: rgba(35, 25, 18, 0.42); opacity: 0;
  transition: opacity 0.35s ease; backdrop-filter: blur(2px);
}
.editor.open .editor-scrim { opacity: 1; }
.editor-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(480px, 100%);
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -30px 0 80px rgba(50, 30, 15, 0.2);
}
.editor.open .editor-panel { transform: none; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 28px 18px; border-bottom: 1px solid var(--line); }
.editor-head h2 { margin: 6px 0 0; font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.editor-close { font-size: 28px; line-height: 1; color: var(--muted); padding: 0 4px; }
.editor-close:hover { color: var(--coral); }
.editor-scroll { flex: 1; overflow-y: auto; padding: 22px 28px 30px; }
.cover-preview { display: flex; gap: 16px; align-items: center; padding: 14px; background: #f3f1ec; margin-bottom: 22px; }
.cover-preview canvas { width: 104px; height: auto; box-shadow: 0 12px 24px rgba(80, 45, 25, 0.22); }
.cover-preview b { display: block; font-size: 12px; letter-spacing: 0.1em; margin-bottom: 6px; }
.cover-preview span { font-size: 11px; color: var(--muted); line-height: 1.6; }
.fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields label, .field { display: block; font-size: 9.5px; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 14px; position: relative; }
.fields input, .field input, .field textarea {
  display: block; width: 100%; margin-top: 7px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; font-family: var(--sans); font-size: 15px; color: var(--ink); border-radius: 0;
}
.field textarea { resize: vertical; min-height: 74px; line-height: 1.7; }
.fields input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--coral); }
.field .count { position: absolute; right: 0; bottom: 8px; font-size: 9px; color: var(--muted); letter-spacing: 0.06em; }
.editor-sub { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; font-size: 11px; letter-spacing: 0.12em; }
.editor-sub b { font-weight: 400; font-size: 9px; color: var(--coral); letter-spacing: 0.1em; }
.mem-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.mem-card:first-child { border-top: 0; }
.photo-slot { position: relative; display: block; aspect-ratio: 9 / 10; background: #f3f1ec; overflow: hidden; cursor: pointer; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot .ph { position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 6px; background: rgba(43, 39, 35, 0.72); color: var(--paper); font-size: 9px; letter-spacing: 0.08em; text-align: center; }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mem-fields .fields.two { gap: 10px; }
.mem-fields label { margin-bottom: 10px; }
.mem-fields input { font-size: 13px; padding: 6px 0; }
.editor-note { font-size: 10px; line-height: 1.8; color: var(--muted); margin: 14px 0 0; }
.editor-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 28px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.editor-foot .cta { margin: 0; padding: 13px 22px; }
body.editor-open { overflow: hidden; }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 4vh; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); font-size: 11px; letter-spacing: 0.1em;
  padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .top-actions { gap: 0; }
  .edit-btn { font-size: 9px; padding: 7px 11px; }
  .outro { padding: 10vh 24px 9vh; border-radius: 20px 20px 0 0; }
  .outro h2 { font-size: 34px; }
  .memory-grid { grid-template-columns: 1fr; gap: 0; margin-top: 5vh; }
  .mem-item { grid-template-columns: 88px 1fr; gap: 14px; padding: 20px 0; }
  .mem-copy h3 { font-size: 19px; }
  .outro-actions { margin-top: 4vh; }
  .outro-actions .cta, .outro-actions .ghost { flex: 1 1 auto; justify-content: center; }
  .editor-head { padding: 18px 20px 14px; }
  .editor-head h2 { font-size: 22px; }
  .editor-scroll { padding: 18px 20px 24px; }
  .editor-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .mem-card { grid-template-columns: 84px 1fr; gap: 12px; }
  .caption .cap-body { font-size: 11.5px; line-height: 1.7; max-width: 100%; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .caption.list .cap-body { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .caption .memrow { grid-template-columns: 15px 62px 1fr; gap: 5px; }
  .caption .memrow b { font-size: 9px; }
  .caption .memrow em { font-size: 10px; }
}
.editor:not(.open) .cover-preview canvas { display: none; }

/* ------------------------------------------------------------ 无限循环模式 */
.loop-ui { display: none; }
.loop-bar { background: var(--paper); border-top: 1px solid var(--ink); }
.loop-beat .cap-eyebrow { color: var(--coral); }
.loop-tab.current { border-color: var(--coral); background: var(--coral); }
.loop-tab.current b { color: rgba(251,251,249,.62); }
.loop-tab.current em { color: var(--paper); }
.pg-btn:hover { border-color: var(--coral); color: var(--coral); }
.toc-item.current { background: var(--ink); }
.toc-item.current u { color: var(--orange); }
.eyebrow { color: var(--coral); }
#loopNames { font-family: var(--sans); }
body.loop { overflow-x: hidden; }
.infinite-track { position: relative; width: 100%; }
.cycle { height: 240vh; }
.scroll-hint {
  position: fixed; z-index: 16; left: 50%; bottom: 146px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.18em; color: var(--muted); pointer-events: none;
  transition: opacity 0.35s ease;
}
.scroll-hint span { color: var(--coral); margin-left: 6px; }
.scroll-hint.hide { opacity: 0; }
body.loop .loop-ui { display: block; }
body.loop .hero, body.loop .story, body.loop .outro { display: none; }
body.clean .loop-ui, body.clean .infinite-track, body.clean .scroll-hint { display: none !important; }

.loop-top { position: fixed; z-index: 15; left: 7vw; top: 15vh; pointer-events: none; }
.loop-top h1 { margin: 10px 0 4px; font-size: clamp(24px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.02em; }
.loop-sub { margin: 0; font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }

.loop-bar {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 3vw; align-items: center;
  padding: 20px 4.4vw 26px; background: rgba(251, 251, 249, 0.92);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.loop-beat .cap-eyebrow { margin: 0 0 6px; }
.loop-beat h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.loop-beat p:last-child { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; max-width: 420px; }
.loop-tabs { display: flex; gap: 8px; }
.loop-tab {
  display: flex; flex-direction: column; gap: 3px; min-width: 76px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 2px; text-align: left; transition: 0.25s;
}
.loop-tab b { font-size: 9px; letter-spacing: 0.1em; color: var(--coral); font-weight: 400; }
.loop-tab em { font-style: normal; font-size: 11px; color: var(--ink); white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.loop-tab:hover { border-color: var(--coral); }
.loop-tab.current { border-color: var(--ink); background: var(--ink); }
.loop-tab.current b { color: rgba(251, 244, 230, 0.6); }
.loop-tab.current em { color: var(--paper); }
.loop-actions { display: flex; gap: 8px; }
.loop-actions .ghost { padding: 9px 14px; font-size: 10px; }
.loop-progress { position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--line); }
.loop-progress i { display: block; width: 0%; height: 100%; background: var(--coral); }

@media (max-width: 900px) {
  .loop-top { left: 24px; top: 9vh; }
  .loop-top h1 { font-size: 24px; }
  .loop-sub { font-size: 9px; }
  .loop-bar { display: block; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
  .scroll-hint { bottom: 196px; }
  .loop-beat h2 { font-size: 18px; }
  .loop-beat p:last-child { font-size: 10.5px; margin-top: 4px; }
  .loop-tabs { margin-top: 10px; gap: 6px; }
  .loop-tab { flex: 1; min-width: 0; padding: 6px 7px; }
  .loop-tab em { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .loop-actions { margin-top: 8px; justify-content: flex-end; }
  .loop-actions .ghost { padding: 8px 12px; }
}

/* ---------------------------------------------------------------- 30 页导航 */
.pg-btn {
  width: 34px; height: 38px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font: 400 16px var(--sans); cursor: pointer; border-radius: 2px;
}
.pg-btn:hover { border-color: var(--coral); color: var(--coral); }
.pg-num {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 0 8px;
  font: 400 10px var(--sans); color: var(--muted); letter-spacing: 0.08em;
}
.pg-num b { font: 400 20px var(--serif); color: var(--ink); letter-spacing: 0.02em; }
.pg-num i { font-style: normal; }
.toc-btn { padding: 6px 12px; }
.toc-btn b { font-size: 11px; letter-spacing: 0.08em; }
.toc-btn em { font-size: 9px; }
.loop-toc {
  position: fixed; right: 24px; bottom: 150px; z-index: 60;
  width: min(420px, calc(100vw - 32px)); max-height: min(62vh, 620px);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(43, 39, 35, 0.18);
  transform: translateY(12px); opacity: 0; pointer-events: none; transition: 0.22s ease;
  display: flex; flex-direction: column;
}
.loop-toc.open { opacity: 1; transform: none; pointer-events: auto; }
.loop-toc header {
  display: flex; align-items: baseline; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.loop-toc header b { font: 400 18px var(--serif); }
.loop-toc header span { font: 400 9px var(--sans); color: var(--muted); letter-spacing: 0.12em; flex: 1; }
.loop-toc header button { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.toc-list { overflow-y: auto; padding: 6px 0; }
.toc-item {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  width: 100%; padding: 10px 18px; border: 0; background: none; text-align: left; cursor: pointer;
}
.toc-item:hover { background: rgba(232, 115, 90, 0.06); }
.toc-item.current { background: var(--ink); }
.toc-item i { font: 400 10px var(--sans); color: var(--coral); letter-spacing: 0.08em; }
.toc-item span b { display: block; font: 400 13px var(--serif); color: var(--ink); }
.toc-item span em { display: block; margin-top: 2px; font: 400 9px var(--sans); color: var(--muted); font-style: normal; }
.toc-item u { font: 400 9px var(--sans); color: var(--coral); text-decoration: none; }
.toc-item.current span b, .toc-item.current span em, .toc-item.current u { color: var(--paper); }
.toc-item.current i { color: rgba(251, 244, 230, 0.55); }

/* ---------------------------------------------------------------- 图库 + 页面列表 */
.lib-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px; border-top: 1px solid var(--line); padding-top: 16px; font: 400 11px var(--sans); letter-spacing: 0.12em; }
.lib-head b { font-weight: 400; font-size: 9px; color: var(--coral); letter-spacing: 0.1em; }
.lib-upload { display: block; padding: 14px; border: 1px dashed var(--line); text-align: center; font: 400 11px var(--sans); color: var(--muted); letter-spacing: 0.06em; cursor: pointer; }
.lib-upload:hover { border-color: var(--coral); color: var(--coral); }
.lib-upload input { display: none; }
.lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.lib-item { position: relative; border: 1px solid var(--line); background: var(--cream); }
.lib-thumb { position: relative; aspect-ratio: 1; background: var(--paper); overflow: hidden; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb span { position: absolute; left: 4px; bottom: 4px; padding: 2px 4px; background: rgba(43, 39, 35, 0.6); color: var(--paper); font: 400 8px var(--sans); }
.lib-meta { padding: 5px 6px; }
.lib-meta b { display: block; font: 400 9px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-meta i { display: block; margin-top: 2px; font: 400 8px var(--sans); color: var(--muted); font-style: normal; }
.lib-del { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border: 0; background: rgba(43, 39, 35, 0.7); color: var(--paper); font-size: 12px; line-height: 1; cursor: pointer; }
.page-list { border-top: 1px solid var(--line); }
.page-card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.page-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.page-top > b { font: 400 12px var(--sans); color: var(--coral); letter-spacing: 0.08em; }
.page-top > span { flex: 1; font: 400 9px var(--sans); color: var(--muted); letter-spacing: 0.05em; }
.page-ops { display: flex; gap: 3px; }
.page-ops button { width: 22px; height: 22px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.page-ops button:hover { color: var(--coral); border-color: var(--coral); }
.page-body { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.page-thumb { aspect-ratio: 1; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-fields { display: grid; gap: 6px; }
.page-fields label { display: grid; gap: 3px; font: 400 8px var(--sans); color: var(--muted); letter-spacing: 0.08em; }
.page-fields input, .page-fields select { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 4px 0; font: 400 11px var(--sans); color: var(--ink); }
.page-fields select { cursor: pointer; }
.page-fields .fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.page-fields .fields.two label { display: grid; }
.add-page { width: 100%; margin-top: 12px; padding: 11px; font-size: 10px; letter-spacing: 0.08em; }
@media (max-width: 820px) {
  .loop-toc { right: 12px; left: 12px; width: auto; bottom: 190px; max-height: 54vh; }
  .lib-grid { grid-template-columns: repeat(3, 1fr); }
  .page-body { grid-template-columns: 58px 1fr; gap: 9px; }
}

.end-spacer { height: 100vh; }

/* ---------------------------------------------------------------- 配方式 DIY */
.diy-row { display: flex; gap: 10px; margin-top: 8px; }
.diy-row label { flex: 1; display: grid; gap: 3px; font: 400 8px var(--sans); color: var(--muted); letter-spacing: 0.08em; }
.diy-row select, .diy-row input[type="range"] { width: 100%; }
.diy-row select { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 3px 0; font: 400 10px var(--sans); color: var(--ink); }
.diy-row .range { flex: 2; }
.prop-row { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.prop-row label { display: inline-flex; align-items: center; gap: 4px; font: 400 9px var(--sans); color: var(--muted); }
.prop-row input { accent-color: var(--coral); }

/* ---------------------------------------------------------------- 分享 */
.share-modal { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; padding: 22px; background: rgba(12,12,12,.5); }
.share-modal.open { display: flex; }
.share-card { width: min(440px, 100%); background: var(--paper); border: 1px solid var(--ink); padding: 28px 26px 22px; box-shadow: 0 30px 90px rgba(12,12,12,.28); }
.share-card h3 { margin: 10px 0 6px; font: 500 26px/1.2 var(--sans); letter-spacing: -0.02em; }
.share-card > p { margin: 0 0 14px; font: 400 11px/1.7 var(--sans); color: var(--muted); }
.share-card input { width: 100%; padding: 11px 10px; border: 1px solid var(--line); background: #fff; font: 400 11px var(--sans); color: var(--ink); }
.share-actions { display: flex; gap: 8px; margin-top: 14px; }
.share-actions .cta { flex: 1; justify-content: center; padding: 12px 14px; }
.share-actions .ghost { padding: 12px 14px; }
.share-cta { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: none; align-items: center; gap: 14px; padding: 10px 16px; background: var(--ink); color: var(--paper); font: 400 10px var(--sans); letter-spacing: .08em; box-shadow: 0 10px 30px rgba(12,12,12,.25); }
.share-cta a { color: var(--orange); border-bottom: 1px solid var(--orange); }
body.share #openEditor, body.share #shareBtn, body.share #shareBtnEditor, body.share #editBtn2 { display: none !important; }
body.share .share-cta { display: flex; }
@media (max-width: 820px) {
  .share-card { padding: 22px 18px 18px; }
  .share-card h3 { font-size: 22px; }
  .share-cta { bottom: calc(12px + env(safe-area-inset-bottom)); white-space: nowrap; }
}

/* ---------------------------------------------------------------- 照片选择器 / 标注 */
.photo-field { display: grid; gap: 4px; }
.photo-field > span { font: 400 8px var(--sans); color: var(--muted); letter-spacing: .08em; }
.pf-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px; border: 1px solid var(--line); background: var(--paper); text-align: left; }
.pf-btn:hover { border-color: var(--coral); }
.pf-thumb { width: 42px; height: 42px; flex: 0 0 42px; background: #f3f1ec; overflow: hidden; }
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-text { display: grid; gap: 1px; min-width: 0; }
.pf-text b { font: 400 10px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-text i { font: 400 8px var(--sans); font-style: normal; color: var(--muted); }
.lib-label { width: 100%; border: 0; border-bottom: 1px dashed transparent; background: transparent; padding: 1px 0; font: 400 9px var(--sans); color: var(--ink); }
.lib-label::placeholder { color: var(--muted); }
.lib-label:focus { outline: none; border-bottom-color: var(--coral); }
.photo-picker { position: fixed; inset: 0; z-index: 125; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(12,12,12,.55); }
.photo-picker.on { display: flex; }
.pp-panel { width: min(560px, 100%); max-height: 84vh; overflow: auto; background: var(--paper); border: 1px solid var(--ink); padding: 20px 20px 16px; box-shadow: 0 30px 90px rgba(12,12,12,.3); }
.pp-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.pp-head b { flex: 1; font: 500 18px var(--sans); }
.pp-head button { border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; }
.pp-sub { margin: 10px 0 12px; font: 400 10px var(--sans); color: var(--muted); }
.pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-item { display: grid; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--paper); text-align: left; cursor: pointer; }
.pp-item b { font: 400 9px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-item.on { border-color: var(--coral); outline: 1px solid var(--coral); }
.pp-thumb { aspect-ratio: 1; background: #f3f1ec; overflow: hidden; display: block; }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-up { place-content: center; text-align: center; font-size: 20px; color: var(--coral); border-style: dashed; min-height: 110px; }
.pp-up b { font-size: 9px; color: var(--muted); }
.pp-up input { display: none; }
.pp-none { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); background: none; font: 400 10px var(--sans); cursor: pointer; }
.pp-none:hover { border-color: var(--coral); color: var(--coral); }
@media (max-width: 700px) {
  .photo-picker { align-items: flex-end; padding: 0; }
  .pp-panel { width: 100%; max-height: 88vh; border-left: 0; border-right: 0; border-bottom: 0; padding: 16px 14px calc(14px + env(safe-area-inset-bottom)); }
  .pp-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------- 真脸头像 */
.face-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 18px; }
.face-slot { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 8px; background: var(--paper); }
.face-circle { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; background: var(--ink); border: 1px solid var(--ink); }
.face-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-info { min-width: 0; }
.face-info b { display: block; font: 500 11px var(--sans); }
.face-info span { display: block; font: 400 8px var(--sans); color: var(--muted); margin-top: 2px; }
.face-up { display: inline-block; margin-top: 5px; padding: 4px 7px; border: 1px solid var(--line); font: 400 9px var(--sans); color: var(--coral); cursor: pointer; }
.face-up input { display: none; }
.face-clear { margin-top: 5px; margin-left: 5px; padding: 4px 7px; border: 1px solid var(--line); background: none; font: 400 9px var(--sans); color: var(--muted); cursor: pointer; }
.face-clear:hover { border-color: var(--coral); color: var(--coral); }
@media (max-width: 700px) { .face-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- 一键风格 */
.preset-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 4px 0 8px; }
.preset-chip { padding: 5px 9px; border: 1px solid var(--line); background: var(--paper); font: 400 9px var(--sans); color: var(--ink); cursor: pointer; }
.preset-chip:hover { border-color: var(--coral); color: var(--coral); }
.preset-all { margin-left: auto; padding: 5px 9px; border: 1px solid var(--ink); background: none; font: 400 9px var(--sans); cursor: pointer; }
.preset-all:hover { background: var(--ink); color: var(--paper); }
.adv { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.adv summary { font: 400 9px var(--sans); color: var(--muted); letter-spacing: .06em; cursor: pointer; padding: 4px 0; }
.adv[open] summary { color: var(--coral); }

/* ---------------------------------------------------------------- 照片滤镜 */
.filter-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 10px 0 2px; font: 400 9px var(--sans); color: var(--muted); }
.filter-row span { letter-spacing: .08em; }
.filter-row select { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); padding: 5px 7px; font: 400 10px var(--sans); color: var(--ink); }
.filter-row i { font-style: normal; font-size: 8px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .filter-row i { display: none; } }
