:root {
  --bg: #f4f0e8;
  --panel: #fbf8f2;
  --panel-2: #ebe4d8;
  --ink: #1d191f;
  --muted: #6d6570;
  --line: #d7cfc2;
  --accent: #562268;
  --accent-2: #713685;
  --accent-soft: #eee3f0;
  --gold: #a77b23;
  --red: #8f363a;
  --shadow: 0 16px 45px rgba(47, 28, 48, .09);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
}

:root[data-theme="dark"] {
  --bg: #161319;
  --panel: #201b23;
  --panel-2: #28212c;
  --ink: #f1edf2;
  --muted: #b3a9b5;
  --line: #3e3542;
  --accent: #c68bd3;
  --accent-2: #dda6e7;
  --accent-soft: #302137;
  --gold: #d5ae58;
  --red: #de8b90;
  --shadow: 0 18px 55px rgba(0, 0, 0, .24);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #161319;
    --panel: #201b23;
    --panel-2: #28212c;
    --ink: #f1edf2;
    --muted: #b3a9b5;
    --line: #3e3542;
    --accent: #c68bd3;
    --accent-2: #dda6e7;
    --accent-soft: #302137;
    --gold: #d5ae58;
    --red: #de8b90;
    --shadow: 0 18px 55px rgba(0, 0, 0, .24);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--bg); }
a { color: var(--accent-2); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .7rem 1rem; color: #fff; background: #4d1d5c; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: .7rem max(1rem, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.brand strong { display: block; font: 850 1.12rem/1.1 var(--serif); letter-spacing: .12em; }
.brand small { display: block; margin-top: .22rem; color: var(--muted); font-size: .6rem; letter-spacing: .17em; }
nav { display: flex; align-items: center; gap: 1.2rem; }
nav > a { color: var(--ink); font-size: .85rem; font-weight: 700; text-decoration: none; }
.icon-button, .search-button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); cursor: pointer; }
.icon-button { width: 40px; font-size: 1rem; }
.search-button { display: inline-flex; gap: .4rem; align-items: center; padding: .45rem .7rem; }
.search-button kbd { color: var(--muted); font-size: .65rem; }

