/* ==========================================================================
   南宫28看台 · /assets/site.css
   共享外壳：复位 / 设计令牌 / 中文排版 / 页头 / 页脚 / 通用组件
   ========================================================================== */

/* ---------- 1. 复位 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }

ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; line-height: 1.2; }

/* ---------- 2. 设计令牌 ---------- */
:root {
  --ink-900: #0B1526;
  --ink-850: #0F1C31;
  --ink-800: #122238;
  --ink-700: #18304F;

  --pitch: #1FA463;
  --pitch-deep: #0E6B41;
  --card-yellow: #F2C230;
  --card-red: #E2443A;
  --amber: #FFB43D;

  --paper: #F5F1E8;
  --muted: #9FB0C4;
  --score: #7FE3B0;

  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(231, 237, 245, 0.16);
  --line-strong: rgba(231, 237, 245, 0.34);

  --shell: 1320px;
  --rail: 88px;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --shadow: 0 22px 48px -30px rgba(0, 0, 0, 0.92);
  --shadow-amber: 0 16px 34px -20px rgba(255, 180, 61, 0.95);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 3. 基础排版与背景 ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--paper);
  background-color: var(--ink-900);
  background-image:
    repeating-linear-gradient(90deg, rgba(231, 237, 245, 0.035) 0 1px, transparent 1px 88px),
    radial-gradient(1100px 620px at 78% -14%, rgba(31, 164, 99, 0.18), transparent 62%),
    radial-gradient(760px 520px at -10% 6%, rgba(226, 68, 58, 0.10), transparent 60%);
  background-attachment: fixed, fixed, fixed;
}

::selection { background: rgba(31, 164, 99, 0.42); color: #ffffff; }

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

.shell {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
}

/* 页面栅格：左侧 88px 刻度轨道 + 右侧内容列 */
.page-shell {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
}

.page-main { min-width: 0; }

.side-rail { display: none; }

.side-rail__label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--muted);
}

.side-rail__ticks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.side-rail__tick {
  width: 2px;
  height: 24px;
  border-radius: 2px;
  background: var(--line-strong);
}

.side-rail__tick:nth-child(3n) { background: var(--pitch); }

/* ---------- 4. 通用工具类 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--amber);
  color: #231402;
  font-weight: 700;
  transform: translateY(-220%);
  transition: transform 0.22s ease;
}

.skip-link:focus { transform: translateY(0); }

/* ---------- 5. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 21, 38, 0.9);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.site-header__inner {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
  min-height: 74px;
  padding-block: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.site-header__brand { min-width: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--pitch) 0%, var(--pitch-deep) 100%);
  color: #04140C;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(245, 241, 232, 0.28);
}

.brand__mark::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(245, 241, 232, 0.55);
}

.brand__text { display: flex; flex-direction: column; min-width: 0; }

.brand__name {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--paper);
}

.brand__slogan {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  white-space: nowrap;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

/* 栏目轨道 */
.site-nav { justify-self: center; min-width: 0; }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav__link::before {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--pitch);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-nav__link:hover {
  color: var(--paper);
  background: var(--glass);
}

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  background: linear-gradient(180deg, rgba(31, 164, 99, 0.26), rgba(31, 164, 99, 0.05));
}

.site-nav__link[aria-current="page"]::before { transform: scaleX(1); }

.site-nav__link[data-match="true"] {
  color: var(--score);
  background: rgba(127, 227, 176, 0.14);
}

/* 检索框 */
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-field:focus-within {
  border-color: rgba(127, 227, 176, 0.55);
  background: rgba(255, 255, 255, 0.13);
}

.search-field__icon {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 1.6px solid var(--muted);
  border-radius: 50%;
}

.search-field__icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.search-field__input {
  width: 10em;
  border: 0;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--paper);
}

.search-field__input::placeholder { color: var(--muted); }

/* 关注列表入口 */
.watchlist-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--amber);
  color: #231402;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow-amber);
  transition: background 0.18s ease, transform 0.18s ease;
}

.watchlist-link:hover {
  background: #FFC562;
  transform: translateY(-1px);
}

.watchlist-link__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #231402;
  opacity: 0.62;
}

