/* YinYang Arts — "Rice paper & ink" design system. No framework. */

:root {
  --paper: #F8F5F0;
  --paper-2: #F0EAE0;
  --card: #FFFDF9;
  --ink: #222222;
  --ink-2: #48423C;
  --muted: #7A7066;
  --gold: #B88655;
  --gold-deep: #8C6232;
  --seal: #A8432F;
  --line: rgba(34, 34, 34, .12);
  --line-2: rgba(34, 34, 34, .06);
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 30px rgba(60, 40, 20, .06);
  --tj-dark: #222222;
  --tj-light: #F8F5F0;
  --serif: 'Cormorant Garamond', 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', Georgia, serif;
  --serif-zh: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --radius: 14px;
  --wrap: 1180px;
  --narrow: 760px;
  color-scheme: light;
}

html[data-theme='yin'] {
  --paper: #141312;
  --paper-2: #1B1917;
  --card: #1D1B19;
  --ink: #E9E4DA;
  --ink-2: #CFC7BA;
  --muted: #9A9085;
  --gold: #CFA06E;
  --gold-deep: #E0B888;
  --seal: #CF6A52;
  --line: rgba(233, 228, 218, .13);
  --line-2: rgba(233, 228, 218, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --tj-dark: #E9E4DA;
  --tj-light: #141312;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(184, 134, 85, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(34, 34, 34, .03), transparent 60%);
  background-attachment: fixed;
  transition: background-color .5s ease, color .5s ease;
}
html[lang='zh-CN'] body { font-size: 17px; line-height: 1.9; letter-spacing: .01em; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-deep); }
::selection { background: rgba(184, 134, 85, .3); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.narrow { max-width: var(--narrow); }
.wrap.narrow { width: min(100% - 40px, var(--narrow)); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -.005em; margin: 0 0 .5em; color: var(--ink); }
html[lang='zh-CN'] h1, html[lang='zh-CN'] h2, html[lang='zh-CN'] h3 { font-family: var(--serif-zh); font-weight: 600; letter-spacing: .02em; }
.kicker { font: 600 .74rem/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 1rem; }
.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 46em; }
html[lang='zh-CN'] .lead { font-size: 1.1rem; }

/* ---------- Taiji ---------- */
.tj-yang { fill: var(--tj-light); }
.tj-yin { fill: var(--tj-dark); }
.tj-ring { fill: none; stroke: var(--tj-dark); stroke-width: 1.5; }

/* ---------- Header ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--seal)); transition: width .1s linear; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; transition: transform 1.2s cubic-bezier(.6, 0, .2, 1); }
.brand:hover .brand-mark { transform: rotate(180deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: 600 1.32rem/1 var(--serif); letter-spacing: .02em; }
html[lang='zh-CN'] .brand-name { font-family: var(--serif-zh); font-size: 1.18rem; letter-spacing: .12em; }
.brand-alt { font-size: .68rem; letter-spacing: .3em; color: var(--muted); margin-top: 4px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { text-decoration: none; font-size: .9rem; font-weight: 500; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; transition: background .2s, color .2s; }
.main-nav a:hover { background: var(--line-2); color: var(--ink); }
.main-nav a[aria-current='page'] { color: var(--ink); background: var(--line-2); box-shadow: inset 0 -2px 0 var(--gold); }
.header-tools { display: flex; align-items: center; gap: 4px; }
.tool {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; cursor: pointer;
  font: 600 .82rem/1 var(--sans); text-decoration: none; transition: background .2s;
}
.tool:hover { background: var(--line-2); color: var(--ink); }
.tool .icon { width: 20px; height: 20px; }
.lang-switch { border: 1px solid var(--line); white-space: nowrap; }
.toggle-mark { width: 22px; height: 22px; transition: transform .9s cubic-bezier(.6, 0, .2, 1); }
html[data-theme='yin'] .toggle-mark { transform: rotate(180deg); }
.menu-toggle { display: none; }

@media (max-width: 1020px) {
  .menu-toggle { display: inline-grid; }
  .main-nav {
    position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 20px 20px;
    display: none; box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 8px; border-radius: 8px; font-size: 1rem; }
  .header-tools { margin-left: auto; }
}

/* ---------- Buttons, chips, fields ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px;
  font: 600 .92rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn .icon { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--gold-deep); color: var(--paper); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.chip { border: 1px solid var(--line); background: transparent; color: var(--ink-2); padding: 7px 16px; border-radius: 999px; font: 500 .86rem/1 var(--sans); cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--gold); }
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field {
  width: 100%; font: 400 1.05rem/1.4 var(--sans); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 14px 22px; margin: 0 0 2rem;
}
.field:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 134, 85, .15); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(70px, 12vh, 140px) 0 clamp(70px, 11vh, 130px); }
.hero-art { position: absolute; right: max(-160px, calc(50% - 760px)); top: 50%; width: min(720px, 78vw); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
.hero-enso { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); opacity: .1; }
.hero-taiji { position: absolute; inset: 24%; width: 52%; height: 52%; opacity: .1; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-inner { position: relative; }
.hero-title { font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: 1.02; margin: 0 0 1.5rem; font-weight: 400; }
.hero-title span { display: block; }
.hero-title em { display: block; font-style: italic; color: var(--gold-deep); }
html[lang='zh-CN'] .hero-title { font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.2; font-weight: 600; letter-spacing: .08em; }
html[lang='zh-CN'] .hero-title em { font-style: normal; }
.hero .lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 3rem 0 0; font-size: .8rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.trust li::before { content: '◦'; color: var(--gold); margin-right: 8px; }

/* ---------- Home sections ---------- */
.quote-band { padding: 70px 0; border-block: 1px solid var(--line-2); background: var(--paper-2); }
.big-quote { margin: 0; text-align: center; }
.big-quote p { font: italic 400 clamp(1.5rem, 3vw, 2.2rem)/1.35 var(--serif); margin: 0 0 1rem; }
html[lang='zh-CN'] .big-quote p { font-family: var(--serif-zh); font-style: normal; letter-spacing: .15em; }
.big-quote cite { font-style: normal; color: var(--muted); font-size: .9rem; letter-spacing: .1em; }
.home-section { padding: clamp(70px, 10vw, 120px) 0; }
.home-section.wrap { padding-inline: 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 3.2rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }

.pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pillar { position: relative; background: var(--card); padding: 34px 26px 30px; text-decoration: none; transition: background .3s; }
.pillar:hover { background: var(--paper-2); color: inherit; }
.pillar-num { position: absolute; top: 18px; right: 20px; font: 400 1.6rem/1 var(--serif-zh); color: var(--gold); opacity: .55; }
.pillar-icon { width: 38px; height: 38px; color: var(--gold-deep); margin-bottom: 18px; }
.pillar h3 { font-size: 1.55rem; margin: 0; }
.pillar-zh { color: var(--muted); font-size: .85rem; letter-spacing: .2em; margin: 0 0 .8rem; }
.pillar p:last-child { font-size: .92rem; color: var(--ink-2); margin: 0; line-height: 1.6; }
@media (max-width: 980px) { .pillars { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }

.library-band { background: var(--paper-2); border-block: 1px solid var(--line-2); }
.east-west { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 30px; align-items: start; margin-bottom: 3rem; }
.ew-divider { position: sticky; top: 120px; display: grid; place-items: center; height: 100%; }
.ew-divider::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); }
.ew-taiji { position: relative; width: 56px; height: 56px; background: var(--paper-2); }
.ew-title { display: flex; align-items: center; gap: 12px; font-size: 1.8rem; margin-bottom: 1.2rem; }
.seal {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  background: var(--seal); color: #FBF3EA; border-radius: 6px; font: 600 1.05rem/1 var(--serif-zh);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
  transform: rotate(-3deg);
}
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-list a { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .25s, color .2s; }
.lib-list a:hover { padding-left: 12px; }
.lib-title { font: 500 1.18rem/1.3 var(--serif); }
html[lang='zh-CN'] .lib-title { font-family: var(--serif-zh); font-size: 1.02rem; }
.lib-era { font-size: .78rem; color: var(--muted); white-space: nowrap; letter-spacing: .04em; }
@media (max-width: 820px) { .east-west { grid-template-columns: 1fr; } .ew-divider { display: none; } }

