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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 132px;
}

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

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

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

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

hr { border: 0; border-top: 1px solid rgba(30, 58, 95, .85); }

/* ===== 2. 设计变量 ===== */
:root {
  --c-night: #0B1B33;
  --c-deep: #132C4F;
  --c-ink: #1E3A5F;
  --c-red: #C8102E;
  --c-red-deep: #8C0F22;
  --c-green: #1F7A4D;
  --c-yellow: #F2B300;
  --c-paper: #F6F3EC;
  --c-note: #6B7C93;
  --c-black: #0A0E14;
  --c-text: #DCE4EF;
  --c-text-dim: #A9B7C9;

  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, Georgia, serif;
  --font-body: system-ui, -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell-w: 1240px;
  --hair: 1px solid rgba(30, 58, 95, .85);
  --hard-shadow: 6px 6px 0 rgba(10, 14, 20, .55);
  --head-h: 120px;
}

/* ===== 3. 基础排版 ===== */
body {
  min-height: 100vh;
  background-color: var(--c-night);
  background-image:
    repeating-linear-gradient(to right, rgba(107, 124, 147, .07) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(to bottom, rgba(107, 124, 147, .055) 0 1px, transparent 1px 88px);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-paper);
  letter-spacing: -.005em;
}

h1 { font-size: clamp(32px, 5.2vw, 56px); }
h2 { font-size: clamp(24px, 3.2vw, 36px); }
h3 { font-size: clamp(19px, 2.2vw, 24px); font-weight: 600; }
h4 { font-size: 17px; font-weight: 600; }

p { max-width: 72ch; }

::selection { background: var(--c-red); color: #FFFFFF; }

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

/* ===== 4. 布局辅助 ===== */
.shell {
  width: min(var(--shell-w), 92vw);
  margin-inline: auto;
}

.section {
  padding: clamp(48px, 7vw, 88px) 0;
  border-top: var(--hair);
}

.section--plain { border-top: 0; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap, 24px);
}

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.8;
  color: #BECBDB;
  max-width: 62ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-note);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 32px;
  height: 1px;
  background: var(--c-red);
}

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

/* ===== 5. 跳转链接 ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 300;
  display: inline-block;
  padding: 10px 18px;
  background: var(--c-red);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--c-paper);
  transition: top .15s ease;
}

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

/* ===== 6. 页头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(11, 27, 51, .95);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(30, 58, 95, .95);
  transition: box-shadow .25s ease;
}

.site-header[data-condensed] {
  box-shadow: 0 10px 26px rgba(4, 9, 18, .6);
}

.header-top { border-bottom: 1px solid rgba(30, 58, 95, .6); }

.header-top__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  transition: padding .25s ease;
}

.site-header[data-condensed] .header-top__inner { padding: 8px 0; }

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

.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  background: var(--c-red);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 4px 4px 0 var(--c-red-deep);
  transition: width .25s ease, height .25s ease, font-size .25s ease;
}

.site-header[data-condensed] .brand__mark {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

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

.brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-paper);
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--c-note);
  white-space: nowrap;
}

.header-top__desc {
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(30, 58, 95, .95);
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-note);
  max-width: 44ch;
  transition: opacity .2s ease;
}

.site-header[data-condensed] .header-top__desc { opacity: 0; }

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

.version-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-yellow);
  background: rgba(10, 14, 20, .6);
  border: 1px solid rgba(30, 58, 95, .95);
  padding: 6px 10px;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid rgba(30, 58, 95, .95);
  background: rgba(10, 14, 20, .6);
  color: var(--c-paper);
}

.nav-toggle__bars { display: grid; gap: 3px; }

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-paper);
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle__text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
}

.site-header[data-open] .nav-toggle { border-color: var(--c-red); }

.site-header[data-open] .nav-toggle__bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.header-nav {
  background: rgba(10, 14, 20, .5);
  border-top: 1px solid rgba(30, 58, 95, .55);
}

.header-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

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

.site-nav__item { display: flex; }

.site-nav__link {
  position: relative;
  display: block;
  padding: 16px 14px;
  font-size: 15px;
  line-height: 1.4;
  color: #B9C6D8;
  white-space: nowrap;
  transition: color .2s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}

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

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

.site-nav__link[aria-current="page"] { color: var(--c-paper); font-weight: 600; }

/* ===== 7. 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease, box-shadow .12s ease;
}

.btn--primary {
  background: var(--c-red);
  color: #FFFFFF;
  border-color: var(--c-red);
  box-shadow: 4px 4px 0 var(--c-red-deep);
}

.btn--primary:hover { background: var(--c-red-deep); border-color: var(--c-red-deep); }

.btn--primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--c-red-deep);
}

.btn--ghost {
  background: transparent;
  color: var(--c-paper);
  border-color: rgba(30, 58, 95, .95);
}

.btn--ghost:hover { border-color: var(--c-yellow); color: var(--c-yellow); }

.header-cta {
  flex: none;
  padding: 9px 18px;
  font-size: 14px;
}

/* ===== 8. 通用内容组件 ===== */
.breadcrumb {
  padding: 20px 0 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--c-note);
}

