/* 山河县记 · 陕西县域门户
 * 纸张底、墨色字、朱砂点睛；地图以地级市着色，县域页各自换纸。
 */

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

:root {
  --paper: #F3ECDD;
  --paper2: #FBF7EC;
  --paper3: #EDE4D0;
  --ink: #211E17;
  --ink2: #615948;
  --line: #D8CCB4;
  --line2: #C6B89C;
  --accent: #A8452F;
  --gold: #A9864B;
  --dark: #171913;
  --dark2: #20231B;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --head: 66px;
  --pad: clamp(18px, 4.4vw, 64px);
  --maxw: 1560px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(#8E7C5C .55px, transparent .75px);
  background-size: 3px 3px; opacity: .3;
}
header, main, footer, .mnav { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.2; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--paper2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
kbd {
  font-family: var(--sans); font-size: 10px; line-height: 1; padding: 4px 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; background: var(--paper2);
  color: var(--ink2); display: inline-block;
}
.skip-link { position: fixed; left: 12px; top: -70px; z-index: 300; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip-link:focus { top: 10px; }
.noscript-note { margin: 12px var(--pad) 0; padding: 10px 14px; border: 1px solid var(--line); background: var(--paper2); color: var(--ink2); font-size: 12px; line-height: 1.7; }
.noscript-note a { color: var(--accent); }

/* ── 顶栏 ─────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 120; height: var(--head);
  display: flex; align-items: center; gap: clamp(14px, 3vw, 44px);
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.site-head.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-seal {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--accent); color: var(--paper2); font-family: var(--serif); font-size: 18px; border-radius: 2px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 12%, transparent);
}
.brand-name { font-family: var(--serif); font-size: 17px; line-height: 1.05; letter-spacing: .1em; }
.brand-name small { display: block; font-family: var(--sans); font-size: 8.5px; letter-spacing: .26em; color: var(--ink2); margin-top: 4px; }
.site-nav { display: flex; gap: clamp(14px, 2.2vw, 30px); margin-left: 8px; }
.site-nav a { position: relative; font-size: 13px; letter-spacing: .12em; color: var(--ink2); padding: 6px 0; transition: color .2s; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--accent); transition: right .3s var(--ease); }
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.is-active::after { right: 0; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper2) 70%, transparent);
  font-size: 12px; color: var(--ink2); transition: border-color .2s, color .2s, background .2s;
}
.search-btn:hover { border-color: var(--accent); color: var(--ink); background: var(--paper2); }
.search-btn > span:first-child { font-size: 15px; line-height: 1; transform: translateY(-1px); }
.sound {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--ink2);
  transition: .25s;
}
.sound:hover { border-color: var(--accent); color: var(--ink); }
.sound.is-playing { background: var(--accent); border-color: var(--accent); color: var(--paper2); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 12px; }
.bars i { display: block; width: 2px; height: 5px; background: currentColor; border-radius: 1px; }
.sound.is-playing .bars i { animation: bar .9s var(--ease-io) infinite alternate; }
.sound.is-playing .bars i:nth-child(2) { animation-delay: -.35s; }
.sound.is-playing .bars i:nth-child(3) { animation-delay: -.62s; }
.sound.is-playing .bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes bar { from { height: 3px; } to { height: 12px; } }
.menu-btn { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 999px; place-items: center; place-content: center; gap: 5px; }
.menu-btn span { display: block; width: 15px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mnav {
  position: fixed; inset: var(--head) 0 auto 0; z-index: 110;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 18px var(--pad) 26px; box-shadow: 0 30px 60px -50px #000;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: .3s var(--ease);
}
.mnav.open { opacity: 1; transform: none; pointer-events: auto; }
.mnav nav { display: grid; }
.mnav nav a { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.5rem; }
.mnav nav a span { font-family: var(--sans); font-size: 10px; letter-spacing: .2em; color: var(--accent); align-self: center; }
.mnav-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; font-size: 12px; color: var(--ink2); }
.mnav-foot button { color: var(--accent); border-bottom: 1px solid currentColor; }

/* ── 首屏 ─────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) var(--pad) clamp(36px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(22px, 3.6vw, 56px); align-items: stretch;
  min-height: calc(100svh - var(--head));
}
.hero-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(8px, 3vh, 40px) 0; }
.eyebrow {
  display: flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: .26em;
  color: var(--ink2); margin: 0 0 clamp(18px, 3vh, 30px);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.hero h1 { display: flex; flex-direction: column; margin: 0 0 22px; }
.h1-small { font-family: var(--sans); font-size: 12px; letter-spacing: .52em; color: var(--accent); font-weight: 500; margin-bottom: 10px; }
.h1-big { font-size: clamp(3.5rem, 6.2vw, 6.4rem); line-height: .99; letter-spacing: .02em; font-weight: 700; }
.hero-lede { font-family: var(--serif); font-size: clamp(.95rem, 1.1vw, 1.05rem); line-height: 2; color: var(--ink2); max-width: 30em; margin-bottom: 26px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 26px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats dt { font-size: 9.5px; letter-spacing: .16em; color: var(--ink2); margin-bottom: 4px; }
.stats dd { margin: 0; font-family: var(--serif); font-size: clamp(1.35rem, 2vw, 1.8rem); font-variant-numeric: tabular-nums; line-height: 1; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--paper2);
  font-size: 12.5px; letter-spacing: .12em; transition: transform .25s var(--ease), background .25s;
}
.btn:hover { background: var(--accent); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.hero-hint { margin-top: 20px; font-size: 10.5px; line-height: 1.9; color: var(--ink2); letter-spacing: .04em; }
.hero-hint kbd { margin: 0 1px; }
.hint-touch { display: none; }
@media (hover: none), (max-width: 860px) {
  .hint-pointer, .hint-kb { display: none; }
  .hint-touch { display: inline; }
}

/* ── 地图 ─────────────────────────────────────────────── */
.atlas {
  position: relative; display: flex; flex-direction: column; min-height: 560px;
  border: 1px solid var(--line2); border-radius: 4px; background: var(--paper2);
  box-shadow: 0 30px 90px -70px #4A3B24, inset 0 0 0 1px color-mix(in srgb, #fff 40%, transparent);
  overflow: hidden;
}
.atlas::before { content: ""; position: absolute; inset: 6px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 2px; pointer-events: none; z-index: 5; }
.atlas-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); position: relative; z-index: 6;
  background: color-mix(in srgb, var(--paper2) 88%, transparent);
}
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; flex: 1; }
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .atlas-bar { flex-wrap: wrap; row-gap: 8px; }
  .filters { flex-wrap: wrap; overflow: visible; }
}
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; letter-spacing: .04em; color: var(--ink2); background: transparent;
  transition: .2s; white-space: nowrap;
}
.chip span { font-size: 9px; opacity: .62; font-variant-numeric: tabular-nums; }
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--chip, var(--line2)); }
.chip:hover { border-color: var(--line2); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper2); }
.chip.is-on span { opacity: .7; }
.atlas-tools { display: flex; gap: 4px; flex: none; }
.atlas-tools button {
  min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 3px;
  font-size: 12px; color: var(--ink2); background: var(--paper2); transition: .2s;
}
.atlas-tools button:hover { border-color: var(--accent); color: var(--accent); }
.atlas-tools button[data-zoom="reset"] { font-size: 10px; letter-spacing: .06em; }

