/* ==========================================================================
   溧水知识门户 · lishui.org
   设计语言：志书界格 + 水墨。纸色为底，青绿为主，赭金为辅，朱红仅用于印。
   明暗两套主题由 :root[data-theme] 切换。
   ========================================================================== */

/* ---------- 令牌 ---------- */

:root {
  /* 画布与表面（暖纸） */
  --bg: #F6F4EE;
  --bg-soft: #FCFBF7;
  --surface: #FFFFFF;
  --surface-2: #F0EDE4;
  --surface-3: #E8E4D9;

  /* 文字：三级灰阶均满足 4.5:1 对比度，最小号元信息也读得清 */
  --ink: #16201D;
  --ink-2: #3B4A46;
  --ink-3: #566360;
  --ink-4: #66736F;

  /* 界格描边 */
  --line: #E1DED4;
  --line-strong: #C9C5B6;

  /* 主色：青绿（通识层） */
  --brand: #0E7C63;
  --brand-ink: #0A5C4A;
  --brand-soft: #E4F2ED;
  --brand-line: #BFE0D7;

  /* 辅色：赭金（功能层与非遗） */
  --gold: #8A6428;
  --gold-ink: #6B4C1B;
  --gold-soft: #F3EDDF;
  --gold-line: #E0D2B4;

  /* 印色：朱红，仅用于印与状态点 */
  --seal: #A8382A;

  /* 水色（用于地形示意） */
  --water: #7FA9C4;
  --water-deep: #4E7F9E;

  --shadow-sm: 0 1px 2px rgba(22, 32, 29, .05);
  --shadow: 0 1px 2px rgba(22, 32, 29, .04), 0 12px 30px -16px rgba(22, 32, 29, .22);
  --shadow-lg: 0 2px 4px rgba(22, 32, 29, .04), 0 30px 64px -28px rgba(22, 32, 29, .3);

  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 10px;

  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* 字阶 */
  --t-hero: clamp(2.6rem, 6.6vw, 5rem);
  --t-h2: clamp(1.75rem, 3.4vw, 2.7rem);
  --t-h3: 1.1875rem;
  --t-lead: clamp(1.0625rem, 1.3vw, 1.1875rem);
  --t-body: 1rem;
  --t-sm: .875rem;
  --t-xs: .75rem;

  --wrap: 1200px;
  --gutter: 26px;
  --topbar-h: 64px;

  /* 缓动签名：进场统一用它 */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0C1211;
  --bg-soft: #101716;
  --surface: #131B1A;
  --surface-2: #18211F;
  --surface-3: #1F2A28;

  --ink: #E9EEEC;
  --ink-2: #B3C0BC;
  --ink-3: #93A09B;
  --ink-4: #7C8984;

  --line: #222E2C;
  --line-strong: #34433E;

  --brand: #4CCBA4;
  --brand-ink: #8FE3C8;
  --brand-soft: #0F2C26;
  --brand-line: #1D463D;

  --gold: #D3AC6E;
  --gold-ink: #E6C892;
  --gold-soft: #26200F;
  --gold-line: #42381F;

  --seal: #DC6A57;

  --water: #5C86A2;
  --water-deep: #7FA9C4;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 34px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .55), 0 32px 68px -30px rgba(0, 0, 0, .9);

  color-scheme: dark;
}

/* ---------- 基础 ---------- */

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

/* 组件的 display 会盖掉浏览器默认的 [hidden]，筛选依赖它 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.75;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸纹：极淡，只提供触感，不参与识别 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: .02; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; }

svg { display: block; }

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

::selection { background: var(--brand-soft); color: var(--brand-ink); }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -160%);
  z-index: 200;
  padding: 10px 18px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--radius);
  font-size: var(--t-sm);
  text-decoration: none;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 26px;
}

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--brand);
  transition: width .12s linear;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}
.wordmark__mark {
  width: 30px; height: 30px;
  color: var(--brand);
  flex: none;
}
.wordmark__text {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.15;
}
.wordmark__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-4);
  line-height: 1.4;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  position: relative;
  padding: 8px 13px;
  font-size: var(--t-sm);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color .18s var(--ease-soft);
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 3px;
  height: 1.5px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .32s var(--ease);
}
.topnav a:hover { color: var(--ink); }
.topnav a:hover::after { transform: scaleX(1); }

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.langswitch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.langswitch a {
  padding: 5px 11px;
  font-size: var(--t-xs);
  font-family: var(--font-mono);
  letter-spacing: .08em;
  color: var(--ink-3);
  text-decoration: none;
  transition: background-color .18s var(--ease-soft), color .18s var(--ease-soft);
}
.langswitch a + a { border-left: 1px solid var(--line-strong); }
.langswitch a[aria-current="true"] {
  background: var(--brand);
  color: #FFFFFF;
}
.langswitch a:not([aria-current="true"]):hover { background: var(--surface-2); color: var(--ink); }

.iconbtn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .18s var(--ease-soft), color .18s var(--ease-soft), background-color .18s var(--ease-soft);
}
.iconbtn:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn__moon { display: none; }
:root[data-theme="dark"] .iconbtn__sun { display: none; }
:root[data-theme="dark"] .iconbtn__moon { display: block; }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* 首屏水墨：颜色全部走变量，深浅两套主题各画一遍 */
.hero__bg {
  --h-sky-1: #FCFBF7;
  --h-sky-2: #F6F4EE;
  --h-sky-3: #EFECE2;
  --h-far: #0E7C63;
  --h-near: #0A5C4A;
  --h-mist: #F6F4EE;
  --h-water-1: #7FA9C4;
  --h-water-2: #4E7F9E;
  --h-sun: #8A6428;
  --h-bridge: #8A6428;

  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}
