/* OmniWord — 静态站点样式。无外部依赖，字体全部使用系统字体，保证国内访问速度。 */

:root {
  --paper: #F6F3EC;
  --paper-2: #EEE9DE;
  --card: #FCFAF5;
  --ink: #1C1A23;
  --ink-2: #4B4856;
  --ink-3: #8A8693;
  --rule: rgba(28, 26, 35, 0.12);
  --rule-strong: rgba(28, 26, 35, 0.22);
  --accent: #5E3FD3;
  --accent-2: #8B5CF6;
  --accent-soft: rgba(110, 76, 230, 0.12);
  --accent-mark: rgba(139, 92, 246, 0.22);
  --gold: #D9A441;
  --mint: #0F9B74;
  --muted-curve: #A9A3B4;
  --shadow: 0 1px 2px rgba(28, 26, 35, 0.04), 0 12px 32px -12px rgba(40, 30, 80, 0.18);
  --shadow-lg: 0 2px 4px rgba(28, 26, 35, 0.04), 0 30px 60px -24px rgba(50, 30, 110, 0.32);

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia,
    "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong",
    "Noto Serif CJK SC", "Microsoft YaHei", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-ipa: -apple-system, "Segoe UI", "Lucida Grande", "Arial Unicode MS", Arial, sans-serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F0E13;
    --paper-2: #16151C;
    --card: #1A1921;
    --ink: #EDEBF2;
    --ink-2: #B7B3C2;
    --ink-3: #7F7B8B;
    --rule: rgba(255, 255, 255, 0.09);
    --rule-strong: rgba(255, 255, 255, 0.18);
    --accent: #A78BFA;
    --accent-2: #8B5CF6;
    --accent-soft: rgba(167, 139, 250, 0.14);
    --accent-mark: rgba(139, 92, 246, 0.34);
    --gold: #E8B65A;
    --mint: #34C79A;
    --muted-curve: #5F5B6B;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 30px 60px -24px rgba(0, 0, 0, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 纸张颗粒质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  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.1 0 0 0 0 0.08 0 0 0 0 0.12 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  body::before { opacity: 0.6; mix-blend-mode: screen; filter: invert(1); }
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-mark); }
h1, h2, h3, .closing-text { text-wrap: balance; }
p, li { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 26px; height: 26px; color: var(--ink); }
.brand-dot { fill: var(--gold); }
.brand-word {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-word em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  font-size: 14px;
}
.site-nav a {
  position: relative;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn span { transition: transform 0.25s var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { height: 38px; padding: 0 18px; font-size: 14px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 112px) 0 0;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -10%;
  right: -12%;
  width: 60vw;
  max-width: 760px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
}
.eyebrow-line {
  width: 32px;
  height: 1px;
  background: var(--ink-3);
}

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.22;
  letter-spacing: 0.01em;
}

.ink-mark {
  position: relative;
  white-space: nowrap;
  background: linear-gradient(transparent 62%, var(--accent-mark) 62%, var(--accent-mark) 92%, transparent 92%) no-repeat;
  background-size: 100% 100%;
}
.js .reveal .ink-mark { background-size: 0% 100%; transition: background-size 1.1s 0.6s var(--ease); }
.js .reveal.in .ink-mark { background-size: 100% 100%; }

.hero-lead {
  max-width: 34em;
  margin: 28px 0 0;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--ink-2);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Hero card */

.hero-visual { position: relative; }

.card-stack {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 4 / 4.6;
  perspective: 1600px;
}

.card-ghost,
.word-card {
  position: absolute;
  inset: 0;
  border-radius: 24px;
}
.card-ghost {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.card-ghost-1 { transform: rotate(4deg) translate(14px, 10px); opacity: 0.75; }
.card-ghost-2 { transform: rotate(-5deg) translate(-12px, 16px); opacity: 0.45; }

.word-card {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.word-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease);
}
.word-card.is-flipped .word-card-inner { transform: rotateY(180deg); }

