/* ==========================================================================
   墨序 MOXU — Design System
   Xuan paper + ink + indigo accent. One interactive accent, vermilion seal.
   ========================================================================== */

:root {
  --bg: #f7f4ea;
  --bg: oklch(96.8% 0.013 88);
  --bg-deep: #efe9db;
  --bg-deep: oklch(93.6% 0.018 88);
  --surface: #fffdf6;
  --surface: oklch(99.2% 0.006 88);
  --surface-2: #f3eee1;
  --surface-2: oklch(94.8% 0.014 88);
  --ink: #1b1912;
  --ink: oklch(21% 0.012 88);
  --text: #2a271d;
  --text: oklch(28% 0.012 88);
  --muted: #6e6858;
  --muted: oklch(51% 0.014 88);
  --line: rgba(27, 25, 18, 0.13);
  --line-strong: rgba(27, 25, 18, 0.24);
  --accent: #2c5f86;
  --accent: oklch(46% 0.08 242);
  --accent-deep: #1e4767;
  --accent-deep: oklch(38% 0.075 242);
  --accent-soft: rgba(44, 95, 134, 0.09);
  --seal: #a63b2e;
  --seal: oklch(46% 0.13 32);
  --seal-soft: rgba(166, 59, 46, 0.1);
  --grid-line: rgba(166, 59, 46, 0.32);
  --cream: #fffdf6;

  --shadow-contact: 0 1px 2px rgba(30, 26, 18, 0.07);
  --shadow-ambient: 0 26px 52px -20px rgba(30, 26, 18, 0.2);
  --shadow-card: 0 1px 2px rgba(30, 26, 18, 0.07), 0 26px 52px -22px rgba(30, 26, 18, 0.17);
  --shadow-ink: 0 1px 2px rgba(0, 0, 0, 0.2), 0 28px 56px -20px rgba(20, 18, 12, 0.45);
  --key-light: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --hairline: inset 0 0 0 1px rgba(27, 25, 18, 0.07);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-latin: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "Consolas", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 72px;
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(1100px 640px at 6% -8%, rgba(255, 253, 246, 0.95), transparent 62%),
    radial-gradient(760px 520px at 96% 0%, rgba(120, 140, 150, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 58%, var(--bg-deep) 100%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--cream); }

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

.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  transition: top 200ms var(--ease-out);
}
.skip:focus { top: 12px; }