.timeline-band { border-bottom: 1px solid var(--line-2); }
.tl-strip { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); position: relative; }
.tl-strip::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--line); }
.tl-strip li { position: relative; padding: 28px 12px 0; }
.tl-strip li::before { content: ''; position: absolute; top: 2px; left: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--gold); }
.tl-strip li.is-west::before { border-color: var(--ink-2); }
.tl-strip a { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.tl-strip .tl-year { font-size: .76rem; color: var(--muted); letter-spacing: .06em; }
.tl-strip .tl-name { font: 500 1.05rem/1.3 var(--serif); }

.principles-band { background: var(--ink); color: var(--paper); }
.principles-band h2, .principles-band h3 { color: var(--paper); }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.principle .seal { margin-bottom: 1rem; }
.principle h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.principle p { color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: .95rem; line-height: 1.7; margin: 0; }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Page head, groups, cards ---------- */
.page-head { padding: clamp(50px, 8vw, 90px) 0 10px; }
.page-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 400; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 1.6rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.trigram-rule { margin: 2.2rem 0 0; color: var(--gold); opacity: .55; }
.trigram-rule svg { width: 200px; height: 12px; fill: currentColor; display: block; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; margin-bottom: 1rem; }
.group { padding: 2.2rem 0; }
.group[hidden] { display: none; }
.group-title { font-size: 1.9rem; margin-bottom: 1.4rem; }
.group-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 1rem; }
.group-head .group-title { margin-bottom: .2rem; }
.group-head .pillar-icon { margin: 6px 0 0; }
.group-head p { margin: 0 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 26px 54px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: transform .3s, box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); color: var(--ink); }
.card-meta { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
html[lang='zh-CN'] .card-meta { letter-spacing: .08em; }
.card h3 { font-size: 1.5rem; margin: 4px 0 0; }
html[lang='zh-CN'] .card h3 { font-size: 1.22rem; }
.card-sub { margin: 0; color: var(--muted); font-size: .88rem; font-style: italic; }
html[lang='zh-CN'] .card-sub { font-style: normal; }
.card-text { margin: 6px 0 0; color: var(--ink-2); font-size: .94rem; line-height: 1.65; }
.card-more { position: absolute; left: 26px; bottom: 20px; color: var(--gold); transition: transform .3s; }
.card-more .icon { width: 20px; height: 20px; }
.card:hover .card-more { transform: translateX(6px); }

/* ---------- Article ---------- */
.article-head { padding: clamp(46px, 7vw, 80px) 0 0; }
.article-head h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 400; margin-bottom: .3em; }
html[lang='zh-CN'] .article-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.subtitle { font: italic 400 1.35rem/1.4 var(--serif); color: var(--gold-deep); margin: 0 0 1.2rem; }
html[lang='zh-CN'] .subtitle { font-style: normal; font-family: var(--serif-zh); font-size: 1.1rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--muted); letter-spacing: .04em; margin: 1.2rem 0 0; }
.article-meta i { font-style: normal; opacity: .5; }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 64px; justify-content: center; padding: 40px 0 60px; }
.article-aside { position: relative; }
.toc { position: sticky; top: 100px; font-size: .86rem; border-left: 1px solid var(--line); padding-left: 18px; }
.toc-title { font-weight: 600; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 .55rem; line-height: 1.4; }
.toc a { text-decoration: none; color: var(--muted); transition: color .2s; display: block; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.toc a.is-active { position: relative; }
.toc a.is-active::before { content: ''; position: absolute; left: -19px; top: 0; bottom: 0; width: 2px; background: var(--gold); }
@media (max-width: 1020px) {
  .article-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
  .article-aside { display: none; }
}

.prose { font-size: 1.06rem; color: var(--ink); min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.05em; }
.prose h2 { font-size: 2.05rem; margin: 2.4em 0 .6em; padding-top: .2em; position: relative; }
.prose h3 { font-size: 1.45rem; margin: 1.9em 0 .4em; }
html[lang='zh-CN'] .prose h2 { font-size: 1.6rem; }
html[lang='zh-CN'] .prose h3 { font-size: 1.22rem; }
.prose h2::before { content: ''; display: block; width: 36px; height: 2px; background: var(--gold); margin-bottom: 18px; }
.anchor { margin-left: .4em; color: var(--gold); opacity: 0; text-decoration: none; font-size: .7em; transition: opacity .2s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: .7; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--gold); }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose code { font-size: .88em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.6em 0; }
.prose blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.4em; border-left: 2px solid var(--gold); font: italic 400 1.3rem/1.55 var(--serif); color: var(--ink-2); }
html[lang='zh-CN'] .prose blockquote { font-family: var(--serif-zh); font-style: normal; font-size: 1.08rem; }
.prose blockquote p + p { margin-top: .6em; }
.prose a { color: var(--gold-deep); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 1.8em 0; background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.55; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 600 .78rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
.prose tr:last-child td { border-bottom: 0; }

/* notices & callouts */
.notice { border: 1px solid var(--line); border-left: 3px solid var(--gold); background: var(--paper-2); border-radius: 10px; padding: 16px 20px; font-size: .9rem; line-height: 1.6; margin-bottom: 2rem; }
.notice strong { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 4px; }
.notice p { margin: 0; color: var(--ink-2); }
.notice-practice { border-left-color: #6B8F71; }
.notice-practice strong { color: #557A5C; }
html[data-theme='yin'] .notice-practice strong { color: #9CC3A3; }

.callout { margin: 2em 0; border-radius: 12px; padding: 22px 26px; background: var(--card); border: 1px solid var(--line); }
.callout-title { font: 600 .74rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; margin-bottom: .7rem; color: var(--gold-deep); }
.callout-body > * + * { margin-top: .8em; }
.callout-body p { margin: 0; }
.callout-body ul, .callout-body ol { margin: .4em 0 0; }
.callout-passage {
  position: relative; background: var(--paper-2); border: 0; border-left: 3px solid var(--seal);
  border-radius: 4px 12px 12px 4px; padding: 26px 30px 26px 30px;
}
.callout-passage .callout-title { color: var(--seal); letter-spacing: .1em; text-transform: none; font-size: .86rem; font-family: var(--serif-zh); }
.callout-passage .callout-title::before { content: '印'; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; background: var(--seal); color: #FBF3EA; border-radius: 4px; font-size: .72rem; vertical-align: 1px; }
.callout-passage .callout-body { font: 400 1.18rem/1.7 var(--serif); }
html[lang='zh-CN'] .callout-passage .callout-body { font-family: var(--serif-zh); font-size: 1.02rem; line-height: 2; }
.callout-passage .callout-body em { color: var(--ink-2); }
.callout-note { background: transparent; border-style: dashed; }
.callout-warning { border-color: color-mix(in srgb, var(--seal) 40%, var(--line)); background: color-mix(in srgb, var(--seal) 6%, var(--card)); }
.callout-warning .callout-title { color: var(--seal); }
.callout-warning .callout-title::before { content: '⚠ '; }
.callout-practice { border-color: color-mix(in srgb, #6B8F71 45%, var(--line)); background: color-mix(in srgb, #6B8F71 7%, var(--card)); }
.callout-practice .callout-title { color: #557A5C; }
html[data-theme='yin'] .callout-practice .callout-title { color: #9CC3A3; }
.callout-practice ol { counter-reset: step; list-style: none; padding-left: 0; }
.callout-practice ol > li { counter-increment: step; position: relative; padding-left: 2.6em; margin: .8em 0; }
.callout-practice ol > li::before { content: counter(step); position: absolute; left: 0; top: .1em; width: 1.8em; height: 1.8em; border-radius: 50%; display: grid; place-items: center; font: 600 .8rem/1 var(--sans); color: var(--paper); background: #6B8F71; }
.callout-modern { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, var(--card)), var(--card)); }
.callout-modern .callout-title::before { content: '◐ '; }
.callout-ancient { background: var(--paper-2); }

.figure { margin: 2.2em 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: center; }
.figure svg { width: 100%; max-width: 560px; height: auto; }
.figure figcaption { font-size: .86rem; color: var(--muted); margin-top: 1rem; line-height: 1.6; text-align: left; }
.orbit-body { fill: var(--paper-2); stroke: var(--line); stroke-width: 1.5; }
.orbit-du { fill: none; stroke: var(--seal); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; animation: flow 2.4s linear infinite; }
.orbit-ren { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; animation: flow 2.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -36; } }
.orbit-arrow { fill: var(--ink-2); }
.orbit-pt { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.figure text { font: 500 11px var(--sans); fill: var(--ink-2); }
.orbit-name { font-size: 12px !important; letter-spacing: .12em; fill: var(--muted) !important; text-anchor: middle; }
.tr-axis { stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 5; }
.tr-c { fill: none; stroke-width: 2; }
.tr-c0 { stroke: var(--gold); } .tr-c1 { stroke: var(--ink-2); } .tr-c2 { stroke: var(--seal); }
.tr-a { font: 600 15px var(--serif) !important; fill: var(--ink) !important; }
.tr-b { font-size: 12px !important; fill: var(--muted) !important; }

.tags { margin-top: 3rem !important; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; color: var(--ink-2); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 2.4rem !important; padding-top: 2rem; border-top: 1px solid var(--line); }
.prevnext a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; font: 500 1.08rem/1.35 var(--serif); }
.prevnext a:hover { border-color: var(--gold); }
.pn-next { text-align: right; }
.related { padding: 20px 0 90px; }

/* ---------- Glossary ---------- */
.glossary { padding: 2rem 0 80px; }
.gloss-group { margin-bottom: 3rem; }
.gloss-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.gloss-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.gloss-item[hidden] { display: none; }
.gloss-item dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: .5rem; }
.gloss-zh { font: 600 1.35rem/1.2 var(--serif-zh); }
.gloss-py { font-style: italic; color: var(--muted); font-size: .9rem; }
.gloss-en { flex-basis: 100%; font: 500 1.12rem/1.3 var(--serif); color: var(--gold-deep); }
.gloss-item dd { margin: 0; font-size: .92rem; line-height: 1.6; }
.gloss-item dd p { margin: 0 0 .4rem; }

/* ---------- Timeline ---------- */
.timeline { padding: 2rem 0 90px; }
.tl-legend { display: flex; justify-content: center; gap: 30px; margin-bottom: 2rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.tl-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; border: 2px solid var(--gold); }
.tl-legend .is-west::before { border-color: var(--ink-2); }
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-item { position: relative; width: 50%; padding: 0 44px 28px 0; }
.tl-item.is-west { margin-left: 50%; padding: 0 0 28px 44px; }
.tl-dot { position: absolute; top: 22px; right: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--gold); z-index: 1; }
.tl-item.is-west .tl-dot { left: -7px; right: auto; border-color: var(--ink-2); }
.tl-card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; text-decoration: none; transition: border-color .2s, transform .2s; }
.tl-card:hover { border-color: var(--gold); transform: translateY(-2px); color: inherit; }
.tl-item.is-east .tl-card { text-align: right; }
.tl-card .tl-year { font: 600 .78rem/1 var(--sans); color: var(--gold-deep); letter-spacing: .1em; }
.tl-card strong { font: 500 1.3rem/1.25 var(--serif); }
html[lang='zh-CN'] .tl-card strong { font-family: var(--serif-zh); font-size: 1.08rem; }
@media (max-width: 760px) {
  .tl::before { left: 8px; }
  .tl-item, .tl-item.is-west { width: auto; margin-left: 0; padding: 0 0 22px 36px; }
  .tl-dot, .tl-item.is-west .tl-dot { left: 1px; right: auto; }
  .tl-item.is-east .tl-card { text-align: left; }
}

/* ---------- Search ---------- */
.search { padding: 2rem 0 90px; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results a { display: block; padding: 18px 4px; text-decoration: none; }
.search-results .sr-sec { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.search-results .sr-title { display: block; font: 500 1.3rem/1.3 var(--serif); margin: 2px 0 4px; }
.search-results .sr-text { color: var(--ink-2); font-size: .92rem; }
.search-results mark { background: rgba(184, 134, 85, .28); color: inherit; border-radius: 2px; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 80px 0 120px; }
.nf-enso { width: 180px; height: 180px; color: var(--ink); opacity: .2; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 40px; background: var(--paper-2); border-top: 1px solid var(--line-2); padding-bottom: 40px; }
.mountains { position: absolute; left: 0; right: 0; top: -100px; width: 100%; height: 100px; fill: var(--paper-2); pointer-events: none; }
.mountains path { fill: var(--ink); }
.footer-inner { display: grid; grid-template-columns: 1.3fr 2fr; gap: 40px; padding-top: 56px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-mark { width: 44px; height: 44px; flex-shrink: 0; }
.footer-brand p { margin: .4rem 0 0; max-width: 30em; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 24px; font-size: .9rem; align-content: start; }
.footer-nav a { text-decoration: none; color: var(--ink-2); }
.footer-nav a:hover { color: var(--gold-deep); }
.footer-copy { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 20px; margin: 0; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } .footer-nav { grid-template-columns: 1fr 1fr; } }

/* ---------- Age gate ---------- */
.age-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--paper) 70%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.age-gate[hidden] { display: none; }
.age-card { max-width: 480px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 40px 34px 28px; box-shadow: var(--shadow); }
.age-mark { width: 64px; height: 64px; margin-bottom: 1rem; animation: spin 30s linear infinite; }
.age-card h2 { font-size: 2rem; }
.age-card p { color: var(--ink-2); font-size: .95rem; }
.age-card .btn-row { justify-content: center; margin: 1.6rem 0 1rem; }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .article-aside, .prevnext, .related, .progress, .age-gate, .tags { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .article-layout { display: block; padding: 0; }
  .callout { break-inside: avoid; }
}
