/* ============ 1. 基础重置 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: #08110D;
  background-image:
    radial-gradient(1100px 620px at 84% -10%, rgba(200, 255, 61, 0.075), transparent 62%),
    radial-gradient(900px 520px at 4% 12%, rgba(94, 200, 255, 0.05), transparent 60%),
    linear-gradient(rgba(37, 68, 56, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 68, 56, 0.32) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
  color: #E9F2EB;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.015em;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

/* ============ 2. 设计令牌 ============ */
:root {
  --ink: #08110D;
  --deep: #0E2018;
  --char: #183028;
  --lime: #C8FF3D;
  --gold: #FFB23E;
  --ice: #5EC8FF;
  --fog: #E9F2EB;
  --stone: #8FA89B;
  --grid: #254438;
  --coral: #FF6B5E;

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  --radius-pill: 999px;
  --radius-line: 2px;
  --shell: 1320px;
  --gutter: clamp(20px, 5vw, 56px);
  --header-gutter: clamp(12px, 3vw, 40px);
}

/* ============ 3. 无障碍与跳转 ============ */
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -90px;
  z-index: 200;
  display: inline-block;
  padding: 11px 20px;
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius-line);
  transition: top 180ms ease;
}

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

/* ============ 4. 排版基础 ============ */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.prose {
  max-width: 65ch;
  font-size: 17px;
  line-height: 1.6;
  color: #D7E4DA;
}

.prose p + p {
  margin-top: 1em;
}

.prose h3 {
  margin-top: 1.6em;
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--fog);
}

.prose a {
  color: var(--lime);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 255, 61, 0.45);
}

/* ============ 5. 容器与网格 ============ */
.container {
  width: min(var(--shell), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

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

.section + .section {
  border-top: 1px solid var(--grid);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice);
}

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

.section-title {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fog);
}

.section-lead {
  max-width: 62ch;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--stone);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
}

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

/* ============ 6. 按钮与标签 ============ */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-line);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

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

.btn-primary:hover {
  background: #DBFF74;
  border-color: #DBFF74;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--grid);
  color: var(--fog);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--grid);
  border-radius: var(--radius-line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
}

.tag--lime {
  border-color: rgba(200, 255, 61, 0.35);
  color: var(--lime);
}

.tag--gold {
  border-color: rgba(255, 178, 62, 0.35);
  color: var(--gold);
}

.tag--ice {
  border-color: rgba(94, 200, 255, 0.35);
  color: var(--ice);
}

/* ============ 7. 面包屑 ============ */
.breadcrumb {
  margin: 0 0 22px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--stone);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: rgba(143, 168, 155, 0.5);
}

.breadcrumb-link {
  color: var(--stone);
  text-decoration: none;
  transition: color 160ms ease;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  color: var(--lime);
}

.breadcrumb-current {
  color: var(--fog);
}

/* ============ 8. 图像容器基础规则 ============ */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(155deg, var(--char), var(--deep));
  border: 1px solid var(--grid);
}

.media > img,
.media > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(0.94) brightness(0.92);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 17, 13, 0) 42%, rgba(8, 17, 13, 0.8) 100%);
}

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

.media-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fog);
}

.media-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 9px;
  border: 1px solid rgba(200, 255, 61, 0.45);
  background: rgba(8, 17, 13, 0.72);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============ 9. 数据表 ============ */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--grid);
  background: rgba(14, 32, 24, 0.55);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(37, 68, 56, 0.7);
}

.data-table th {
  background: rgba(8, 17, 13, 0.45);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  white-space: nowrap;
}

.data-table td {
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: rgba(200, 255, 61, 0.05);
}

/* ============ 10. 目录高亮 ============ */
.toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-left: 1px solid var(--grid);
  border-radius: 0 4px 4px 0;
  color: var(--stone);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.toc-link::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: currentColor;
  opacity: 0.5;
}

.toc-link:hover {
  color: var(--fog);
  background: rgba(24, 48, 40, 0.7);
}

.toc-link[aria-current="location"] {
  color: var(--lime);
  border-left-color: var(--lime);
  background: rgba(200, 255, 61, 0.08);
}

.toc-link[aria-current="location"]::before {
  opacity: 1;
}