/* Paper grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='240' height='240' filter='url(%23n)' opacity='0.15'/></svg>");
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}
.container-narrow {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

.section { padding-top: clamp(72px, 8vw, 124px); padding-bottom: clamp(72px, 8vw, 124px); }
.section-tight { padding-top: clamp(44px, 5vw, 72px); padding-bottom: clamp(44px, 5vw, 72px); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow-muted { color: var(--muted); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(30px, 3.6vw, 52px);
}
.section-head h2 { margin: 10px 0 0; }
.section-head .lead { max-width: 400px; margin: 0; color: var(--muted); font-size: 15px; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.8rem, 3.1vw, 2.7rem); }
h3 { font-size: clamp(1.12rem, 1.6vw, 1.36rem); letter-spacing: -0.01em; }
h1 em, h2 em { font-style: normal; color: var(--accent); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
.lead-text { font-size: clamp(1rem, 1.2vw, 1.125rem); color: var(--muted); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent); }
.hairline-top { border-top: 1px solid var(--line); }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 160ms var(--ease-press), background-color 200ms ease, box-shadow 240ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; flex: none; transition: transform 240ms var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

.btn-ink {
  color: var(--cream);
  background: linear-gradient(180deg, #34312a 0%, var(--ink) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24),
    var(--shadow-contact),
    0 12px 26px -14px rgba(24, 21, 14, 0.55);
}
.btn-ink:hover { background: linear-gradient(180deg, #3d3a31 0%, #24211a 100%); }

.btn-accent {
  color: var(--cream);
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 26px -14px rgba(44, 95, 134, 0.8);
}
.btn-accent:hover { background: var(--accent-deep); }

.btn-ghost {
  color: var(--text);
  background: rgba(255, 253, 246, 0.6);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--text); }

.btn-seal {
  color: var(--cream);
  background: var(--seal);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 26px -14px rgba(166, 59, 46, 0.75);
}
.btn-seal:hover { background: #8f3126; }

.btn-sm { height: 40px; padding: 0 18px; font-size: 13px; }
.btn-block { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 244, 234, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: inset 0 -1px 0 var(--line);
  transition: box-shadow 240ms ease, background-color 240ms ease;
}
.site-header.is-scrolled {
  background: rgba(247, 244, 234, 0.94);
  box-shadow: inset 0 -1px 0 var(--line), 0 10px 30px -24px rgba(30, 26, 18, 0.42);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-seal {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 7px;
  background: var(--seal);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 10px -4px rgba(166, 59, 46, 0.7);
}
.brand-name { font-family: var(--font-serif); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  align-self: flex-end;
  padding-bottom: 3px;
}

.site-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.site-nav a {
  position: relative;
  padding: 8px 11px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius-full);
  transition: color 180ms ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease-out);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.header-search {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 5px 0 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 253, 246, 0.66);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms ease, background-color 200ms ease;
}
.header-search:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.header-search input {
  width: 112px;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  transition: background-color 180ms ease;
}
.header-search button:hover { background: var(--accent); }
.header-search svg { width: 14px; height: 14px; }

.visit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255, 253, 246, 0.55);
  box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap;
}
.visit-pill strong { color: var(--text); font-weight: 500; }
.visit-sep { color: var(--line-strong); }
.visit-label { font-family: var(--font-sans); font-size: 11px; }

.pulse-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.5;
  animation: pulse-ring 2.4s ease-out infinite;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.nav-toggle span { display: block; height: 1.5px; background: var(--text); transition: transform 220ms ease, opacity 180ms ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px clamp(20px, 4vw, 48px) 20px;
  border-top: 1px solid var(--line);
  background: rgba(247, 244, 234, 0.98);
}
.mobile-nav a {
  padding: 11px 10px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
}
.mobile-nav a:hover { background: var(--surface-2); }
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 5px 5px 5px 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.mobile-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; }
.mobile-search button {
  flex: none;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(48px, 6vw, 84px);
  padding-bottom: clamp(48px, 6vw, 84px);
}
.hero-copy h1 { margin: 14px 0 18px; }
.hero-copy .lead-text { max-width: 470px; }
.hero-search {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  max-width: 520px;
}
.hero-search .field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-contact);
  transition: box-shadow 200ms ease;
}
.hero-search .field:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow-contact); }
.hero-search .field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.hero-search input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 15.5px;
  outline: none;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search .btn { height: 54px; padding: 0 26px; }

.hot-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hot-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 10px;
  background: rgba(255, 253, 246, 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
  color: var(--muted);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.hot-chip b { font-family: var(--font-serif); font-size: 16px; color: var(--text); font-weight: 700; }
.hot-chip:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); transform: translateY(-1px); }

.hero-stage { position: relative; }
.stage-card {
  position: relative;
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 253, 246, 0.92), rgba(243, 238, 225, 0.7));
  box-shadow: var(--shadow-card), var(--hairline);
}
.stage-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(27, 25, 18, 0.16), rgba(27, 25, 18, 0) 68%);
  filter: blur(2px);
  pointer-events: none;
}

.tian-grid {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border: 1.5px solid var(--grid-line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(166, 59, 46, 0.03);
}
.tian-grid::before,
.tian-grid::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.tian-grid::before {
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--grid-line);
}
.tian-grid::after {
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--grid-line);
}
.tian-grid > .writer-host { position: relative; z-index: 2; width: 100%; height: 100%; }
/* 笔顺动画：淡墨整字（底层） + 黑色逐笔书写（上层） */
.tian-grid-dual > .writer-host { position: absolute; inset: 0; }
.tian-grid-dual > .writer-ghost { z-index: 2; pointer-events: none; }
.tian-grid-dual > #char-writer { z-index: 3; }

.tian-grid-lg { max-width: 420px; margin: 0 auto; }
.tian-grid-sm { max-width: 150px; }

.tian-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.tian-caption .mono { letter-spacing: 0.08em; }

.stage-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.stroke-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.stroke-meter strong { color: var(--accent); font-weight: 500; }

/* --------------------------------------------------------------------------
   Daily card / stats
   -------------------------------------------------------------------------- */