.map-stage {
  position: relative; flex: 1; min-height: 460px; overflow: hidden; cursor: grab;
  touch-action: none; outline: none; user-select: none;
  background:
    radial-gradient(90% 70% at 45% 40%, color-mix(in srgb, #fff 55%, transparent), transparent 70%),
    radial-gradient(#B7A482 .6px, transparent .9px);
  background-size: auto, 4px 4px;
}
.map-stage:active { cursor: grabbing; }
.map-stage::before {
  content: "陝西 · 一百零七縣"; position: absolute; left: clamp(14px, 3.2vw, 44px); top: 50%;
  transform: translateY(-50%); writing-mode: vertical-rl; font-family: var(--serif);
  font-size: 11px; letter-spacing: .52em; color: var(--ink2); opacity: .3;
  pointer-events: none; z-index: 2;
}
.map-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sx-map { display: block; width: 100%; height: 100%; position: absolute; inset: 0; overflow: visible; }
.sx-map path.county {
  stroke: var(--paper2); stroke-width: 1.1; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; cursor: pointer;
  transition: fill .25s, opacity .3s, stroke .2s, filter .25s;
}
.sx-map path.county:hover, .sx-map path.county.hot { stroke: var(--ink); filter: brightness(1.06) saturate(1.08); }
.sx-map path.county.sel { stroke: var(--ink); stroke-width: 2.4; }
.sx-map path.county.dim { opacity: .12; pointer-events: none; }
.sx-map path.county:focus { outline: none; }
.sx-map text.city-label {
  font-family: var(--serif); font-weight: 600; fill: var(--ink); opacity: 0;
  font-size: calc(var(--lu, 2.6) * 12px);
  paint-order: stroke; stroke: var(--paper2); stroke-width: calc(var(--lu, 2.6) * 3px); stroke-linejoin: round;
  pointer-events: none; letter-spacing: .08em; transition: opacity .3s;
}
.sx-map.labels text.city-label { opacity: .88; }
.sx-map.clabels text.city-label { opacity: 0; }
.sx-map text.county-label {
  font-family: var(--sans); fill: var(--ink); opacity: 0;
  font-size: calc(var(--lu, 2.6) * 10.5px);
  paint-order: stroke; stroke: var(--paper2); stroke-width: calc(var(--lu, 2.6) * 2.6px); stroke-linejoin: round;
  pointer-events: none; transition: opacity .35s; letter-spacing: .04em;
}
.sx-map.clabels text.county-label { opacity: .9; }

.map-loading {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 12px; letter-spacing: .1em; color: var(--ink2); background: var(--paper2);
  transition: opacity .5s, visibility .5s;
}
.map-loading.done { opacity: 0; visibility: hidden; }
.spinner { width: 16px; height: 16px; border: 1.5px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-fail { position: absolute; inset: auto 20px 20px; z-index: 7; background: var(--paper); border: 1px solid var(--line); padding: 14px 16px; font-size: 12px; border-radius: 3px; }
.map-fail a { color: var(--accent); border-bottom: 1px solid currentColor; }

.map-tip {
  position: absolute; z-index: 9; transform: translate(-50%, calc(-100% - 14px));
  background: var(--ink); color: var(--paper2); padding: 7px 11px; border-radius: 3px;
  font-size: 11.5px; letter-spacing: .04em; pointer-events: none; white-space: nowrap;
  box-shadow: 0 10px 24px -14px #000;
}
.map-tip b { font-family: var(--serif); font-size: 13px; font-weight: 600; }
.map-tip span { opacity: .62; margin-left: 7px; font-size: 10px; }
.map-tip::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--ink); }

.map-badge {
  position: absolute; left: 18px; bottom: 40px; z-index: 3; display: flex; align-items: center; gap: 9px;
  font-size: 8px; letter-spacing: .34em; color: var(--ink2); opacity: .8; pointer-events: none;
}
.map-badge span { width: 28px; height: 28px; display: grid; place-items: center; background: var(--accent); color: var(--paper2); font-family: var(--serif); font-size: 15px; letter-spacing: 0; border-radius: 2px; }
.map-badge b { font-weight: 500; }
.map-scale { position: absolute; right: 14px; bottom: 10px; z-index: 3; font-size: 9px; letter-spacing: .12em; color: var(--ink2); opacity: .82; pointer-events: none; padding: 3px 7px; background: color-mix(in srgb, var(--paper2) 84%, transparent); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 2px; }
.map-status { position: absolute; left: 16px; top: 12px; z-index: 8; font-size: 10.5px; color: var(--ink2); letter-spacing: .06em; pointer-events: none; }

.atlas-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--line); font-size: 9.5px; letter-spacing: .05em; color: var(--ink2);
  background: color-mix(in srgb, var(--paper2) 90%, transparent); position: relative; z-index: 6;
}
.atlas-foot a { border-bottom: 1px solid var(--line2); }