.word-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3.4vw, 36px);
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.word-card-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(120% 80% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--card);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

.card-sentence {
  display: block;
  margin: auto 0;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 29px);
  line-height: 1.5;
  color: var(--ink);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.card-sentence mark,
.card-word {
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.card-sentence mark {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(transparent 68%, var(--accent-mark) 68%);
  padding: 0 2px;
}
.word-card.is-swapping .card-sentence { opacity: 0; transform: translateY(8px); }

.card-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.card-hint svg { width: 16px; height: 16px; }

.card-word {
  display: block;
  margin-top: auto;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 52px);
  font-style: italic;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
.card-phonetic {
  display: block;
  margin-top: 10px;
  font-family: var(--font-ipa);
  font-size: 15px;
  color: var(--ink-3);
}
.card-pos {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--accent);
}
.card-meaning {
  display: block;
  margin-top: 18px;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
}
.card-rule {
  display: block;
  height: 1px;
  margin: 22px 0 16px;
  background: var(--rule);
}
.card-origin {
  display: block;
  margin-bottom: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}
.card-origin b {
  margin-right: 8px;
  font-weight: 600;
  color: var(--ink);
}

.card-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}
.card-dots button {
  width: 28px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}
.card-dots button::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--rule-strong);
  transition: background-color 0.3s;
}
.card-dots button[aria-selected="true"]::before { background: var(--ink); }

/* 流动的词 */

.word-river {
  margin-top: clamp(56px, 8vw, 96px);
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.word-river-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-style: italic;
  color: var(--ink-3);
  white-space: nowrap;
  animation: river 60s linear infinite;
}
.word-river-track i {
  font-style: normal;
  color: var(--gold);
}
@keyframes river {
  to { transform: translateX(-50%); }
}

/* ---------- Quote ---------- */

.quote-band { padding: clamp(80px, 12vw, 144px) 0 clamp(8px, 2vw, 24px); }

.quote {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.quote blockquote { margin: 0; }
.quote blockquote p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.quote-cn {
  margin: 28px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: 0.3em;
  color: var(--accent);
}
.quote figcaption {
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-3);
}

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-tinted {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section-head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head-wide { max-width: 760px; }

.section-no {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-3);
}
.section-no span {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.section-lead {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-2);
}
.section-body {
  margin: 16px 0 0;
  color: var(--ink-2);
  line-height: 1.9;
}

/* Principles */

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.principle {
  padding: 40px 36px 8px 0;
}
.principle + .principle {
  padding-left: 36px;
  border-left: 1px solid var(--rule);
}
.principle-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  color: var(--accent);
}
.principle-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.principle-icon .fill { fill: var(--gold); stroke: none; }
.principle-no {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.principle-no em {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0;
}
.principle h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
}
.principle-quote {
  margin: 14px 0 18px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--accent);
}
.principle p:last-child { margin: 0; color: var(--ink-2); line-height: 1.9; }

/* Anatomy */

