/* ===== 1. Reset ===== */
*,
*::before,
*::after { box-sizing: border-box; }

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

body { margin: 0; }

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

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

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

i, em { font-style: normal; }

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

a { color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* ===== 2. Tokens ===== */
:root {
  --ink: #06130F;
  --pitch: #0C2118;
  --stand: #15362A;
  --signal: #FF5A1F;
  --score: #2FE3CF;
  --pulse: #D8FF45;
  --rank: #7C93FF;
  --paper: #F1E7D6;
  --chalk: #F6F7F2;
  --mist: #9EB7AA;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "Barlow Condensed", "DIN Condensed", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 72px);
  --max: 1280px;
  --line: rgba(241, 231, 214, 0.18);
  --line-soft: rgba(241, 231, 214, 0.10);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 3. Base / 中文排版 ===== */
html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 560px at 18% -12%, rgba(47, 227, 207, 0.09), transparent 62%),
    radial-gradient(900px 520px at 92% -6%, rgba(255, 90, 31, 0.11), transparent 66%);
  background-repeat: no-repeat;
  color: var(--chalk);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

h1, .h1, h2, .h2, h3, .h3 {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--chalk);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h1, .h1 { font-size: clamp(34px, 6vw, 80px); line-height: 1.02; }
h2, .h2 { font-size: clamp(24px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; }
h3, .h3 { font-size: clamp(18px, 2vw, 24px); line-height: 1.32; font-weight: 800; letter-spacing: -0.015em; }

p { max-width: 68ch; }

strong { font-weight: 800; color: var(--chalk); }

a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

::selection { background: var(--signal); color: #180700; }

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

/* ===== 4. 工具类 ===== */
.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;
}

.num {
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

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

.pulse-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pulse);
  animation: dotPulse 2.6s ease-out infinite;
}

@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(216, 255, 69, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(216, 255, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 255, 69, 0); }
}

/* ===== 5. 容器与分区 ===== */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(40px, 7vw, 96px); }

.section--pitch { background: var(--pitch); }

.section--stand { background: var(--stand); }

.section--rank {
  background-image: linear-gradient(180deg, rgba(124, 147, 255, 0.14), rgba(124, 147, 255, 0.03));
}

/* ===== 6. 跳转链接 ===== */
.skip-link {
  position: fixed;
  top: -220px;
  left: var(--gutter);
  z-index: 300;
  padding: 12px 20px;
  background: var(--pulse);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}

.skip-link:focus { top: 12px; }

/* ===== 7. 页头 · 阅读进度 ===== */
.read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: rgba(241, 231, 214, 0.08);
  z-index: 200;
}

.read-progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background-image: linear-gradient(90deg, var(--signal), var(--pulse));
}

/* ===== 8. 页头 · 坐标细栏 ===== */
.site-header {
  position: relative;
  background-image: linear-gradient(180deg, rgba(21, 54, 42, 0.92), rgba(6, 19, 15, 0.96));
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background-image: linear-gradient(90deg, var(--signal) 0 24%, var(--score) 24% 34%, rgba(241, 231, 214, 0.06) 34% 100%);
}

.header-rail {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  margin-inline: auto;
  padding: 10px var(--gutter) 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

.header-rail__coord { justify-self: start; }

.header-rail__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--score);
  justify-self: center;
  white-space: nowrap;
}

.header-rail__note {
  justify-self: end;
  color: rgba(158, 183, 170, 0.72);
}

/* ===== 9. 页头 · 刊头 ===== */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(14px, 2vw, 24px) var(--gutter) clamp(12px, 1.6vw, 20px);
}

.brand-mark {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--chalk);
}

.brand-mark__main {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.6vw, 44px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color 0.2s var(--ease);
}

.brand-mark__sub {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mist);
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 90, 31, 0.55);
}

.brand-mark:hover .brand-mark__main { color: var(--pulse); }

/* ===== 10. 页头 · 快捷入口 ===== */
.quick-jump {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--score);
  border: 1px solid rgba(47, 227, 207, 0.42);
  background-color: rgba(47, 227, 207, 0.07);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: transform 0.18s var(--ease), background-color 0.18s, color 0.18s, border-color 0.18s;
}

