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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-compact, 60px) + 20px);
}

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

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

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

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

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

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

table { border-collapse: collapse; border-spacing: 0; }

/* ============================================================
   2. TOKENS
   ============================================================ */
:root {
  --ink: #0E1F1A;
  --moss: #2F4A3C;
  --teal-deep: #123B36;
  --cyan: #37F0D0;
  --cyan-dim: #1E8E80;
  --amber: #E0A33E;
  --terracotta: #B4653F;
  --graphite: #1A1D1C;
  --stone: #2A2E2C;
  --offwhite: #F2EFE6;
  --line: #3D4340;

  --font-display: "Arial Narrow", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;

  --shell: 1320px;
  --pad: clamp(18px, 4vw, 48px);
  --gap: clamp(16px, 2.4vw, 32px);
  --header-h: 72px;
  --header-h-compact: 60px;
  --shadow-hard: 6px 6px 0 rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
    --header-h-compact: 56px;
  }
}

/* ============================================================
   3. BASE / 中文排版
   ============================================================ */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.75;
  color: var(--offwhite);
  background-color: var(--graphite);
  background-image:
    repeating-linear-gradient(90deg, rgba(55, 240, 208, 0.045) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, rgba(55, 240, 208, 0.035) 0 1px, transparent 1px 120px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-break: normal;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: radial-gradient(rgba(242, 239, 230, 0.08) 1px, transparent 1px);
  background-size: 5px 5px;
}

main,
.site-header,
.site-footer { position: relative; z-index: 1; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

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

::selection {
  background: var(--cyan);
  color: var(--ink);
}

/* ============================================================
   4. UTILITIES
   ============================================================ */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.h-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(38px, 7vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--offwhite);
}

.h-section {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--offwhite);
}

.h-editorial {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: var(--offwhite);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

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

.eyebrow::before {
  content: "";
  width: 16px;
  height: 2px;
  flex: none;
  background: var(--cyan);
}

.prose {
  max-width: 34em;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.75;
}

.prose > * + * { margin-top: 1.1em; }

.prose p { color: rgba(242, 239, 230, 0.82); }

.prose h2,
.prose h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--offwhite);
}

.prose h3 { font-size: 1.25em; }

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--offwhite); }

.prose ul,
.prose ol { padding-left: 1.25em; }

.prose ul li { list-style: square; }
.prose ol li { list-style: decimal; }
.prose li::marker { color: var(--cyan); }
.prose li + li { margin-top: 0.4em; }

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

@media (max-width: 900px) {
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .grid-12 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.rule--bold {
  height: 4px;
  background: var(--offwhite);
}

/* -- 面板：无边框，靠底色分区 -- */
.panel {
  background: var(--stone);
  padding: clamp(18px, 2.4vw, 32px);
}

.panel--teal { background: var(--teal-deep); }
.panel--moss { background: var(--moss); }

.panel--invert {
  background: var(--offwhite);
  color: var(--ink);
  border-left: 4px solid var(--cyan);
}

.panel--invert .prose p,
.panel--invert .h-editorial { color: var(--ink); }

/* -- 标签 -- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border: 1px solid currentColor;
  color: var(--cyan);
}

.tag--clay { color: var(--terracotta); }
.tag--amber { color: var(--amber); }

/* -- 按钮 -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  border-radius: 0;
  transition:
    background-color 0.16s var(--ease),
    color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.btn:hover {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: var(--shadow-hard);
  transform: translate(-2px, -2px);
}

.btn:active {
  transform: translate(0, 0);
  box-shadow: none;
}

.btn--solid {
  background: var(--cyan);
  color: var(--ink);
}

.btn--solid:hover {
  background: var(--offwhite);
  border-color: var(--offwhite);
  color: var(--ink);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--offwhite);
}

.btn--ghost:hover {
  border-color: var(--offwhite);
  background: var(--offwhite);
  color: var(--ink);
}

/* -- 面包屑 -- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(242, 239, 230, 0.5);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.breadcrumb__list li + li::before {
  content: "/";
  color: var(--line);
}

.breadcrumb a { color: rgba(242, 239, 230, 0.72); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--offwhite); }

/* -- 图片容器基础规则 -- */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--stone);
  border: 2px solid var(--line);
}

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

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

.media--placeholder {
  background-image:
    repeating-linear-gradient(135deg, rgba(55, 240, 208, 0.09) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(45deg, rgba(224, 163, 62, 0.05) 0 2px, transparent 2px 18px);
  background-color: var(--stone);
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: rgba(242, 239, 230, 0.5);
}

/* -- 滚动进度（JS 注入） -- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 400;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan-dim) 45%, var(--amber) 100%);
}

/* ============================================================
   5. SKIP LINK
   ============================================================ */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  padding: 12px 20px;
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  transform: translateY(-130%);
  transition: transform 0.18s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--offwhite);
  outline-offset: 2px;
}