.anatomy {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.anatomy-word {
  position: sticky;
  top: 108px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.anatomy-label {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}
.anatomy-headword {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(48px, 6.4vw, 80px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.anatomy-phonetic {
  margin: 8px 0 0;
  font-family: var(--font-ipa);
  font-size: 17px;
  color: var(--ink-3);
}
.anatomy-phonetic span {
  margin-left: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
}
.etymology {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px dashed var(--rule-strong);
}
.ety-part {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  line-height: 1.3;
}
.ety-part b {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}
.ety-part small { font-size: 12px; color: var(--ink-2); }
.ety-op { font-family: var(--font-serif); font-size: 22px; color: var(--ink-3); }
.ety-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-basis: 100%;
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}
.ety-arrow { color: var(--gold); font-weight: 400; }

.anatomy-grid {
  display: grid;
  gap: 16px;
}
.facet {
  position: relative;
  padding: 28px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  transition: border-color 0.3s, transform 0.3s var(--ease), background-color 0.3s;
}
.facet:hover {
  border-color: var(--rule-strong);
  background: var(--card);
  transform: translateX(4px);
}
.facet-no {
  position: absolute;
  top: 28px;
  right: 32px;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-3);
}
.facet h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}
.facet > p { margin: 6px 0 18px; color: var(--ink-2); font-size: 15px; }
.facet ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.facet li {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.facet li span {
  flex: none;
  min-width: 3em;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.facet li i { font-family: var(--font-serif); color: var(--accent); }

/* Story */

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.story-grid .section-head { margin-bottom: 0; position: sticky; top: 108px; }
.story-tip {
  margin: 28px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}

.story-page {
  position: relative;
  padding: clamp(28px, 4.4vw, 52px);
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
}
.story-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(14px, 2.2vw, 26px);
  width: 1px;
  background: color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.story-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.story-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 600;
}
.story-count {
  font-size: 13px;
  color: var(--ink-3);
}
.story-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.9vw, 21px);
  line-height: 1.95;
  color: var(--ink);
}
.w {
  display: inline;
  padding: 0 2px;
  margin: 0;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-style: italic;
  font-weight: 600;
  line-height: inherit;
  color: var(--accent);
  background: linear-gradient(transparent 70%, var(--accent-mark) 70%);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.w:hover, .w.is-open {
  background-color: var(--accent-soft);
}
.w.is-seen { text-decoration: underline dotted var(--gold); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

.story-translation {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 2;
}
.story-translation p { margin: 0; }
.story-translation.is-entering { animation: fadeUp 0.5s var(--ease); }

.story-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
}
.story-footnote { font-size: 13px; color: var(--ink-3); }

.word-pop {
  position: absolute;
  z-index: 5;
  width: 248px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s var(--ease);
}
.word-pop::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--ink);
  transform: rotate(45deg);
  border-radius: 2px;
}
.word-pop.is-below::after { bottom: auto; top: -6px; }
.word-pop p { margin: 0; }
.pop-word {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 600;
}
.pop-phonetic {
  font-family: var(--font-ipa);
  font-size: 14px;
  opacity: 0.6;
}
.pop-meaning {
  margin-top: 8px !important;
  font-size: 15px;
}
.pop-meaning em {
  margin-right: 6px;
  font-family: var(--font-serif);
  color: var(--gold);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
}

/* Memory */

.memory-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.memory-grid .section-head { margin-bottom: 0; }

.segmented {
  display: inline-flex;
  gap: 4px;
  margin-top: 32px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--card);
}
.seg {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}
.seg:hover { color: var(--ink); }
.seg.is-active { background: var(--ink); color: var(--paper); }

.chart-card {
  margin: 0;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .grid line.axis { stroke: var(--rule-strong); stroke-dasharray: none; }
.chart text {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--ink-3);
}
.chart .y-labels text { text-anchor: end; }
.chart .x-labels text { text-anchor: middle; }
.chart .x-labels text:first-child { text-anchor: start; }
.chart .x-labels text.end { text-anchor: end; }
.chart .curve {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.4s var(--ease);
}
.chart .curve-none { stroke: var(--muted-curve); stroke-width: 2.2; stroke-dasharray: 1 0; }
.chart .curve-spaced { stroke: var(--accent); stroke-width: 2.6; }
.chart .review-marks line { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.45; }
.chart .review-marks circle { fill: var(--gold); stroke: var(--card); stroke-width: 2; }
.chart .end-labels text { font-size: 14px; font-weight: 600; text-anchor: end; }
.chart .lbl-spaced { fill: var(--accent); }
.chart .lbl-none { fill: var(--ink-3); }
.chart .review-marks, .chart .end-labels text { transition: opacity 0.4s var(--ease); }

.chart[data-show="none"] .curve-spaced,
.chart[data-show="none"] .review-marks,
.chart[data-show="none"] .lbl-spaced { opacity: 0.08; }
.chart[data-show="spaced"] .curve-none,
.chart[data-show="spaced"] .lbl-none { opacity: 0.12; }