.quick-chip:hover {
  background-color: rgba(47, 227, 207, 0.18);
  transform: translate(4px, -1px);
}

.quick-chip--signal {
  color: var(--signal);
  border-color: rgba(255, 90, 31, 0.55);
  background-color: rgba(255, 90, 31, 0.13);
}

.quick-chip--signal:hover {
  background-color: var(--signal);
  color: #180700;
}

/* ===== 11. 页头 · 移动栏目按钮 ===== */
.nav-toggle {
  grid-column: 1;
  justify-self: start;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--chalk);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.nav-toggle__mark {
  display: inline-block;
  width: 16px;
  height: 11px;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);
  background-size: 100% 2px;
  background-position: 0 0, 0 4.5px, 0 9px;
  background-repeat: no-repeat;
}

.nav-toggle[aria-expanded="true"] {
  background-color: var(--signal);
  border-color: var(--signal);
  color: #180700;
}

/* ===== 12. 页头 · 栏目索引 ===== */
.nav-rail {
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 var(--gutter) 12px;
  border-top: 1px solid var(--line-soft);
  margin-top: 2px;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(246, 247, 242, 0.72);
  transition: color 0.18s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  background-color: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.22s var(--ease);
}

.nav-link:hover { color: var(--chalk); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link[aria-current="page"] {
  color: #180700;
  background-color: var(--signal);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.nav-link[aria-current="page"]::after { display: none; }

.nav-quick {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}

/* ===== 13. 页脚 ===== */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(40px, 7vw, 96px);
  border-top: 1px solid var(--line);
  background-image: linear-gradient(180deg, var(--ink), var(--pitch) 42%, #0A1A13);
  color: var(--chalk);
}

.site-footer::before {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -160px;
  width: 520px;
  height: 320px;
  background-image: radial-gradient(closest-side, rgba(124, 147, 255, 0.20), transparent);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(34px, 6vw, 72px) var(--gutter) 0;
}

.footer-crest {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: clamp(18px, 3vw, 48px);
  padding-bottom: clamp(22px, 3.5vw, 40px);
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 22ch;
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--chalk);
}

.footer-brand__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--signal);
  transform: rotate(45deg);
}

.footer-summary {
  justify-self: end;
  max-width: 44ch;
  padding-right: 16px;
  border-right: 2px solid var(--signal);
  font-size: 14px;
  line-height: 1.72;
  color: var(--mist);
  text-align: right;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(26px, 4vw, 48px);
}

.footer-col__title {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--score);
}

.footer-links {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.footer-links a {
  display: inline-block;
  padding-bottom: 1px;
  text-decoration: none;
  color: rgba(246, 247, 242, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 0.18s, transform 0.18s var(--ease), border-color 0.18s;
}

.footer-links a:hover {
  color: var(--pulse);
  border-bottom-color: rgba(216, 255, 69, 0.5);
  transform: translateX(3px);
}

.footer-links--plain a:hover { transform: none; }

.footer-note {
  display: block;
  font-size: 13px;
  line-height: 1.68;
  color: var(--mist);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.footer-base__meta { max-width: none; }

.footer-base__legal { color: rgba(158, 183, 170, 0.92); }

/* ===== 14. 通用排版组件 ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--score);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background-color: var(--signal);
}

.annotation {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

.annotation--vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.prose {
  max-width: 68ch;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.78;
  color: rgba(246, 247, 242, 0.86);
}

.prose p + p { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.8em; margin-bottom: 0.6em; }
.prose a { color: var(--score); }
.prose ul { display: grid; gap: 8px; margin-block: 1em; }
.prose li { padding-left: 18px; position: relative; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 8px; height: 2px;
  background-color: var(--signal);
}

/* ===== 15. 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background-color 0.18s, color 0.18s, border-color 0.18s;
}

.btn--signal {
  background-color: var(--signal);
  color: #180700;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.btn--signal:hover { transform: translateX(4px); }

.btn--ghost {
  background-color: rgba(47, 227, 207, 0.06);
  border-color: rgba(47, 227, 207, 0.45);
  color: var(--score);
}

.btn--ghost:hover {
  background-color: rgba(47, 227, 207, 0.16);
  transform: translateX(4px);
}

.btn--paper {
  background-color: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.btn--paper:hover { transform: translateX(4px); }

/* ===== 16. 纸张叠层 / 标签 / 筛选 ===== */
.sheet {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  background-color: var(--stand);
  border: 1px solid var(--line);
  box-shadow: 10px 10px 0 rgba(241, 231, 214, 0.05), 22px 22px 0 rgba(6, 19, 15, 0.55);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background-color: var(--paper);
  transform: rotate(-1.5deg);
}

.tag--signal {
  background-color: var(--signal);
  color: #180700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--chalk);
  background-color: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.chip:hover { border-color: rgba(47, 227, 207, 0.6); color: var(--score); }

.chip[aria-pressed="true"],
.chip.is-active {
  background-color: var(--pulse);
  border-color: var(--pulse);
  color: var(--ink);
}

/* ===== 17. 图例 ===== */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--signal);
  clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%);
}

.legend__swatch--score { background-color: var(--score); }
.legend__swatch--rank { background-color: var(--rank); }

.legend__swatch--pulse {
  background-color: var(--pulse);
  border-radius: 50%;
  clip-path: none;
}

/* ===== 18. 图片容器基础 ===== */
.img-frame {
  position: relative;
  overflow: hidden;
  background-color: var(--pitch);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}

.img-frame > img,
.img-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.img-frame:hover > img,
.img-frame:hover > picture > img { transform: scale(1.02); }

.img-frame--tall { aspect-ratio: 3 / 4; }
.img-frame--wide { aspect-ratio: 21 / 9; }
.img-frame--square { aspect-ratio: 1 / 1; }

.img-frame__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--mist);
  background-color: rgba(6, 19, 15, 0.78);
}