.breadcrumb__item { display: inline-flex; align-items: center; }

.breadcrumb__item:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
  color: var(--c-ink);
}

.breadcrumb__link { color: var(--c-note); transition: color .18s ease; }
.breadcrumb__link:hover { color: var(--c-yellow); }

.breadcrumb__current,
.breadcrumb__item[aria-current="page"] { color: var(--c-paper); }

.toc { border-left: 1px solid rgba(30, 58, 95, .9); }

.toc__title {
  padding: 0 0 12px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-note);
}

.toc__list { display: grid; }

.toc__link {
  display: block;
  padding: 9px 0 9px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-note);
  transition: color .2s ease, border-color .2s ease;
}

.toc__link:hover { color: var(--c-paper); }

.toc__link[aria-current="true"] {
  color: var(--c-paper);
  border-left-color: var(--c-red);
  font-weight: 600;
}

.panel {
  background: var(--c-deep);
  border: 1px solid rgba(30, 58, 95, .95);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--hard-shadow);
}

.panel--paper {
  background: var(--c-paper);
  color: #14181F;
  border-color: #DCD5C7;
  box-shadow: 6px 6px 0 rgba(10, 14, 20, .4);
}

.panel--paper h2,
.panel--paper h3,
.panel--paper h4 { color: var(--c-black); }

.panel--accent { border-left: 3px solid var(--c-red); }

.panel--flat { box-shadow: none; }

.panel__label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-note);
}

.panel--paper .panel__label { color: #6B7C93; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(30, 58, 95, .9);
  border: 1px solid rgba(30, 58, 95, .9);
}

.stat {
  background: var(--c-night);
  padding: 20px 18px;
}

.stat__value {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.05;
  color: var(--c-paper);
  letter-spacing: -.02em;
}

.stat__value--accent { color: var(--c-yellow); }

.stat__unit {
  margin-left: 4px;
  font-size: .45em;
  letter-spacing: .08em;
  color: var(--c-note);
}

.stat__label {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--c-note);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.7;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: currentColor;
}

.status--ok { color: #79CBA2; background: rgba(31, 122, 77, .16); }
.status--warn { color: var(--c-yellow); background: rgba(242, 179, 0, .12); }
.status--revise { color: #E4828F; background: rgba(200, 16, 46, .16); }
.status--neutral { color: var(--c-note); background: rgba(107, 124, 147, .12); }

.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--c-deep);
  border: 1px solid rgba(30, 58, 95, .95);
  box-shadow: var(--hard-shadow);
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 14%, rgba(200, 16, 46, .3), transparent 54%),
    radial-gradient(circle at 16% 84%, rgba(31, 122, 77, .32), transparent 56%),
    repeating-linear-gradient(90deg, rgba(246, 243, 236, .07) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(246, 243, 236, .05) 0 1px, transparent 1px 44px),
    linear-gradient(150deg, #16325A, #0B1B33 72%);
}