.daily-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(20px, 4vw, 44px);
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card), var(--hairline);
}
.daily-card .tian-grid { width: clamp(96px, 12vw, 132px); }
.daily-main h2 { margin: 8px 0 6px; font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.daily-main p { color: var(--muted); font-size: 14.5px; margin: 0; }
.daily-side { text-align: right; }
.daily-side .mono { font-size: 12px; color: var(--muted); display: block; }
.daily-side .btn { margin-top: 10px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--hairline);
}
.stat-cell { padding: clamp(18px, 2.4vw, 28px); background: var(--surface); }
.stat-cell .num { font-family: var(--font-serif); font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 700; line-height: 1.1; }
.stat-cell .num small { font-size: 0.45em; font-family: var(--font-sans); font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-cell .label { margin-top: 4px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }

/* --------------------------------------------------------------------------
   Lookup sections
   -------------------------------------------------------------------------- */
.lookup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
.lookup-card {
  padding: clamp(22px, 2.6vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card), var(--hairline);
}
.lookup-card h3 { margin-bottom: 4px; }
.lookup-card > p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }

.stroke-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stroke-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 9px 2px;
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px transparent;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.stroke-tile b { font-family: var(--font-serif); font-size: 16px; line-height: 1.1; }
.stroke-tile span { font-size: 9.5px; color: var(--muted); font-family: var(--font-mono); }
.stroke-tile:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); transform: translateY(-1px); }

.radical-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.radical-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.radical-chip b { font-family: var(--font-serif); font-size: 14px; color: var(--text); }
.radical-chip:hover { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.pinyin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pinyin-chip {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}
.pinyin-chip:hover { background: var(--ink); color: var(--cream); }

/* --------------------------------------------------------------------------
   Prose / rules
   -------------------------------------------------------------------------- */
.prose { max-width: 720px; }
.prose h2 { margin: 42px 0 14px; font-size: clamp(1.5rem, 2.3vw, 2rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 26px 0 8px; }
.prose p { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
}

.rule-list { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--radius-md); overflow: hidden; }
.rule-item { display: flex; gap: 16px; padding: 18px 20px; background: var(--surface); }
.rule-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}
.rule-item h4 { margin: 0 0 3px; font-size: 15px; font-family: var(--font-sans); font-weight: 700; }
.rule-item p { margin: 0; font-size: 13.5px; color: var(--muted); }
.rule-item .ex { font-family: var(--font-serif); color: var(--text); }

/* --------------------------------------------------------------------------
   Page hero / breadcrumb
   -------------------------------------------------------------------------- */
.page-hero { padding-top: clamp(34px, 4.6vw, 58px); padding-bottom: clamp(26px, 3.4vw, 44px); }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--line-strong); }
.page-hero h1 { margin: 10px 0 14px; font-size: clamp(2rem, 4vw, 3.3rem); }
.page-hero .lead-text { max-width: 660px; }

/* --------------------------------------------------------------------------
   Character page
   -------------------------------------------------------------------------- */
.char-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
  padding-top: clamp(20px, 3vw, 34px);
  padding-bottom: clamp(30px, 4vw, 52px);
}
.char-stage {
  position: relative;
  padding: clamp(18px, 2.6vw, 28px);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 253, 246, 0.94), rgba(243, 238, 225, 0.72));
  box-shadow: var(--shadow-card), var(--hairline);
}
.char-stage .tian-grid { max-width: 400px; margin: 0 auto; }
.char-stage .stage-toolbar { justify-content: center; }

.char-info .eyebrow { display: block; }
.char-title-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 14px; }
.char-title-row h1 { margin: 0; font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
.char-py { font-family: var(--font-latin); font-size: clamp(1.1rem, 1.8vw, 1.45rem); color: var(--accent); font-weight: 500; }

.direct-answer {
  padding: 16px 18px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  font-size: 15px;
  line-height: 1.8;
}
.direct-answer strong { color: var(--accent-deep); }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 22px 0 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--hairline);
}
.fact-grid > div { padding: 13px 15px; background: var(--surface); }
.fact-grid dt { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.fact-grid dd { margin: 2px 0 0; font-family: var(--font-serif); font-size: 19px; font-weight: 600; line-height: 1.4; }
.fact-grid dd a { border-bottom: 1px solid var(--line-strong); }
.fact-grid dd a:hover { color: var(--accent); border-color: var(--accent); }
.fact-grid dd .mono { font-size: 15px; }

.quick-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* Stroke list */
.stroke-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.stroke-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--hairline);
  text-align: left;
  transition: box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}