:root[data-theme="dark"] .hero__bg {
  --h-sky-1: #121A19;
  --h-sky-2: #0F1615;
  --h-sky-3: #0A0F0E;
  --h-far: #4CCBA4;
  --h-near: #8FE3C8;
  --h-mist: #0C1211;
  --h-water-1: #5C86A2;
  --h-water-2: #7FA9C4;
  --h-sun: #D3AC6E;
  --h-bridge: #D3AC6E;
}
.hero__bg svg { width: 100%; height: 100%; }

/* 首屏印章：全站唯一的朱红，用作署名 */
.hero__seal {
  position: absolute;
  right: var(--gutter);
  top: clamp(70px, 12vh, 130px);
  z-index: -1;
  width: 76px;
  height: 76px;
  color: var(--seal);
  opacity: .82;
  pointer-events: none;
}
.hero__seal svg { width: 100%; height: 100%; }
.hero__seal text {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 600;
  fill: currentColor;
  text-anchor: middle;
}

/* 界格：首屏竖线 */
.hero__rule {
  position: absolute;
  inset: 0;
  z-index: -1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.hero__rule span {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line) 22%, var(--line) 78%, transparent);
  opacity: .7;
}
/* 竖线对齐 .wrap 的内容区，而不是容器外沿 */
.hero__rule span:nth-child(1) { left: var(--gutter); }
.hero__rule span:nth-child(2) { left: calc(var(--gutter) + (100% - var(--gutter) * 2) * .25); }
.hero__rule span:nth-child(3) { left: calc(var(--gutter) + (100% - var(--gutter) * 2) * .5); }
.hero__rule span:nth-child(4) { left: calc(var(--gutter) + (100% - var(--gutter) * 2) * .75); }
.hero__rule span:nth-child(5) { left: calc(100% - var(--gutter)); }

.hero__inner {
  position: relative;
  padding: clamp(64px, 11vh, 124px) 0 clamp(56px, 9vh, 96px);
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand-ink);
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--seal);
  flex: none;
}

.hero__title {
  margin-top: 22px;
  font-size: var(--t-hero);
  line-height: 1.04;
  letter-spacing: -.022em;
}
.hero__title em {
  font-style: normal;
  color: var(--brand);
  position: relative;
  white-space: nowrap;
}
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .04em;
  height: .07em;
  background: var(--gold);
  opacity: .55;
  transform: scaleX(0);
  transform-origin: left;
  animation: brush 1.1s var(--ease) .75s forwards;
}
@keyframes brush { to { transform: scaleX(1); } }

.hero__lede {
  margin-top: 26px;
  max-width: 34em;
  font-size: var(--t-lead);
  line-height: 1.72;
  color: var(--ink-2);
}

/* 查找 */
.searchbar {
  position: relative;
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 7px 7px 7px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease-soft), box-shadow .2s var(--ease-soft);
}
.searchbar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.searchbar > svg {
  width: 17px; height: 17px;
  color: var(--ink-4);
  flex: none;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--t-sm);
  color: var(--ink);
  padding: 9px 0;
}
.searchbar input::placeholder { color: var(--ink-4); }
.searchbar input:focus { outline: none; }
.searchbar__btn {
  flex: none;
  padding: 9px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #FFFFFF;
  font: inherit;
  font-size: var(--t-sm);
  cursor: pointer;
  transition: background-color .18s var(--ease-soft);
}
.searchbar__btn:hover { background: var(--brand-ink); }

.searchhint {
  margin-top: 12px;
  font-size: var(--t-xs);
  color: var(--ink-4);
  max-width: 44em;
}

/* 滚动提示 */
.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-4);
  writing-mode: vertical-rl;
  text-decoration: none;
}
.hero__scroll::after {
  content: "";
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
}

/* ---------- 章节骨架 ---------- */