/* 详情面板 */
.panel {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 15; width: min(360px, 88%);
  background: var(--paper2); border-left: 1px solid var(--line2);
  padding: 22px 22px 18px; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(102%); transition: transform .45s var(--ease);
  box-shadow: -30px 0 70px -50px #000;
}
.panel.open { transform: none; }
.panel-close {
  position: absolute; right: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); font-size: 17px; line-height: 1; display: grid; place-items: center; color: var(--ink2);
}
.panel-close:hover { border-color: var(--accent); color: var(--accent); }
.panel-kicker { font-size: 10px; letter-spacing: .2em; color: var(--accent); margin: 0 0 8px; padding-right: 34px; }
.panel h2 { font-size: 2.1rem; letter-spacing: .06em; line-height: 1.15; }
.panel-tag { font-family: var(--serif); font-size: 13.5px; line-height: 1.8; color: var(--ink2); margin: 8px 0 12px; }
.panel-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0 0 16px; }
.panel-chips li { font-size: 10px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink2); }
.panel-facts { margin: 0 0 14px; border-top: 1px solid var(--line); }
.panel-facts div { display: grid; grid-template-columns: 6.4em minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.panel-facts dt { color: var(--ink2); }
.panel-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.panel-facts dd.mono { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; }
.panel-block { margin-bottom: 10px; }
.panel-k { font-size: 9px; letter-spacing: .2em; color: var(--accent); margin: 0 0 4px; }
.panel-block p:last-child { font-size: 11.5px; line-height: 1.8; color: var(--ink2); }
.panel-wiki { font-size: 11px; line-height: 1.85; color: var(--ink2); border-left: 2px solid var(--line); padding-left: 10px; margin: 12px 0 14px; }
.panel-link {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ink); color: var(--paper2); padding: 12px 14px; border-radius: 3px;
  font-size: 12px; letter-spacing: .1em; transition: background .25s;
}
.panel-link:hover { background: var(--accent); }