/* ============ 11. 头部浮岛 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 14px var(--header-gutter) 0;
  background: linear-gradient(180deg, rgba(8, 17, 13, 0.95) 0%, rgba(8, 17, 13, 0.72) 62%, rgba(8, 17, 13, 0) 100%);
  transition: padding-top 220ms ease;
}

.site-header[data-scrolled] {
  padding-top: 8px;
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 9px 12px 9px 18px;
  background: rgba(24, 48, 40, 0.82);
  border: 1px solid var(--grid);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: padding 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.site-header[data-scrolled] .header-shell {
  padding-block: 6px;
  background: rgba(14, 32, 24, 0.94);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--fog);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  background: var(--lime);
  color: var(--ink);
  border-radius: var(--radius-line);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  transition: background 180ms ease;
}

.brand:hover .brand-mark {
  background: #DBFF74;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.brand-sub {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--stone);
  white-space: nowrap;
}

/* 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 9px 15px;
  background: rgba(200, 255, 61, 0.08);
  border: 1px solid var(--grid);
  border-radius: var(--radius-pill);
  color: var(--fog);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.nav-toggle:hover {
  border-color: rgba(200, 255, 61, 0.5);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
  flex: none;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--lime);
  transition: transform 200ms ease, top 200ms ease;
}

.nav-toggle-bars::before { top: 1px; }
.nav-toggle-bars::after { top: 7px; }

.nav-toggle[aria-expanded="true"] {
  border-color: rgba(200, 255, 61, 0.55);
  background: rgba(200, 255, 61, 0.16);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 4px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 4px;
  transform: rotate(-45deg);
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

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

.nav-item {
  display: flex;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--stone);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-link:hover {
  color: var(--fog);
  background: rgba(233, 242, 235, 0.07);
}

.nav-link[aria-current="page"] {
  color: var(--lime);
  background: rgba(200, 255, 61, 0.1);
  box-shadow: inset 0 0 0 1px rgba(200, 255, 61, 0.32);
}

.nav-link[aria-current="page"]::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 7px;
  background: var(--lime);
  flex: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: var(--lime);
  border: 1px solid rgba(200, 255, 61, 0.6);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-cta:hover {
  background: #DBFF74;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(200, 255, 61, 0.26);
}

.site-header[data-scrolled] .nav-link {
  font-size: 13px;
}

/* 阅读进度 */
.read-progress {
  width: 100%;
  max-width: var(--shell);
  height: 2px;
  margin: 9px auto 0;
  background: rgba(37, 68, 56, 0.55);
  border-radius: 2px;
  overflow: hidden;
}

.read-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--ice), var(--lime));
  transition: transform 120ms linear;
}

/* ============ 12. 页脚 ============ */
.site-footer {
  margin-top: clamp(56px, 8vw, 112px);
  background: linear-gradient(180deg, rgba(8, 17, 13, 0) 0%, var(--deep) 26%, #0A1712 100%);
  border-top: 1px solid var(--grid);
  color: var(--fog);
}

.footer-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 68px) var(--gutter) 22px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1.25fr 1fr;
  gap: clamp(24px, 3.5vw, 52px);
}

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

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fog);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 180ms ease;
}

.footer-brand-link::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--lime);
  flex: none;
}

.footer-brand-link:hover {
  color: var(--lime);
}

.footer-brand-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--stone);
}

.footer-desc {
  max-width: 36ch;
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--stone);
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.footer-tag {
  padding: 4px 9px;
  border: 1px solid var(--grid);
  border-radius: var(--radius-line);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--stone);
}

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

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime);
}

.footer-list {
  display: grid;
  gap: 9px;
}

.footer-link {
  display: inline-block;
  color: var(--fog);
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--lime);
  border-bottom-color: var(--lime);
}

.footer-contact-list {
  display: grid;
  gap: 12px;
}

.footer-contact-item {
  display: grid;
  gap: 3px;
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

.footer-contact-value {
  font-size: 14px;
  color: var(--fog);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.footer-icp {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: 16px;
  border-top: 1px solid var(--grid);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.footer-region {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--lime);
}

.footer-region::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}

/* ============ 13. 渐显动效 ============ */
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ============ 14. 响应式 ============ */
@media (max-width: 1180px) {
  .nav-link {
    padding: 8px 9px;
    font-size: 13px;
  }

  .brand-sub {
    display: none;
  }
}

@media (max-width: 960px) {
  .site-header {
    padding: 10px clamp(10px, 3vw, 20px) 0;
  }

  .header-shell {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 20px;
  }

  .site-header[data-scrolled] .header-shell {
    padding: 8px 12px;
  }

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

  .site-nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--grid);
  }

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

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

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
  }

  .nav-cta {
    width: 100%;
    margin-top: 4px;
    padding: 13px 18px;
    border-radius: 10px;
  }

  .read-progress {
    margin-top: 8px;
  }

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

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

  body {
    background-size: auto, auto, 48px 48px, 48px 48px;
  }
}

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

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

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

  .grid-12 {
    gap: 16px;
  }

  .brand-name {
    font-size: 15px;
  }
}

/* ============ 15. 减少动效 ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    scroll-padding-top: 100px;
  }

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

  html.reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .read-progress-fill {
    transition: none;
  }
}