.section { padding: clamp(64px, 9vw, 108px) 0; }
.section--soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px 56px;
  align-items: end;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 44px;
}
.section__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.section__title { font-size: var(--t-h2); }
.section__note {
  font-size: var(--t-sm);
  line-height: 1.8;
  color: var(--ink-3);
  max-width: 46em;
}

/* ---------- 溧水在哪里 ---------- */

.geo {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: clamp(30px, 4vw, 62px);
  align-items: start;
}

.geo__map {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 30% 12%, var(--surface) 0%, var(--surface-2) 100%);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.geo__map svg { width: 100%; height: auto; }
.geo__cap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--ink-4);
}

.geo__body { padding-top: 6px; }
.geo__title { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
.geo__text {
  margin-top: 18px;
  font-size: var(--t-sm);
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 34em;
}

.facts {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}
.fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 18px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.fact__label {
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.fact__value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--brand-ink);
  white-space: nowrap;
}
.fact__value small {
  font-family: var(--font-sans);
  font-size: .6875rem;
  font-weight: 400;
  color: var(--ink-4);
  margin-left: 3px;
  letter-spacing: .04em;
}

/* 地形示意：等高线、湖泊、河道、地点点 */
.geo__map svg text {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--ink-2);
}
.geo__map svg text.maphint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  fill: var(--ink-4);
}

.contour {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.6;
}
.contour--soft {
  stroke: var(--line);
  stroke-width: 1.2;
}

.lake {
  fill: var(--water);
  fill-opacity: .3;
  stroke: var(--water-deep);
  stroke-opacity: .45;
  stroke-width: 1.3;
}

/* 河道：进场时像墨迹一样淌出来 */
.river {
  fill: none;
  stroke: var(--water-deep);
  stroke-opacity: .6;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: flow 8s var(--ease-soft) .35s forwards;
}
.river--slow { animation-duration: 12s; animation-delay: .8s; }
@keyframes flow { to { stroke-dashoffset: 0; } }

.dot { fill: var(--ink-3); }
.dot--ink { fill: var(--ink-2); }
.dot--brand { fill: var(--brand); }
.dot--gold { fill: var(--gold); }
.dot--seal { fill: var(--seal); }

/* ---------- 知识专题 ---------- */

.filterbar {
  display: none;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 10px 16px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-soft);
  font-size: var(--t-sm);
  color: var(--brand-ink);
}
.filterbar[data-visible="true"] { display: flex; }
.filterbar button {
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-ink);
  font: inherit;
  font-size: var(--t-xs);
  cursor: pointer;
  transition: background-color .18s var(--ease-soft);
}
.filterbar button:hover { background: var(--surface-2); }

.topics {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: 18px;
}

.topic {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 32px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .3s var(--ease-soft), box-shadow .3s var(--ease-soft), transform .3s var(--ease);
}
.topic::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.topic:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.topic:hover::before { transform: scaleX(1); }

.topic--lead {
  grid-row: span 2;
  padding: 38px 40px 34px;
  background:
    radial-gradient(130% 100% at 88% 0%, var(--brand-soft) 0%, transparent 58%),
    var(--surface);
}
.topic--lead .topic__title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.topic--lead .topic__desc { font-size: var(--t-body); max-width: 40ch; }

.topic__glyph {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  margin-bottom: 20px;
}
.topic__glyph svg { width: 19px; height: 19px; }
.topic--lead .topic__glyph { width: 46px; height: 46px; }
.topic--lead .topic__glyph svg { width: 23px; height: 23px; }

.topic__title {
  font-size: var(--t-h3);
  letter-spacing: -.005em;
}
.topic__desc {
  margin-top: 12px;
  font-size: var(--t-sm);
  line-height: 1.78;
  color: var(--ink-2);
}
.topic__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
}
.chip {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--t-xs);
  color: var(--ink-3);
  background: var(--bg-soft);
}
.topic--lead .chip { border-color: var(--brand-line); color: var(--brand-ink); background: var(--brand-soft); }

.noresult {
  display: none;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.noresult[data-visible="true"] { display: block; }

/* ---------- 六个维度 ---------- */

.dims {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.dim {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 20px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  overflow: hidden;
  transition: background-color .35s var(--ease-soft);
}
.dim::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.dim:hover { background: var(--brand-soft); }
.dim:hover::after { transform: scaleX(1); }

.dim__char {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1;
  color: var(--ink);
  transition: color .35s var(--ease-soft), transform .45s var(--ease);
}
.dim:hover .dim__char { color: var(--brand); transform: translateY(-2px); }

.dim__label {
  font-size: var(--t-xs);
  letter-spacing: .2em;
  color: var(--gold);
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.dim__site {
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---------- 站点矩阵 ---------- */

.group + .group { margin-top: 52px; }

.group__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
}
.group__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}
.group--app .group__dot { background: var(--gold); }
.group__title {
  font-size: 1.0625rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: .01em;
}
.group__meta {
  font-size: var(--t-xs);
  color: var(--ink-4);
}
.group__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.rows { border-top: 1px solid var(--line-strong); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.15fr) auto;
  gap: 6px 26px;
  align-items: center;
  padding: 20px 20px 20px 22px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .3s var(--ease-soft);
}
.row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--brand);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .45s var(--ease);
}
.group--app .row::before { background: var(--gold); }
.row:hover { background: var(--bg-soft); }
.row:hover::before { transform: scaleY(1); }

