/* =========================================================
   /assets/site.css — 共享外壳：reset、变量、中文排版、
   页头、页脚、按钮、网格与基础组件
   ========================================================= */

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

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

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

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

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

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

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

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩 */
  --night: #08152B;
  --night-deep: #040D1B;
  --deep: #0F2542;
  --surface: #17355C;
  --blue: #2E7DD1;
  --white: #F2F5F8;
  --red: #D9534F;
  --green: #3FA37A;
  --yellow: #F2D06B;
  --gold: #E9A13B;
  --gold-deep: #C98A1E;
  --ash: #9FB0C6;
  --ash-soft: rgba(159, 176, 198, 0.72);
  --line: #17355C;
  --line-blue: rgba(46, 125, 209, 0.32);
  --line-ash: rgba(159, 176, 198, 0.18);

  /* 字体 */
  --font-head: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular",
    "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* 尺度 */
  --shell: 1240px;
  --gutter: clamp(18px, 4vw, 48px);
  --space: 24px;
  --header-h: 78px;
  --header-h-compact: 56px;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --radius: 2px;
}

/* ---------- 3. 中文排版与基底 ---------- */
body {
  min-height: 100%;
  background-color: var(--night);
  background-image:
    radial-gradient(circle at 12% -12%, rgba(46, 125, 209, 0.18), transparent 46%),
    radial-gradient(circle at 92% 2%, rgba(233, 161, 59, 0.1), transparent 40%);
  background-repeat: no-repeat;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--gold);
  color: #20160A;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  letter-spacing: -0.01em;
  line-height: 1.24;
}

p { max-width: 68ch; }

strong { font-weight: 700; color: var(--white); }

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

/* ---------- 4. 通用工具 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -140px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--gold);
  color: #20160A;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius);
  transition: top 0.18s var(--ease);
}

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

.contour-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: repeating-radial-gradient(
    circle at 82% 16%,
    rgba(46, 125, 209, 0.35) 0 1px,
    transparent 1px 18px
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

/* ---------- 5. 标题组 ---------- */
.h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
}

.h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.42;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--gold);
}

.rule-gold {
  display: block;
  width: 48px;
  height: 3px;
  margin: 18px 0;
  background: var(--gold);
}

.lede {
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ash);
}

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: end;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.sec-head__note {
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--ash);
  border-left: 2px solid var(--yellow);
  padding-left: 12px;
}

.section {
  padding-block: clamp(36px, 5.5vw, 76px);
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background-color 0.18s var(--ease),
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.btn--gold {
  background: var(--gold);
  color: #20160A;
  border-color: var(--gold);
}
.btn--gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(242, 245, 248, 0.34);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn--sm {
  padding: 0 15px;
  font-size: 13px;
  letter-spacing: 0.03em;
}

/* ---------- 7. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: rgba(8, 21, 43, 0.42);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag--blue { color: var(--blue); }
.tag--white { color: var(--white); }
.tag--red { color: var(--red); }
.tag--green { color: var(--green); }
.tag--yellow { color: var(--yellow); }

.tag--tape { transform: rotate(-1.2deg); }

/* ---------- 8. 卡片与图片容器 ---------- */
.paper-card {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--night-deep);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.paper-card:hover {
  border-color: var(--blue);
  box-shadow: 6px 6px 0 rgba(46, 125, 209, 0.28);
}

.paper-card--flat {
  box-shadow: none;
}

.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(46, 125, 209, 0.18), rgba(8, 21, 43, 0.9)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--night-deep);
}

.media-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-frame__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ash);
  background: linear-gradient(to top, rgba(8, 21, 43, 0.94), transparent);
}

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

/* ---------- 9. 信息带与对照条 ---------- */
.info-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-blue);
  border: 1px solid var(--line-blue);
  border-radius: var(--radius);
}

.info-band__cell {
  min-height: 44px;
  padding: 13px 16px;
  background: var(--deep);
}

.info-band__k {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ash-soft);
}

.info-band__v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}

.compare-bar {
  width: 100%;
  font-size: 14px;
}

.compare-bar caption {
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-align: left;
}

.compare-bar th {
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-ash);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ash);
  text-align: left;
  white-space: nowrap;
}

.compare-bar td {
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-ash);
  vertical-align: middle;
}

.compare-bar tbody tr {
  transition: background-color 0.18s var(--ease);
}

.compare-bar tbody tr:hover td {
  background: var(--deep);
}