/* 折叠按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--glass);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: background 0.2s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.25s ease;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* 滚动进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--pitch) 0%, var(--score) 70%, var(--amber) 100%);
  transform: scaleX(0);
  transform-origin: left center;
}

/* 移动端底部快捷条（位于 header 片段中 header 元素之后） */
.dock { display: none; }

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 34, 56, 0.62) 0%, rgba(11, 21, 38, 0.98) 72%);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(260px, 42%);
  height: 3px;
  background: linear-gradient(90deg, var(--pitch), rgba(31, 164, 99, 0));
}

.site-footer__inner {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
  padding: clamp(36px, 5.5vw, 68px) 0 clamp(22px, 3vw, 34px);
  display: grid;
  gap: clamp(26px, 4vw, 52px);
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.6fr);
  grid-template-areas:
    "brand cols"
    "contact contact";
}

.footer-brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.footer-brand__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--paper);
}

.footer-brand__slogan {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--score);
}

.footer-brand__note {
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.footer-cols {
  grid-area: cols;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.footer-col { min-width: 0; }

.footer-col__title {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.footer-col__list { display: flex; flex-direction: column; gap: 8px; }

.footer-col__link {
  display: inline-block;
  font-size: 15px;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-col__link:hover {
  color: var(--score);
  border-bottom-color: rgba(127, 227, 176, 0.5);
}

.footer-contact {
  grid-area: contact;
  padding-top: clamp(18px, 3vw, 26px);
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 36px;
}

.footer-contact__title {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.footer-contact__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  min-width: 0;
}

.footer-contact__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.footer-contact__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer-contact__value { color: var(--paper); word-break: break-all; }

.footer-contact__note {
  flex: 1 1 100%;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-base {
  border-top: 1px solid var(--line);
  background: rgba(11, 21, 38, 0.7);
}

.footer-base__inner {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-base__icp { font-family: var(--font-mono); letter-spacing: 0.06em; }

.footer-base__tip { flex: 1 1 260px; text-align: right; }

/* ---------- 7. 章节与面板 ---------- */
.section { padding-block: clamp(34px, 6vw, 72px); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 28px;
  margin-bottom: clamp(18px, 3vw, 30px);
}

.section__title {
  font-size: clamp(24px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.section__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--score);
  text-transform: uppercase;
}

.section__note {
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.panel {
  position: relative;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-800);
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.panel--solid { background: var(--ink-850); }

.panel--glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: var(--glass-strong);
  box-shadow: none;
}

.panel--glass:hover {
  border-color: rgba(127, 227, 176, 0.42);
  transform: translateY(-3px);
}

.vert-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 8. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn--primary {
  background: var(--amber);
  color: #231402;
  box-shadow: var(--shadow-amber);
}

.btn--primary:hover { background: #FFC562; transform: translateY(-2px); }

.btn--ghost {
  background: var(--glass);
  border-color: var(--line-strong);
  color: var(--paper);
}

.btn--ghost:hover {
  border-color: rgba(127, 227, 176, 0.55);
  color: var(--score);
}

.btn--small { padding: 9px 16px; font-size: 13.5px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--glass);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.tag--green { color: var(--score); border-color: rgba(31, 164, 99, 0.55); background: rgba(31, 164, 99, 0.14); }
.tag--yellow { color: #F7D877; border-color: rgba(242, 194, 48, 0.5); background: rgba(242, 194, 48, 0.12); }
.tag--red { color: #F58C84; border-color: rgba(226, 68, 58, 0.5); background: rgba(226, 68, 58, 0.14); }
.tag--amber { color: #FFCE86; border-color: rgba(255, 180, 61, 0.5); background: rgba(255, 180, 61, 0.12); }

.crumbs {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crumbs__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumbs__link {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.crumbs__link:hover { color: var(--score); border-bottom-color: currentColor; }

.crumbs__sep { color: var(--line-strong); }

.crumbs__item[aria-current="page"] { color: var(--paper); }

.card-grid {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.stat { display: flex; flex-direction: column; gap: 5px; }

.stat__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  line-height: 1;
  color: var(--score);
}

.stat__unit {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.stat__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
  padding-left: 26px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pitch) 0%, rgba(31, 164, 99, 0.12) 100%);
}

.timeline__item { position: relative; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 14px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 3px;
  background: var(--ink-900);
  transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.timeline__item.is-current::before {
  background: var(--score);
  border-color: var(--score);
  box-shadow: 0 0 0 5px rgba(127, 227, 176, 0.16);
}

.timeline__marker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.timeline__body { min-width: 0; }

/* 图片容器基础规则：页面阶段放入 <img class="media__img"> */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--ink-800);
  background-image:
    linear-gradient(135deg, rgba(31, 164, 99, 0.2) 0%, rgba(11, 21, 38, 0.92) 58%),
    radial-gradient(120% 90% at 18% 0%, rgba(127, 227, 176, 0.14), transparent 62%);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(245, 241, 232, 0.05) 0 1px, transparent 1px 46px);
}

.media--grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(rgba(245, 241, 232, 0.12) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }

.media__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(11, 21, 38, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--paper);
}

/* 长文排版 */
.prose {
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 38em;
}

.prose h2 {
  margin-top: 0.6em;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.005em;
}

.prose h3 {
  margin-top: 0.4em;
  font-size: 18px;
  font-weight: 700;
}

.prose p { color: #DCE5F0; }

.prose ul {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding-left: 1.1em;
  list-style: square;
}

.prose strong { color: var(--paper); }

.prose a {
  color: var(--score);
  border-bottom: 1px solid rgba(127, 227, 176, 0.38);
}

/* ---------- 9. 展开明细 / 显现动效 ---------- */
[data-expand-panel] { display: none; }

[data-expandable][data-open="true"] [data-expand-panel] {
  display: block;
  animation: panel-drop 0.28s ease both;
}

@keyframes panel-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease var(--reveal-delay, 0ms),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal--d1 { --reveal-delay: 80ms; }
.reveal--d2 { --reveal-delay: 160ms; }
.reveal--d3 { --reveal-delay: 240ms; }
.reveal--d4 { --reveal-delay: 320ms; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1280px) {
  .search-field { display: none; }
}

@media (max-width: 1180px) {
  .site-nav__link { padding: 9px 9px; font-size: 14px; }
  .site-nav__link::before { left: 9px; right: 9px; }
  .watchlist-link { padding: 0 14px; font-size: 13.5px; }
}

@media (min-width: 1200px) {
  .page-shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
  }

  .side-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 104px;
    padding: 20px 0 28px;
  }
}

@media (max-width: 1080px) {
  html[data-nav-open] { overflow: hidden; }

  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 65;
    display: none;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 12px 16px 22px;
    background: rgba(11, 21, 38, 0.98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
  }

  [data-nav][data-open="true"],
  [data-nav][data-open] { display: block; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    justify-self: stretch;
  }

  .site-nav__link {
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 17px;
    background: rgba(255, 255, 255, 0.04);
  }

  .site-nav__link::before {
    left: 0;
    right: auto;
    top: 14px;
    bottom: 14px;
    width: 3px;
    height: auto;
    transform: scaleY(0);
    transform-origin: top center;
  }

  .site-nav__link[aria-current="page"]::before { transform: scaleY(1); }

  .dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 21, 38, 0.96);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }

  .dock__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease;
  }

  .dock__link[aria-current="page"] {
    color: var(--score);
    background: rgba(31, 164, 99, 0.16);
  }

  .dock__dot {
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.62;
  }

  body { padding-bottom: 76px; }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "cols"
      "contact";
  }
}

@media (max-width: 860px) {
  body { font-size: 16.5px; }

  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base__tip { text-align: left; }
}

@media (max-width: 640px) {
  .brand__mark { width: 38px; height: 38px; font-size: 14px; border-radius: 10px; }
  .brand__name { font-size: 17px; }
  .watchlist-link { padding: 0 13px; font-size: 13px; gap: 6px; }
  .section__note { max-width: none; }
  .footer-contact__row { flex-direction: column; gap: 2px; }
}

@media (max-width: 560px) {
  .brand__slogan { display: none; }
  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

/* ---------- 11. 无障碍动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .panel--glass:hover,
  .btn--primary:hover,
  .watchlist-link:hover { transform: none; }
}