.row__no {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.row__name {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -.005em;
  transition: color .25s var(--ease-soft);
}
.row:hover .row__name { color: var(--brand-ink); }
.group--app .row:hover .row__name { color: var(--gold-ink); }
.row__alt {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 3px;
}
.row__desc {
  font-size: var(--t-sm);
  color: var(--ink-3);
  line-height: 1.7;
}
.row__end {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}
.row__host {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  white-space: nowrap;
}
.badge {
  padding: 3px 9px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  font-size: var(--t-xs);
  color: var(--brand-ink);
  background: var(--brand-soft);
  white-space: nowrap;
}
.badge--later {
  border-color: var(--line);
  color: var(--ink-3);
  background: var(--bg-soft);
}
.status {
  font-size: var(--t-xs);
  color: var(--ink-4);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status[data-status="building"] { color: var(--seal); }
.status[data-status="building"]::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--seal);
}

/* ---------- 编纂凡例 ---------- */

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 clamp(30px, 4vw, 64px);
}
.rule-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.rule-item__no {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  /* 中文数字与罗马数字宽度不同，定宽让各条正文对齐 */
  min-width: 1.5em;
}
.rule-item__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.005em;
}
.rule-item__text {
  grid-column: 2;
  margin-top: 9px;
  font-size: var(--t-sm);
  line-height: 1.8;
  color: var(--ink-2);
}
.rule-item__text code {
  font-family: var(--font-mono);
  font-size: .8125em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-soft);
  color: var(--ink);
}

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--line-strong);
  background: var(--bg-soft);
  padding: 60px 0 30px;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px clamp(30px, 4vw, 64px);
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.footer__brand svg { width: 28px; height: 28px; color: var(--brand); }
.footer__about {
  margin-top: 18px;
  max-width: 40em;
  font-size: var(--t-sm);
  line-height: 1.8;
  color: var(--ink-3);
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 16px;
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer__links a {
  font-size: var(--t-sm);
  color: var(--ink-2);
  text-decoration: none;
  width: fit-content;
  transition: color .18s var(--ease-soft);
}
.footer__links a:hover { color: var(--brand-ink); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--ink-4);
}
.footer__bottom a { color: var(--ink-3); }

/* ---------- 进场 ---------- */
/* 默认可见；只有脚本就位（html.js）才隐藏，保证失败时内容不丢 */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity .7s var(--ease) var(--reveal-delay, 0ms),
    transform .7s var(--ease) var(--reveal-delay, 0ms);
}

/* 首屏文字：纯 CSS 入场，不依赖脚本 */
.hero__inner > * {
  animation: rise .8s var(--ease) both;
}
.hero__inner > *:nth-child(1) { animation-delay: .04s; }
.hero__inner > *:nth-child(2) { animation-delay: .1s; }
.hero__inner > *:nth-child(3) { animation-delay: .18s; }
.hero__inner > *:nth-child(4) { animation-delay: .26s; }
.hero__inner > *:nth-child(5) { animation-delay: .32s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .section__head { grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  .geo { grid-template-columns: minmax(0, 1fr); }
  .dims { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .topnav { display: none; }
  .hero__scroll { display: none; }
  .hero__seal { display: none; }
  .topics { grid-template-columns: minmax(0, 1fr); }
  .topic--lead { grid-row: auto; }
  .row { grid-template-columns: 34px minmax(0, 1fr); gap: 8px 16px; padding: 18px 16px 18px 18px; }
  .row__desc { grid-column: 2; }
  .row__end { grid-column: 2; justify-content: flex-start; }
  .row__host { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .searchbar { flex-wrap: wrap; padding: 12px; }
  .searchbar > svg { display: none; }
  .searchbar input { flex: 1 1 100%; padding: 4px 4px 10px; }
  .searchbar__btn { flex: 1 1 100%; }
  .topic { padding: 24px 22px 22px; }
  .topic--lead { padding: 28px 24px 26px; }
  .group__meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__title em::after { transform: scaleX(1); }
  .river { stroke-dashoffset: 0; }
}

@media print {
  .topbar, .hero__scroll, .hero__seal, .footer__grid > :not(:first-child) { display: none; }
  body::after { display: none; }
  .hero__bg { display: none; }
}