.stroke-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stroke-btn.is-active { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.stroke-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.stroke-btn.is-active .stroke-no { background: var(--accent); color: var(--cream); }
.stroke-shape { font-family: var(--font-serif); font-size: 21px; line-height: 1; color: var(--accent-deep); }
.stroke-name { font-size: 13px; color: var(--text); }

.note-strip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 13.5px;
  color: var(--muted);
}
.note-strip svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }

/* Practice */
.practice-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card), var(--hairline);
}
.practice-copy h2 { margin-bottom: 10px; }
.practice-copy p { color: var(--muted); font-size: 14.5px; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.practice-stage .tian-grid { max-width: 300px; margin: 0 auto; }
.practice-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: clamp(110px, 17vw, 170px);
  font-weight: 600;
  line-height: 1;
  color: rgba(27, 25, 18, 0.07);
  pointer-events: none;
  user-select: none;
}
.quiz-status { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); min-height: 22px; }
.quiz-status strong { color: var(--accent); }

/* Related */
.related-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); }
.related-col h3 { font-size: 15px; font-family: var(--font-sans); font-weight: 700; letter-spacing: 0.01em; margin-bottom: 12px; }
.related-col h3 span { color: var(--muted); font-weight: 400; }
.char-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.char-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 2px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--hairline);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.char-link b { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.25; }
.char-link span { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.char-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

/* --------------------------------------------------------------------------
   Index pages
   -------------------------------------------------------------------------- */
.index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.index-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-contact);
  min-width: min(100%, 320px);
}
.index-search:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow-contact); }
.index-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.index-search input { width: 100%; border: 0; background: transparent; outline: none; font-size: 14.5px; }
.index-count { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.filter-chip.is-on { background: var(--ink); color: var(--cream); }

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 7px;
}
.char-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 2px 8px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--hairline);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.char-cell b { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.char-cell span { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.char-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); background: var(--surface-2); }

.index-group { margin-top: 40px; }
.index-group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}
.index-group-title small { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); }