/* ---------- 10. 面包屑与网格 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ash);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ash);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.crumbs a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

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

.crumbs__sep {
  color: rgba(159, 176, 198, 0.45);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}

.grid--split { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 11. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(8, 21, 43, 0.95);
  border-bottom: 1px solid var(--line-blue);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.flag-strip {
  display: flex;
  height: 3px;
}

.flag-strip__seg { flex: 1 1 20%; }

.flag-strip__seg--blue { background: var(--blue); }
.flag-strip__seg--white { background: var(--white); }
.flag-strip__seg--red { background: var(--red); }
.flag-strip__seg--green { background: var(--green); }
.flag-strip__seg--yellow { background: var(--yellow); }

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  height: var(--header-h);
  padding-inline: var(--gutter);
  transition: height 0.22s var(--ease);
}

.site-header[data-scrolled="true"] .header-inner {
  height: var(--header-h-compact);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  transition: opacity 0.18s var(--ease);
}

.brand:hover { opacity: 0.86; }

.brand__mark {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}

.brand__mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--blue);
  border-radius: 50%;
}

.brand__mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  background: var(--gold);
  border-radius: 50%;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand__meta {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--gold);
}

/* 导航 */
.nav {
  justify-self: center;
  min-width: 0;
}

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

.nav__item { display: flex; }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ash);
  white-space: nowrap;
  transition:
    color 0.18s var(--ease),
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.nav__idx {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(159, 176, 198, 0.66);
  transition: color 0.18s var(--ease);
}

.nav__label { display: inline-block; }

.nav__link:hover {
  color: var(--white);
  background: rgba(46, 125, 209, 0.14);
}

.nav__link[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--blue);
}

.nav__link[aria-current="page"] .nav__idx {
  color: var(--gold);
}

/* 页头动作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ash);
  white-space: nowrap;
}

.status__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 163, 122, 0.18);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 11px;
  border: 1px solid rgba(242, 245, 248, 0.28);
  border-radius: var(--radius);
  color: var(--white);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.site-header[data-open="true"] .nav-toggle__bars span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle__bars span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.nav-toggle__text {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* 阅读进度 */
.scroll-meter {
  height: 2px;
  overflow: hidden;
  background: rgba(46, 125, 209, 0.14);
}

.scroll-meter__bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: transform 0.1s linear;
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 104px);
  background: var(--deep);
  border-top: 1px solid var(--line-blue);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--blue) 0 20%,
    var(--white) 20% 40%,
    var(--red) 40% 60%,
    var(--green) 60% 80%,
    var(--yellow) 80% 100%
  );
  opacity: 0.9;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 36px) 24px;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 64px) var(--gutter) clamp(28px, 4vw, 42px);
}

.footer-brand { grid-column: span 3; }

.footer-col { grid-column: span 2; }

.footer-col--contact { grid-column: span 3; }

.footer-note {
  margin-top: 16px;
  max-width: 26ch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ash);
}

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(159, 176, 198, 0.22);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.footer-list { display: block; }

.footer-link {
  display: inline-block;
  min-height: 36px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--ash);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer-link:hover {
  color: var(--white);
  border-bottom-color: var(--blue);
}

.footer-list--plain li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  font-size: 13.5px;
  line-height: 1.66;
  color: var(--ash);
  overflow-wrap: anywhere;
}

.footer-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(159, 176, 198, 0.7);
  padding-top: 3px;
}

.footer-hint {
  margin: 14px 0 16px;
  padding-left: 10px;
  border-left: 2px solid var(--yellow);
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(159, 176, 198, 0.88);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 16px var(--gutter) 22px;
  border-top: 1px solid rgba(159, 176, 198, 0.16);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(159, 176, 198, 0.82);
}

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

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1240px) {
  .nav__link { padding: 0 9px; font-size: 13.5px; }
  .header-actions { gap: 10px; }
}

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    justify-self: stretch;
    width: 100%;
    padding: 12px var(--gutter) 20px;
    background: var(--deep);
    border-top: 1px solid var(--line-blue);
    border-bottom: 1px solid var(--line-blue);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.5);
  }

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

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav__item { display: block; }

  .nav__link {
    width: 100%;
    padding: 13px 12px;
    font-size: 15px;
    border-bottom: 1px solid rgba(159, 176, 198, 0.14);
    border-left: 2px solid transparent;
  }

  .nav__link[aria-current="page"] {
    border-bottom-color: rgba(159, 176, 198, 0.14);
    border-left-color: var(--gold);
    background: rgba(46, 125, 209, 0.16);
  }

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

  .grid--split,
  .grid--thirds { grid-template-columns: minmax(0, 1fr); }

  .sec-head { grid-template-columns: minmax(0, 1fr); align-items: start; }

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

  .footer-inner { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .footer-brand { grid-column: span 6; }
  .footer-col { grid-column: span 3; }
  .footer-col--contact { grid-column: span 6; }
}

@media (max-width: 900px) {
  .status__text { display: none; }
  .grid--halves { grid-template-columns: minmax(0, 1fr); }
}

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

  .brand__name { font-size: 13.5px; letter-spacing: 0.03em; }
  .brand__mark { width: 22px; height: 22px; }
  .status { display: none; }
  .header-actions { gap: 8px; }

  .info-band { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-brand,
  .footer-col,
  .footer-col--contact { grid-column: auto; }
  .footer-note { max-width: none; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 6px; }
}

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

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