.media-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(242, 179, 0, .28);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(242, 179, 0, .045);
}

.media-frame > img,
.media-frame > picture > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0), rgba(10, 14, 20, .9));
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: #C4CFDD;
}

.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--bordered { box-shadow: 8px 8px 0 var(--c-red-deep); }

/* ===== 9. 阅读进度 ===== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 3px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ===== 10. 页脚 ===== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  background-color: var(--c-black);
  background-image: linear-gradient(180deg, rgba(19, 44, 79, .8), rgba(10, 14, 20, 0) 58%);
  color: var(--c-text-dim);
  border-top: 1px solid rgba(30, 58, 95, .95);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(240px, 42vw);
  height: 3px;
  background: var(--c-red);
}

.footer__masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 46px 0 28px;
  border-bottom: 1px solid rgba(30, 58, 95, .85);
}

.brand--footer .brand__mark { background: var(--c-red); }

.footer__note {
  margin: 0;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.75;
  color: var(--c-note);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr);
  gap: 34px 28px;
  padding: 34px 0 38px;
}

.footer__heading {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(30, 58, 95, .85);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-paper);
}

.footer__list { display: grid; gap: 10px; }

.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--c-text-dim);
  transition: color .18s ease;
}

.footer__link::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--c-red);
  transition: width .18s ease;
}

.footer__link:hover { color: var(--c-paper); }
.footer__link:hover::before { width: 14px; }

.footer__contact-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}

.footer__contact-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-note);
}

.footer__contact-value {
  color: #C4CFDD;
  word-break: break-word;
}

.footer__hint {
  margin-top: 16px;
  max-width: 40ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--c-note);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 30px;
  border-top: 1px solid rgba(30, 58, 95, .85);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--c-note);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.footer__icp { color: #8FA0B6; }

.footer__version {
  margin: 0;
  color: var(--c-yellow);
  letter-spacing: .12em;
}

/* ===== 11. 响应式 ===== */
@media (max-width: 1160px) {
  .header-top__desc { max-width: 30ch; font-size: 12.5px; }
}

@media (max-width: 980px) {
  html { scroll-padding-top: 108px; }

  .header-top__desc { display: none; }

  .header-top__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

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

  .header-nav {
    display: none;
    border-top: 1px solid rgba(30, 58, 95, .95);
  }

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

  .header-nav__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 12px 0 22px;
  }

  .site-nav__list { flex-direction: column; gap: 0; }

  .site-nav__item { display: block; }

  .site-nav__link {
    padding: 14px 0;
    border-bottom: 1px solid rgba(30, 58, 95, .6);
    font-size: 16px;
  }

  .site-nav__link::after { display: none; }

  .site-nav__link[aria-current="page"] {
    padding-left: 12px;
    border-left: 2px solid var(--c-red);
    color: var(--c-yellow);
  }

  .header-cta { width: 100%; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col--contact { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .footer__masthead {
    align-items: flex-start;
    padding: 36px 0 24px;
  }

  .footer__note { max-width: 100%; }

  .grid-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 560px) {
  .brand__mark { width: 34px; height: 34px; font-size: 17px; box-shadow: 3px 3px 0 var(--c-red-deep); }
  .brand__sub { display: none; }
  .brand__name { font-size: 15.5px; }
  .nav-toggle__text { display: none; }
  .version-chip { padding: 5px 8px; font-size: 10px; letter-spacing: .08em; }

  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer__contact-item { grid-template-columns: 46px minmax(0, 1fr); }
  .footer__bottom { font-size: 11.5px; }
}

@media (max-width: 420px) {
  .version-chip__full { display: none; }
}

/* ===== 12. 动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .read-progress { transition: none; }
}