.letter-grid, .radical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.letter-tile, .radical-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--hairline);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.letter-tile b, .radical-tile b { font-family: var(--font-serif); font-size: 24px; line-height: 1.2; }
.letter-tile b { font-family: var(--font-latin); text-transform: uppercase; }
.letter-tile span, .radical-tile span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.letter-tile:hover, .radical-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card), var(--hairline);
}
.stroke-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14px; }
.stroke-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.stroke-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stroke-table tr:last-child td { border-bottom: 0; }
.stroke-table td b { font-family: var(--font-serif); font-size: 20px; }
.stroke-table td a:hover { color: var(--accent); }
.stroke-table td:nth-child(4) { color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq-list { display: grid; gap: 8px; }
.faq-item {
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--hairline);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
}
.faq-icon {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--muted);
  transition: transform 240ms var(--ease-out), opacity 200ms ease;
}
.faq-icon::before { left: 0; right: 0; top: 7.5px; height: 1.5px; }
.faq-icon::after { top: 0; bottom: 0; left: 7.5px; width: 1.5px; }
.faq-item.is-open .faq-icon::after { transform: scaleY(0); opacity: 0; }
.faq-item.is-open .faq-icon::before { background: var(--accent); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms var(--ease-out);
}
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a-inner p { padding: 0 20px 18px; margin: 0; font-size: 14.5px; color: var(--muted); }
.faq-a-inner a { color: var(--accent); border-bottom: 1px solid var(--accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: clamp(48px, 6vw, 76px);
  background: var(--bg-deep);
  box-shadow: inset 0 1px 0 var(--line);
  overflow: hidden;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(26px, 4vw, 52px);
  padding-bottom: clamp(36px, 4vw, 52px);
}
.footer-brand p { margin: 14px 0 0; max-width: 300px; font-size: 13.5px; color: var(--muted); }
.footer-seal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.footer h4 { margin: 0 0 14px; font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { font-size: 13.5px; color: var(--text); transition: color 160ms ease; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.55);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ghost-mark {
  position: absolute;
  right: -20px;
  bottom: -70px;
  font-family: var(--font-serif);
  font-size: clamp(150px, 22vw, 260px);
  font-weight: 900;
  line-height: 1;
  color: rgba(27, 25, 18, 0.04);
  pointer-events: none;
  user-select: none;
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(26px, 3.4vw, 44px);
  border-radius: var(--radius-xl);
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-ink);
}
.cta-band h2 { color: var(--cream); font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.cta-band p { margin: 8px 0 0; color: rgba(255, 253, 246, 0.66); font-size: 14px; }
.cta-band .btn-cream {
  color: var(--ink);
  background: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px -14px rgba(0, 0, 0, 0.5);
}
.cta-band .btn-cream:hover { background: #ffffff; }

/* --------------------------------------------------------------------------
   Reveal / motion
   -------------------------------------------------------------------------- */
.reveal, .stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}
.reveal.is-in, .stagger.is-in > * { opacity: 1; transform: none; }
.stagger.is-in > *:nth-child(2) { transition-delay: 60ms; }
.stagger.is-in > *:nth-child(3) { transition-delay: 120ms; }
.stagger.is-in > *:nth-child(4) { transition-delay: 180ms; }
.stagger.is-in > *:nth-child(5) { transition-delay: 240ms; }
.stagger.is-in > *:nth-child(6) { transition-delay: 300ms; }

.digit-pop .digit { display: inline-block; animation: digit-up 520ms var(--ease-out) backwards; }
.digit-pop .digit:nth-child(2) { animation-delay: 40ms; }
.digit-pop .digit:nth-child(3) { animation-delay: 80ms; }
.digit-pop .digit:nth-child(4) { animation-delay: 120ms; }
.digit-pop .digit:nth-child(5) { animation-delay: 160ms; }

@keyframes digit-up { from { opacity: 0; transform: translateY(0.5em); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring { 0% { transform: scale(0.7); opacity: 0.55; } 70%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes ripple-grow { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* --------------------------------------------------------------------------
   Print sheet
   -------------------------------------------------------------------------- */
.print-sheet { display: none; }
.print-grid-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6mm; }

@media print {
  body { background: #fff; }
  .grain, .site-header, .site-footer, .stage-toolbar, .quick-nav, .faq-list,
  .related-columns, .practice-card, .note-strip, .breadcrumb, .cta-band, .skip { display: none !important; }
  .print-sheet { display: block; }
  .print-sheet .print-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8mm; border-bottom: 1px solid #ccc; padding-bottom: 4mm; }
  .print-sheet .print-head h1, .print-sheet .print-title { font-size: 24pt; margin: 0; font-family: var(--font-serif); font-weight: 700; }
  .print-sheet .print-head span { font-size: 10pt; color: #666; }
  .print-sheet .tian-grid { border-color: #d8a29a; break-inside: avoid; }
  .print-sheet .tian-grid::before, .print-sheet .tian-grid::after { border-color: #e0b4ac; }
  .print-ghost { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--font-serif); font-size: 74pt; color: rgba(0,0,0,0.08); }
  .print-order { margin-top: 6mm; font-size: 10.5pt; color: #333; line-height: 1.7; }
  .print-order b { color: #000; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: none; }
  .mobile-nav.is-open { display: flex; }
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-top .footer:last-child { display: none; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero-stage { max-width: 440px; margin: 0 auto; width: 100%; }
  .lookup-grid { grid-template-columns: 1fr; }
  .related-columns { grid-template-columns: 1fr 1fr; }
  .related-col:last-child { grid-column: span 2; }
  .char-hero { grid-template-columns: 1fr; gap: 30px; }
  .char-stage { max-width: 460px; margin: 0 auto; width: 100%; }
  .practice-card { grid-template-columns: 1fr; text-align: center; }
  .practice-copy { order: 2; }
  .practice-stage { order: 1; }
  .practice-actions { justify-content: center; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .header-search { display: none; }
  .visit-pill .visit-label { display: none; }
  .visit-pill { gap: 5px; padding: 0 10px; }
  .visit-pill .visit-sep { display: none; }
  .daily-card { grid-template-columns: auto 1fr; }
  .daily-side { grid-column: span 2; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .daily-side .btn { margin-top: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
  .footer-top .footer:last-child { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stroke-tiles { grid-template-columns: repeat(5, 1fr); }
  .char-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
  .char-cell b { font-size: 21px; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .related-columns { grid-template-columns: 1fr; }
  .related-col:last-child { grid-column: auto; }
  .char-links { grid-template-columns: repeat(6, 1fr); }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .stat-cell { padding: 16px; }
}

@media (max-width: 420px) {
  .brand-sub { display: none; }
  .char-links { grid-template-columns: repeat(5, 1fr); }
  .stroke-list { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .stagger > * { opacity: 1; transform: none; }
}