/* ── 目录 ─────────────────────────────────────────────── */
.directory { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px, 8vw, 100px) var(--pad); }
.dir-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--line2); }
.kicker { font-size: 9.5px; letter-spacing: .3em; color: var(--accent); margin: 0 0 10px; }
.dir-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: .06em; }
.dir-lede { margin-top: 10px; font-size: 13px; color: var(--ink2); max-width: 46ch; }
.dir-tools { flex: none; }
.dir-search {
  display: flex; align-items: center; gap: 10px; width: min(340px, 80vw);
  border-bottom: 1px solid var(--ink); padding: 8px 0;
}
.dir-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); outline: none; }
.dir-search input::placeholder { color: color-mix(in srgb, var(--ink2) 72%, transparent); }
.dir-count { font-size: 10px; letter-spacing: .1em; color: var(--accent); font-variant-numeric: tabular-nums; }

.dir-filters { display: flex; gap: 6px; overflow-x: auto; padding: 16px 0 8px; scrollbar-width: none; position: sticky; top: var(--head); z-index: 30; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); }
.dir-filters::-webkit-scrollbar { display: none; }
.dir-filters .chip { height: 30px; }

.city-group { padding-top: 34px; }
.city-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.city-bar { width: 26px; height: 2px; background: var(--city); }
.city-head h3 { font-size: 1.35rem; letter-spacing: .1em; }
.city-theme { font-size: 9px; letter-spacing: .18em; color: var(--ink2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px; }
.city-n { margin-left: auto; font-size: 10px; letter-spacing: .12em; color: var(--ink2); font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 14px; }
.ccard {
  position: relative; display: flex; flex-direction: column; min-height: 176px;
  padding: 15px 15px 13px; border: 1px solid var(--line); background: color-mix(in srgb, var(--paper2) 76%, transparent);
  transition: transform .3s var(--ease), border-color .25s, background .25s, box-shadow .3s;
  overflow: hidden;
}
.ccard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); opacity: .85; transition: height .3s var(--ease); }
.ccard:hover { transform: translateY(-4px); border-color: var(--c); background: var(--paper2); box-shadow: 0 24px 44px -36px #3B2E1B; }
.ccard:hover::before { height: 5px; }
.ccard-top { display: flex; justify-content: space-between; align-items: center; font-size: 9px; letter-spacing: .14em; color: var(--ink2); margin-bottom: 12px; }
.ccard-city { color: var(--c); }
.ccard-code { font-variant-numeric: tabular-nums; opacity: .55; }
.ccard-name { font-family: var(--serif); font-size: 1.55rem; line-height: 1.2; letter-spacing: .06em; margin-bottom: 6px; }
.ccard-tag { font-size: 11px; line-height: 1.65; color: var(--ink2); flex: 1; }
.ccard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent); font-size: 9px; letter-spacing: .08em; color: var(--ink2); }
.ccard-foot .arrow { color: var(--c); font-size: 13px; transition: transform .25s var(--ease); }
.ccard:hover .arrow { transform: translateX(3px); }
.dir-empty { padding: 48px 0; text-align: center; color: var(--ink2); font-size: 13px; }
.dir-empty button { color: var(--accent); border-bottom: 1px solid currentColor; margin-left: 8px; }