main { min-height: calc(100vh - 250px); }
.loading { display: grid; min-height: 55vh; place-items: center; color: var(--muted); }
.kicker, .eyebrow { color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 570px;
  padding: 5rem max(1.2rem, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0 0 0 auto; width: 58%; background: url("banner_3.png") center / cover no-repeat; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, var(--bg) 0 43%, color-mix(in srgb, var(--bg) 92%, transparent) 52%, color-mix(in srgb, var(--bg) 25%, transparent) 72%, transparent 100%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 680px; }
.hero .eyebrow { font-size: 1.36rem; letter-spacing: .12em; }
.hero h1 { margin: .7rem 0 1.2rem; font: 950 clamp(4rem, 9vw, 7.4rem)/.95 var(--serif); letter-spacing: .04em; }
.hero h1 span { display: inline-block; margin-left: .12em; color: var(--accent); }
.hero-copy > p { max-width: 43rem; margin: 0; color: var(--muted); font: 400 clamp(1rem, 2vw, 1.3rem)/1.85 var(--serif); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .84rem; font-weight: 800; text-decoration: none; background: transparent; cursor: pointer; }
.button.primary { color: #fff; background: #562268; }
.button.ink { border-color: var(--ink); color: var(--bg); background: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 960px; margin: -34px auto 0; border: 1px solid var(--line); border-radius: 14px; position: relative; z-index: 2; background: var(--panel); box-shadow: var(--shadow); }
.stats div { padding: 1.1rem 1.3rem; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats strong { display: block; color: var(--accent); font: 850 1.55rem/1.1 var(--serif); }
.stats span { color: var(--muted); font-size: .72rem; }

.section { max-width: 1120px; margin: 0 auto; padding: 5.5rem 1.2rem; }
.section-head { display: flex; gap: 2rem; align-items: end; justify-content: space-between; margin-bottom: 2rem; }
.section-head h2 { margin: .32rem 0 0; font: 900 clamp(2.1rem, 4.5vw, 3.5rem)/1.1 var(--serif); }
.section-head p { max-width: 34rem; margin: 0; color: var(--muted); line-height: 1.75; }
.text-link { font-weight: 800; text-decoration: none; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature-card, .archive-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.feature-card { min-height: 310px; padding: 1.35rem; }
.feature-card:nth-child(2) { color: #fff; border-color: #562268; background: #562268; }
.feature-card:nth-child(3) { color: #211a0b; border-color: #ceb16e; background: #d8b85f; }
.feature-card:hover, .archive-card:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--shadow); }
.card-top { display: flex; gap: .5rem; align-items: center; justify-content: space-between; color: var(--muted); font-size: .68rem; font-weight: 700; }
.feature-card:nth-child(2) .card-top, .feature-card:nth-child(2) p, .feature-card:nth-child(2) .card-foot { color: #e6d9e9; }
.feature-card:nth-child(3) .card-top, .feature-card:nth-child(3) p, .feature-card:nth-child(3) .card-foot { color: #594718; }
.feature-card h3, .archive-card h3 { margin: auto 0 .75rem; font: 850 1.4rem/1.3 var(--serif); }
.feature-card p, .archive-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.card-foot { display: flex; justify-content: space-between; margin-top: 1.4rem; color: var(--muted); font-size: .72rem; }

.timeline-section { max-width: none; padding-inline: max(1.2rem, calc((100vw - 1120px) / 2)); background: var(--panel-2); }
.timeline { max-width: 900px; }
.milestone { display: grid; grid-template-columns: 90px 20px 1fr; gap: 1rem; color: var(--ink); text-decoration: none; }
.milestone time { padding-top: .18rem; color: var(--accent); font: 850 1.25rem/1 var(--serif); }
.timeline-dot { position: relative; }
.timeline-dot::before { content: ""; position: absolute; top: .45rem; bottom: -2rem; left: 50%; width: 1px; background: var(--line); }
.timeline-dot::after { content: ""; position: absolute; top: .28rem; left: calc(50% - 5px); width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--panel-2); }
.milestone:last-child .timeline-dot::before { display: none; }
.milestone > div { padding: 0 0 2.3rem 1rem; }
.milestone h3 { display: inline; margin: 0 0 0 .65rem; font: 800 1.2rem/1.35 var(--serif); }
.milestone p { margin: .55rem 0 0; color: var(--muted); line-height: 1.65; }

.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.topic-grid a { display: flex; justify-content: space-between; min-height: 84px; padding: 1.1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; background: var(--panel); }
.topic-grid a:hover { background: var(--accent-soft); }
.topic-grid strong { font-family: var(--serif); }
.topic-grid span { color: var(--muted); font-size: .74rem; }

.wild-section { max-width: none; padding-inline: max(1.2rem, calc((100vw - 1120px) / 2)); background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg)); }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.archive-grid.large { grid-template-columns: repeat(3, 1fr); }
.archive-card { min-height: 230px; padding: 1.25rem; }
.section-more { margin: 2rem 0 0; text-align: center; }
.principle { padding: 7rem 1.2rem; text-align: center; }
.principle blockquote { max-width: 850px; margin: .8rem auto; color: var(--accent); font: 900 clamp(2rem, 5vw, 4rem)/1.35 var(--serif); }
.principle p { color: var(--muted); }

.confidence { display: inline-flex; align-items: center; width: max-content; padding: .2rem .48rem; border: 1px solid currentColor; border-radius: 999px; font-size: .66rem; font-weight: 800; line-height: 1.2; }
.confidence.verified { color: #247048; }
.confidence.likely { color: #8a6a1f; }
.confidence.disputed { color: var(--red); }
.confidence.unverified { color: var(--muted); border-style: dashed; }
.feature-card:nth-child(2) .confidence, .feature-card:nth-child(3) .confidence { color: inherit; }

.page-head { max-width: 1120px; margin: 0 auto; padding: 5rem 1.2rem 2.5rem; }
.page-head h1 { margin: .5rem 0 1rem; font: 950 clamp(3rem, 7vw, 5.8rem)/1 var(--serif); }
.page-head p { max-width: 740px; color: var(--muted); font: 1.02rem/1.8 var(--serif); }
.archive-shell { max-width: 1120px; margin: 0 auto; padding: 0 1.2rem 6rem; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.filters label { color: var(--muted); font-size: .7rem; font-weight: 750; }
.filters input, .filters select { width: 100%; min-height: 42px; margin-top: .4rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--bg); outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.archive-summary { padding: 1.2rem 0 .7rem; color: var(--muted); font-size: .78rem; }
.event-list { border-top: 1px solid var(--line); }
.event-card { display: grid; grid-template-columns: 78px 1fr 30px; gap: 1.2rem; align-items: start; padding: 1.25rem .4rem; border-bottom: 1px solid var(--line); }
.event-card > time { display: flex; align-items: baseline; color: var(--accent); }
.event-card > time strong { font: 850 1.65rem/1 var(--serif); }
.event-card > time span { margin-left: .2rem; color: var(--muted); font-size: .68rem; writing-mode: vertical-rl; }
.event-meta { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .7rem; }
.event-card h3 { margin: .45rem 0 .3rem; font: 800 1.08rem/1.4 var(--serif); }
.event-card h3 a { color: var(--ink); text-decoration: none; }
.event-card p { max-width: 760px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.event-arrow { align-self: center; color: var(--gold); font-size: 1.2rem; text-decoration: none; }
.load-more-wrap { text-align: center; }
.empty-state { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.confidence-legend { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; margin-bottom: 2rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.confidence-legend > span { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .75rem; }

.article-wrap { max-width: 1160px; margin: 0 auto; padding: 2rem 1.2rem 6rem; }
.breadcrumbs { display: flex; gap: .7rem; margin: 1rem 0 3rem; color: var(--muted); font-size: .78rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 250px; gap: 5rem; align-items: start; }
.article-head { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: .6rem 0 1rem; font: 950 clamp(2.7rem, 6vw, 5rem)/1.08 var(--serif); letter-spacing: .01em; }
.article-head > p { margin: 0; color: var(--muted); font: 1.1rem/1.85 var(--serif); }
.article-meta { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-bottom: 1.2rem; }
.article-meta .kind, .article-meta time { color: var(--muted); font-size: .72rem; }
.article-section { padding-top: 2.3rem; }
.article-section h2, .sources h2 { margin: 0 0 1rem; font: 850 1.55rem/1.35 var(--serif); }
.article-section p { margin: 0 0 1.1rem; font: 1rem/1.95 var(--serif); text-align: justify; }
.sources { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.sources ol { margin: 0; padding-left: 1.3rem; }
.sources li { margin: .8rem 0; color: var(--muted); line-height: 1.6; }
.sources li span { display: block; font-size: .75rem; }
.article-aside { position: sticky; top: 100px; }
.aside-box { margin-bottom: 1rem; padding: 1.1rem; border-top: 3px solid var(--accent); background: var(--panel-2); }
.aside-label { display: block; margin-bottom: .7rem; font: 800 .78rem/1 var(--serif); }
.aside-box p, .aside-box li { color: var(--muted); font-size: .76rem; line-height: 1.65; }
.aside-box ul { margin: 0; padding-left: 1rem; }
.confidence-box .confidence { margin-bottom: .2rem; }
.not-found { max-width: 700px; margin: auto; padding: 8rem 1.2rem; text-align: center; }
.not-found strong { display: block; color: var(--gold); font: 900 6rem/1 var(--serif); }

.site-footer { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 2rem; align-items: center; padding: 2.5rem max(1.2rem, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: var(--panel); font-size: .72rem; }
.site-footer p { margin: .6rem 0 0; line-height: 1.55; }
.institution-logo { width: min(100%, 420px); height: auto; }
.institution-logo-light { display: none; }
:root[data-theme="dark"] .institution-logo-dark { display: none; }
:root[data-theme="dark"] .institution-logo-light { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .institution-logo-dark { display: none; }
  :root[data-theme="auto"] .institution-logo-light { display: block; }
}
.operator { display: flex; gap: .8rem; align-items: center; }
.operator img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; }
.operator strong { color: var(--ink); }
.footer-links { display: grid; gap: .4rem; text-align: right; }

dialog { width: min(700px, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel); box-shadow: 0 24px 90px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20, 14, 23, .62); backdrop-filter: blur(4px); }
.search-head { display: flex; justify-content: space-between; padding: 1rem 1.2rem .4rem; }
.search-head label { font: 850 1.08rem/1.4 var(--serif); }
.search-head button { border: 0; color: var(--muted); background: none; font-size: 1.4rem; cursor: pointer; }
#search-input { width: calc(100% - 2rem); margin: .5rem 1rem 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--bg); outline: none; }
#search-input:focus { border-color: var(--accent); }
.search-results { max-height: 56vh; overflow: auto; padding: 0 1rem 1rem; }
.search-result { display: block; padding: .85rem; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-result > span { color: var(--gold); font-size: .65rem; font-weight: 800; }
.search-result strong { display: block; margin-top: .2rem; font-family: var(--serif); }
.search-result small { display: block; margin-top: .25rem; color: var(--muted); line-height: 1.45; }

@media (max-width: 960px) {
  nav > a { display: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid, .archive-grid.large { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 2rem; }
  .article-aside { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; text-align: left; }
}

@media (max-width: 680px) {
  .site-header { min-height: 64px; }
  .brand img { width: 40px; height: 40px; }
  .brand strong { font-size: 1rem; }
  .brand small, .search-button span:not(:first-child), .search-button kbd { display: none; }
  nav { gap: .45rem; }
  .hero { min-height: auto; padding-block: 4rem; }
  .hero::before { width: 72%; background-position: 58% center; }
  .hero::after { background: linear-gradient(90deg, var(--bg) 0 28%, color-mix(in srgb, var(--bg) 90%, transparent) 48%, color-mix(in srgb, var(--bg) 45%, transparent) 100%); }
  .hero h1 { font-size: clamp(3.6rem, 18vw, 5.3rem); }
  .stats { grid-template-columns: repeat(2, 1fr); margin-inline: 1rem; }
  .stats div + div { border-left: 0; }
  .stats div:nth-child(even) { border-left: 1px solid var(--line); }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .section { padding-block: 4rem; }
  .section-head { align-items: start; flex-direction: column; }
  .feature-grid, .archive-grid, .archive-grid.large { grid-template-columns: 1fr; }
  .feature-card { min-height: 240px; }
  .filters { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 60px 1fr; gap: .8rem; }
  .event-arrow { display: none; }
  .milestone { grid-template-columns: 58px 16px 1fr; gap: .5rem; }
  .milestone > div { padding-left: .4rem; }
  .milestone h3 { display: block; margin: .5rem 0 0; }
  .article-aside { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