/* ============================================================
   6. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  isolation: isolate;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 31, 26, 0.94) 0%, rgba(14, 31, 26, 0.55) 62%, rgba(14, 31, 26, 0) 100%);
  transition: opacity 0.2s var(--ease);
}

.site-header[data-scrolled="true"] {
  background: var(--ink);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

.site-header[data-scrolled="true"]::after { opacity: 0; }

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

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

/* -- 品牌 -- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: 8px;
  height: 36px;
  flex: none;
  background-image: repeating-linear-gradient(180deg, var(--cyan) 0 7px, transparent 7px 11px);
  transition: height 0.2s var(--ease);
}

.site-header[data-scrolled="true"] .brand__mark { height: 28px; }

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(17px, 1.5vw, 20px);
  letter-spacing: 0.03em;
  color: var(--offwhite);
  white-space: nowrap;
  transition: color 0.16s var(--ease);
}

.brand:hover .brand__name { color: var(--cyan); }

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(242, 239, 230, 0.55);
  white-space: nowrap;
}

/* -- 导航 -- */
.site-nav {
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(2px, 0.9vw, 16px);
}

.nav__item { flex: none; }

.nav__link {
  position: relative;
  display: inline-block;
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(242, 239, 230, 0.74);
  transition: color 0.16s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.16s var(--ease);
}

.nav__link:hover { color: var(--offwhite); }
.nav__link:hover::after { transform: scaleX(1); }

.nav__link[aria-current="page"] { color: var(--cyan); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav__link--flag {
  padding-left: 12px;
  border-left: 2px solid var(--cyan);
  color: var(--offwhite);
}

.nav__link--flag::after { left: 12px; }

/* -- 工具区 -- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.btn--quick {
  padding: 8px 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.site-header[data-scrolled="true"] .btn--quick {
  background: var(--cyan);
  color: var(--ink);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  border: 1px solid rgba(224, 163, 62, 0.45);
  white-space: nowrap;
}

.version-badge__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(224, 163, 62, 0.18);
}

/* -- 移动按钮 -- */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(242, 239, 230, 0.4);
  color: var(--offwhite);
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 6px; }
.nav-toggle__bars span:nth-child(3) { top: 12px; }

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

.site-header[data-open="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

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

/* -- 移动 / 平板导航 -- */
@media (max-width: 1139px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    justify-content: flex-start;
    overflow: visible;
    background: var(--ink);
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--cyan);
    max-height: calc(100vh - var(--header-h-compact));
    overflow-y: auto;
    padding: 8px var(--pad) 24px;
  }

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

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

  .nav__item { border-bottom: 1px solid rgba(242, 239, 230, 0.1); }

  .nav__link {
    width: 100%;
    padding: 16px 4px;
    font-size: 16px;
  }

  .nav__link::after { display: none; }

  .nav__link--flag {
    padding-left: 14px;
    border-left: 2px solid var(--cyan);
  }

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

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

@media (max-width: 640px) {
  .version-badge { display: none; }
  .btn--quick { padding: 7px 10px; font-size: 12px; }
}

@media (max-width: 400px) {
  .brand__sub { display: none; }
}

/* ============================================================
   7. FOOTER
   ============================================================ */
.site-footer {
  margin-top: clamp(40px, 6vw, 96px);
  background: var(--ink);
  color: rgba(242, 239, 230, 0.72);
  border-top: 3px solid var(--cyan);
}

.footer-inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 72px) var(--pad) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 1fr 1.3fr;
  gap: clamp(24px, 3vw, 52px);
}

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

.footer-brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--offwhite);
  transition: color 0.16s var(--ease);
}

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

.footer-tagline {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--offwhite);
}

.footer-note {
  margin-top: 12px;
  max-width: 32em;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(242, 239, 230, 0.5);
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

.footer-title::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--cyan);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-list a {
  display: inline-block;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(242, 239, 230, 0.72);
  transition: color 0.16s var(--ease), padding-left 0.16s var(--ease);
}

.footer-list a:hover {
  color: var(--cyan);
  padding-left: 4px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-list__label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(242, 239, 230, 0.42);
}

.contact-list__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--offwhite);
  overflow-wrap: anywhere;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cyan);
  border: 1px solid rgba(55, 240, 208, 0.4);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.copy-btn:hover,
.copy-btn[data-copied="true"] {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--cyan);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  margin-top: clamp(32px, 4vw, 56px);
  padding: 20px 0 clamp(24px, 3vw, 36px);
  border-top: 1px solid rgba(242, 239, 230, 0.14);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(242, 239, 230, 0.45);
}

.footer-copy { margin: 0; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-legal a {
  color: rgba(242, 239, 230, 0.6);
  transition: color 0.16s var(--ease);
}

.footer-legal a:hover { color: var(--cyan); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   8. REDUCED MOTION
   ============================================================ */
@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;
  }
}