/* ── 站群 ─────────────────────────────────────────────── */
.legacy { background: var(--dark); color: #EDE4D2; padding: clamp(64px, 9vw, 110px) var(--pad); position: relative; overflow: hidden; }
.legacy::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#C7B489 .5px, transparent .8px); background-size: 4px 4px; opacity: .12; pointer-events: none; }
.legacy-inner { max-width: var(--maxw); margin: 0 auto; position: relative; }
.legacy-head { max-width: 720px; margin-bottom: 40px; }
.kicker.light { color: #C7906F; }
.legacy-head h2 { font-size: clamp(2rem, 3.8vw, 3.2rem); letter-spacing: .04em; color: #F4EDDD; }
.legacy-head p { margin-top: 14px; font-size: 13px; line-height: 1.95; color: #B5AC97; }
.legacy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lcard {
  position: relative; display: flex; flex-direction: column; min-height: 220px;
  border: 1px solid #34372C; padding: 18px; background: color-mix(in srgb, var(--dark2) 70%, transparent);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.lcard:hover { transform: translateY(-4px); border-color: #8E6A45; background: var(--dark2); }
.lcard-k { font-size: 9px; letter-spacing: .2em; color: #9A8E76; display: flex; justify-content: space-between; }
.lcard-k em { font-style: normal; color: #C7906F; border: 1px solid #6A4A36; padding: 1px 6px; border-radius: 999px; letter-spacing: .1em; }
.lcard-name { font-family: var(--serif); font-size: 1.8rem; letter-spacing: .08em; color: #F4EDDD; margin: 18px 0 2px; }
.lcard-full { font-size: 10.5px; letter-spacing: .06em; color: #9A8E76; }
.lcard-tag { font-family: var(--serif); font-size: 13px; color: #D8CDB6; margin-top: 12px; }
.lcard-note { font-size: 10.5px; color: #9A8E76; margin-top: 4px; flex: 1; }
.lcard-go { margin-top: 16px; font-size: 10px; letter-spacing: .16em; color: #C7906F; border-top: 1px solid #34372C; padding-top: 10px; }
.lcard.outside { border-style: dashed; }
.legacy-note { margin-top: 24px; font-size: 10.5px; letter-spacing: .05em; color: #8A806B; }

/* ── 方法 ─────────────────────────────────────────────── */
.method { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 9vw, 110px) var(--pad); }
.method-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 40px; align-items: end; padding-bottom: 32px; border-bottom: 1px solid var(--line2); margin-bottom: 30px; }
.method-head h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); letter-spacing: .04em; line-height: 1.35; }
.method-head p:last-child { font-size: 13px; line-height: 1.95; color: var(--ink2); max-width: 42ch; justify-self: end; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.method-grid article { background: var(--paper); padding: 24px; transition: background .3s; }
.method-grid article:hover { background: var(--paper2); }
.m-k { font-size: 9px; letter-spacing: .24em; color: var(--accent); margin-bottom: 10px; }
.method-grid h3 { font-size: 1.25rem; letter-spacing: .06em; margin-bottom: 8px; }
.method-grid p:last-child { font-size: 12px; line-height: 1.9; color: var(--ink2); }
.method-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; font-size: 10.5px; line-height: 1.9; color: var(--ink2); }
.method-sources b { display: block; color: var(--ink); font-weight: 500; letter-spacing: .1em; margin-bottom: 3px; }
.method-sources a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* ── 页脚 ─────────────────────────────────────────────── */
.foot { background: var(--dark); color: #B5AC97; padding: 46px var(--pad) 24px; }
.foot-main { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, .9fr); gap: 36px; padding-bottom: 32px; border-bottom: 1px solid #34372C; }
.foot-brand { font-family: var(--serif); font-size: 1.7rem; letter-spacing: .1em; color: #F4EDDD; }
.foot-brand span { display: block; font-family: var(--sans); font-size: 8px; letter-spacing: .34em; margin-top: 8px; color: #8A806B; }
.foot-tag { margin-top: 12px; font-size: 11px; color: #9A8E76; }
.foot nav { display: grid; grid-template-columns: repeat(2, auto); gap: 5px 24px; align-content: start; }
.foot nav a { font-size: 11px; letter-spacing: .1em; opacity: .75; transition: opacity .2s; }
.foot nav a:hover { opacity: 1; color: #F4EDDD; }
.foot-meta { text-align: right; font-size: 9.5px; letter-spacing: .05em; line-height: 2; color: #8A806B; }
.foot-base { max-width: var(--maxw); margin: 18px auto 0; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 9px; letter-spacing: .04em; color: #7C725E; }
.foot-base a { border-bottom: 1px solid currentColor; }

/* ── 搜索面板 ─────────────────────────────────────────── */
.palette-dialog {
  border: 0; padding: 0; background: transparent; width: min(640px, 92vw);
  margin: 10vh auto auto; color: var(--ink);
}
.palette-dialog::backdrop { background: color-mix(in srgb, #1A160F 62%, transparent); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.palette-dialog[open] { animation: palIn .28s var(--ease); }
@keyframes palIn { from { opacity: 0; transform: translateY(-10px) scale(.99); } to { opacity: 1; transform: none; } }
.palette-box { background: var(--paper2); border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 50px 120px -40px #000; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input > span { font-size: 18px; color: var(--accent); }
.palette-input input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 16px; color: var(--ink); }
.palette-input input::placeholder { color: color-mix(in srgb, var(--ink2) 70%, transparent); }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.palette-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 3px; cursor: pointer; }
.palette-item .pi-c { font-size: 9px; letter-spacing: .1em; color: var(--ink2); text-align: center; }
.palette-item .pi-m { display: block; min-width: 0; }
.palette-item .pi-n { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .04em; }
.palette-item .pi-t { display: block; font-size: 10.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.palette-item .pi-a { font-size: 10px; color: var(--ink2); opacity: .6; }
.palette-item[aria-selected="true"], .palette-item:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.palette-item[aria-selected="true"] .pi-n { color: var(--accent); }
.palette-empty { padding: 26px 16px; text-align: center; font-size: 12px; color: var(--ink2); }
.palette-foot { display: flex; gap: 16px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink2); }
.palette-foot kbd { margin-right: 2px; }
.palette-count { margin-left: auto; letter-spacing: .08em; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 400; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--paper2); padding: 10px 18px; border-radius: 999px;
  font-size: 11px; letter-spacing: .08em; opacity: 0; pointer-events: none; transition: .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 进场 */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.atlas { animation: atlasIn 1s var(--ease) both .08s; }
@keyframes atlasIn { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: none; } }

/* ── 响应式 ───────────────────────────────────────────── */
@media (max-width: 1240px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 12px; }
  .hero-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0 32px; align-items: end; padding: 24px 0 10px; }
  .eyebrow { grid-column: 1 / -1; }
  .hero h1 { grid-row: span 2; }
  .hero-lede { grid-column: 2; }
  .stats, .hero-actions, .hero-hint { grid-column: 2; }
  .atlas { min-height: 620px; height: 74vh; }
  .legacy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-intro { display: block; padding-bottom: 18px; }
  .hero h1 { margin-bottom: 16px; }
  .stats { max-width: 420px; }
  .atlas { height: 72vh; min-height: 520px; }
  .atlas-bar { flex-wrap: wrap; }
  .filters { order: 2; flex-basis: 100%; }
  .atlas-tools { margin-left: auto; align-items: center; }
  .atlas-tools::before { content: "缩放 / 复位"; font-size: 9px; letter-spacing: .16em; color: var(--ink2); margin-right: 4px; }
  .atlas-tools button { min-width: 34px; height: 32px; }
  .map-stage { min-height: 420px; }
  .map-stage::before { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-head { grid-template-columns: 1fr; gap: 16px; }
  .method-head p:last-child { justify-self: start; }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-sources { grid-template-columns: 1fr; gap: 12px; }
  .foot-main { grid-template-columns: 1fr 1fr; }
  .foot-meta { grid-column: 1 / -1; text-align: left; }
  .panel { position: fixed; top: var(--head); bottom: 0; right: 0; width: min(340px, 92%); z-index: 40; }
  .atlas { animation: none; }
}
@media (max-width: 620px) {
  :root { --head: 58px; }
  .search-btn .search-btn-t, .search-btn kbd { display: none; }
  .search-btn { width: 36px; justify-content: center; padding: 0; }
  .sound .sound-t { display: none; }
  .sound { padding: 0 10px; }
  .brand-name { font-size: 15px; }
  .hero { padding-top: 4px; }
  .h1-big { font-size: clamp(3rem, 16vw, 4.6rem); }
  .hero-lede { font-size: .92rem; }
  .stats dd { font-size: 1.4rem; }
  .atlas { height: 68vh; min-height: 480px; border-radius: 2px; animation: none; }
  .map-stage { min-height: 360px; }
  .map-badge { left: 12px; bottom: 34px; }
  .map-scale { right: 12px; bottom: 34px; font-size: 8px; }
  .atlas-foot { font-size: 8.5px; padding: 8px 12px; }
  .atlas-foot p:last-child { display: none; }
  .panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: min(78dvh, 660px);
    border-left: 0; border-top: 1px solid var(--line2); border-radius: 8px 8px 0 0;
    transform: translateY(102%); padding-top: 26px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -30px 80px -40px #000;
  }
  .panel.open { transform: none; }
  .panel::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 34px; height: 3px; border-radius: 3px; background: var(--line2); }
  .panel h2 { font-size: 1.8rem; }
  .dir-head { align-items: flex-start; }
  .dir-search { width: 100%; }
  .dir-tools { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .ccard { min-height: 150px; }
  .legacy-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .foot-main { grid-template-columns: 1fr; gap: 24px; }
  .foot nav { grid-template-columns: repeat(3, auto); }
  .palette-dialog { margin-top: 6vh; }
  .palette-item { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; }
}
@media (max-width: 420px) {
  .stats { gap: 6px; }
  .stats dt { font-size: 8.5px; letter-spacing: .1em; }
  .hero-actions .btn { flex: 1; }
}

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

/* 无 JS：地图不可用，导出目录 */
.no-js .map-loading { display: none; }
.no-js .map-stage::after {
  content: "互动地图需要 JavaScript。下方县域目录可直接使用 ↓";
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  font-size: 13px; color: var(--ink2); letter-spacing: .06em; text-align: center; padding: 24px;
}