/* 曲线描绘动画 */
.js .chart .curve { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .chart .review-marks circle { opacity: 0; transition: opacity 0.4s var(--ease); }
.js .chart.is-drawn .curve { stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s var(--ease), opacity 0.4s var(--ease); }
.js .chart.is-drawn .curve-spaced { transition-delay: 0.3s, 0s; }
.js .chart.is-drawn .review-marks circle { opacity: 1; transition-delay: 1.4s; }

.chart-card figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-2);
}
.legend { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 3px; border-radius: 2px; }
.sw-spaced { background: var(--accent); }
.sw-none { background: var(--muted-curve); }
.chart-note { width: 100%; color: var(--ink-3); font-size: 12px; }

/* Notes */

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.note {
  display: flex;
  flex-direction: column;
  padding: 30px 30px 26px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--rule);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.note:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--rule-strong);
}
.note-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.note-no {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-3);
}
.note-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.note h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}
.note p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.note .note-cite {
  margin-top: auto;
  padding-top: 22px;
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}
.note p + .note-cite { margin-top: auto; }
.note-cite::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  margin-bottom: 12px;
  background: var(--rule-strong);
}

/* Closing */

.closing {
  padding: clamp(96px, 14vw, 180px) 0;
  text-align: center;
  background:
    radial-gradient(60% 70% at 50% 100%, var(--accent-soft), transparent 70%);
}
.closing-inner { max-width: 760px; margin: 0 auto; }
.closing-text {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3.8vw, 44px);
  line-height: 1.55;
}
.closing-sub {
  max-width: 560px;
  margin: 32px auto 0;
  color: var(--ink-2);
  line-height: 2;
}
.closing-sign {
  margin: 44px 0 0;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-3);
}
.closing-sign em { color: var(--accent); font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-3);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand .brand-word { font-size: 19px; color: var(--ink); }
.footer-brand p { margin: 4px 0 0; }
.footer-meta { text-align: right; }
.footer-meta p { margin: 0; line-height: 1.9; }
.icp { color: var(--ink-3); text-decoration: none; transition: color 0.2s; }
.icp:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

/* 首屏不依赖滚动监听，加载即播放，避免空白 */
.js .hero .reveal {
  opacity: 1;
  transform: none;
  transition: none;
  animation: fadeUp 1s var(--ease) both;
}
.js .hero .hero-title { animation-delay: 0.08s; }
.js .hero .hero-lead { animation-delay: 0.16s; }
.js .hero .hero-actions { animation-delay: 0.24s; }
.js .hero .hero-visual { animation-delay: 0.2s; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .site-nav { display: none; }
  .hero-grid,
  .anatomy,
  .story-grid,
  .memory-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { margin-top: 8px; }
  .card-stack { max-width: 380px; }
  .anatomy-word,
  .story-grid .section-head { position: static; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principle,
  .principle + .principle {
    padding: 36px 0;
    border-left: 0;
  }
  .principle + .principle { border-top: 1px solid var(--rule); }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .header-inner { height: 60px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .card-stack { aspect-ratio: 1 / 1.08; }
  .notes { grid-template-columns: minmax(0, 1fr); }
  .note { padding: 26px 24px 22px; }
  .facet { padding: 24px 22px; }
  .facet-no { top: 24px; right: 22px; }
  .quote-cn { letter-spacing: 0.24em; }
  .segmented { display: flex; width: 100%; }
  .seg { flex: 1; padding: 0 8px; }
  .footer-meta { text-align: left; }
  .closing-text br { display: none; }
  .word-pop { width: min(248px, calc(100vw - 48px)); }
  .chart text, .chart .end-labels text { font-size: 20px; }
  .chart .x-labels text:nth-child(3) { display: none; }
  .chart .end-labels { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .word-river-track { animation: none; }
}