.img-frame__corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  background-color: var(--signal);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* ===== 19. 网格 ===== */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ===== 20. 面包屑 / 数据 ===== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.breadcrumbs a {
  color: var(--mist);
  text-decoration: none;
  transition: color 0.18s;
}

.breadcrumbs a:hover { color: var(--score); }

.breadcrumbs__sep { opacity: 0.45; }

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

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

.stat__num {
  font-family: var(--font-num);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--pulse);
}

.stat__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

/* ===== 21. 复制反馈 / 章节高亮 ===== */
[data-copied="true"] {
  color: var(--pulse) !important;
  border-color: var(--pulse) !important;
}

[data-chapter].is-current .chapter-flag {
  background-color: var(--pulse);
  color: var(--ink);
}

[data-chapter-link][aria-current="true"] {
  color: var(--pulse);
}

/* ===== 22. 响应式 ===== */
@media (max-width: 1024px) {
  .col-3, .col-4 { grid-column: span 6; }
  .col-5, .col-7, .col-8, .col-9 { grid-column: span 12; }
}

@media (max-width: 860px) {
  .header-rail {
    grid-template-columns: 1fr auto;
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .header-rail__note { display: none; }
  .header-rail__status { justify-self: end; }

  .masthead { gap: 10px; }

  .nav-toggle { display: inline-flex; }
  .quick-jump { display: none; }

  .nav-rail { display: none; padding-bottom: 14px; }

  .site-header[data-open] .nav-rail { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    padding: 14px 12px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    clip-path: none;
    padding-left: 18px;
  }

  .nav-quick { display: flex; }

  .footer-crest { grid-template-columns: 1fr; }

  .footer-summary {
    justify-self: start;
    text-align: left;
    padding: 0 0 0 14px;
    border-right: 0;
    border-left: 2px solid var(--signal);
  }

  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .brand-mark__sub { letter-spacing: 0.22em; font-size: 9px; }
}

@media (max-width: 560px) {
  .col-3, .col-4, .col-5, .col-7, .col-8, .col-9, .col-12 { grid-column: span 12; }

  .footer-grid { grid-template-columns: 1fr; }

  .footer-base { flex-direction: column; align-items: flex-start; }

  .brand-mark__main { font-size: 24px; }

  .sheet { box-shadow: 6px 6px 0 rgba(241, 231, 214, 0.05), 12px 12px 0 rgba(6, 19, 15, 0.55); }
}

/* ===== 23. 动效可及性 ===== */
@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;
  }

  .pulse-dot { animation: none; }
  .img-frame:hover > img,
  .img-frame:hover > picture > img { transform: none; }
}
