/* ============================================================
   /assets/site.css — 共享外壳与基础组件（水下霓虹索引）
   ============================================================ */

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

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

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

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

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

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

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

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

/* ---------- 2. Tokens ---------- */
:root {
  /* 色板 */
  --abyss-950: #05121D;
  --abyss-800: #0B2437;
  --abyss-600: #16405C;
  --coral-500: #FF6B4A;
  --coral-300: #FFA48C;
  --cyan-400: #33E6D2;
  --sand-200: #E7DAC3;
  --paper-050: #F6F2E9;
  --ink-900: #0E1216;
  --mist-400: #93AEBE;

  /* 语义色（可被 .section--* 覆写） */
  --fg: #F6F2E9;
  --fg-dim: #93AEBE;
  --rule: rgba(147, 174, 190, 0.20);
  --rule-soft: rgba(147, 174, 190, 0.10);
  --surface: #0B2437;
  --surface-2: #16405C;
  --accent: #FF6B4A;
  --accent-2: #33E6D2;

  /* 字体 */
  --font-display: "MiSans", "Alibaba PuHuiTi 3.0", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-text: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  /* 五级字号 */
  --step-0: 0.8125rem;                       /* 13 等宽小标签 */
  --step-1: 1rem;                            /* 16 正文 */
  --step-2: 1.375rem;                        /* 22 小节标题 */
  --step-3: clamp(1.75rem, 3vw, 2.25rem);    /* 28–36 栏目名 */
  --display: clamp(2.75rem, 7vw, 6.5rem);    /* 首屏主标题 */

  /* 间距（8 的倍数） */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 72px;
  --sp-6: 120px;

  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 76px;
  --ease: cubic-bezier(0.4, 0.05, 0.2, 1);
}

/* ---------- 3. 基础中文排版 ---------- */
body {
  background: var(--abyss-950);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--step-1);
  font-weight: 340;
  line-height: 1.9;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { max-width: 68ch; }

::selection {
  background: var(--cyan-400);
  color: var(--abyss-950);
}

/* ---------- 4. 焦点与可达性 ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 220;
  padding: 12px 20px;
  background: var(--coral-500);
  color: #170B07;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform 160ms var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

body.is-nav-open { overflow: hidden; }

/* ---------- 5. 布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.section {
  position: relative;
  padding-block: clamp(48px, 7vw, 104px);
}

.section--raised { background: var(--abyss-800); }

.section--paper {
  --fg: #0E1216;
  --fg-dim: #4C6473;
  --rule: rgba(14, 18, 22, 0.16);
  --rule-soft: rgba(14, 18, 22, 0.08);
  --surface: #EFE9DC;
  --surface-2: #E2D8C4;
  background: var(--paper-050);
  color: var(--fg);
}

.section--sand {
  --fg: #0E1216;
  --fg-dim: #55636C;
  --rule: rgba(14, 18, 22, 0.18);
  --rule-soft: rgba(14, 18, 22, 0.09);
  --surface: #F1E7D3;
  --surface-2: #DCCFB4;
  background: var(--sand-200);
  color: var(--fg);
}

/* ---------- 6. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  --header-h: 76px;
  background: rgba(5, 18, 29, 0.94);
  border-bottom: 1px solid var(--rule-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header[data-condensed] { --header-h: 60px; }

.header-inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  transition: min-height 200ms var(--ease);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-block: 14px;
  color: var(--paper-050);
  flex: 0 0 auto;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand__mark::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 10px;
  background: var(--coral-500);
  border-radius: 1px;
  transform: translateY(-1px);
}

.brand__domain {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--mist-400);
  border-left: 1px solid var(--rule);
  padding-left: 12px;
  transform: translateY(1px);
}

.site-header[data-condensed] .brand__domain { opacity: 0.7; }

.header-rail {
  position: relative;
  height: 2px;
  background: rgba(22, 64, 92, 0.55);
}

.header-rail__bar {
  display: block;
  width: 0;
  height: 2px;
  background: var(--coral-500);
}

/* ---------- 7. 导航 ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  flex: 0 0 auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
}

.nav-list a {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--mist-400);
  white-space: nowrap;
  transition: color 180ms var(--ease);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--cyan-400);
  transition: right 180ms var(--ease), background 180ms var(--ease);
}

.nav-list a:hover { color: var(--paper-050); }
.nav-list a:hover::after { right: 0; }

.nav-list a[aria-current="page"] {
  color: var(--paper-050);
  font-weight: 600;
}

.nav-list a[aria-current="page"]::after {
  right: 0;
  background: var(--coral-500);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--abyss-600);
  border-radius: 2px;
  color: var(--paper-050);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.06em;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

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

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.nav-toggle__bars span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 200ms var(--ease), opacity 160ms var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav-toggle__text { line-height: 1; }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 180ms var(--ease), color 180ms var(--ease),
              border-color 180ms var(--ease), transform 180ms var(--ease);
}

.btn--cta {
  background: var(--coral-500);
  color: #170B07;
}

.btn--cta:hover {
  background: var(--coral-300);
  transform: translateY(-2px);
}

.btn--cta:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  border-color: var(--abyss-600);
  color: var(--fg);
}

.btn--ghost:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
  transform: translateY(-2px);
}

.btn--ghost:active { transform: translateY(0); }

.nav-cta { flex: 0 0 auto; }

/* ---------- 9. 页脚 ---------- */
.site-footer {
  background: var(--abyss-950);
  border-top: 1px solid var(--rule);
  color: var(--paper-050);
  padding-block: clamp(40px, 6vw, 72px) 28px;
}

.footer-inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  gap: clamp(32px, 5vw, 56px);
}

.footer-mast {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--paper-050);
}

.footer-brand::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: var(--coral-500);
  transform: translateY(-2px);
}

.footer-domain {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.08em;
  color: var(--mist-400);
}

.footer-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(24px, 4vw, 56px);
}

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

.footer-column__title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist-400);
  margin-bottom: 16px;
}

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

.footer-links a {
  display: inline-block;
  font-size: 0.9375rem;
  color: var(--paper-050);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.footer-links a:hover {
  color: var(--cyan-400);
  border-bottom-color: var(--cyan-400);
}

.footer-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 18px;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.footer-contact dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--mist-400);
  padding-top: 4px;
  white-space: nowrap;
}

.footer-contact dd { color: var(--paper-050); }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule);
}

.footer-legal,
.footer-sign {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--mist-400);
  max-width: none;
}

/* ---------- 10. 通用小件 ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: 0 0 auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--fg-dim);
  white-space: nowrap;
}

.tag--coral {
  color: var(--coral-500);
  border-color: currentColor;
}

.plate {
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--coral-500);
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--fg);
}

.plate p { max-width: 62ch; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
}

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

.breadcrumb li + li::before {
  content: "/";
  color: var(--abyss-600);
}

.breadcrumb a { transition: color 160ms var(--ease); }
.breadcrumb a:hover { color: var(--cyan-400); }

.index-list { display: grid; gap: 0; }

.index-list a {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 12px 18px 26px;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  transition: color 160ms var(--ease);
}

.index-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--abyss-600);
  transform: translateY(-50%);
  transition: width 180ms var(--ease), background 180ms var(--ease);
}

.index-list a:hover { color: var(--paper-050); }
.index-list a:hover::before {
  width: 20px;
  background: var(--coral-500);
}

.index-list__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

/* ---------- 11. 正文容器 ---------- */
.prose {
  max-width: 66ch;
  font-size: var(--step-1);
  line-height: 1.95;
  color: var(--fg);
}

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

.prose h2 {
  font-size: var(--step-3);
  font-weight: 800;
  margin-top: 2em;
  padding-left: 16px;
  border-left: 3px solid var(--coral-500);
  line-height: 1.3;
}

.prose h3 {
  font-size: var(--step-2);
  font-weight: 700;
  margin-top: 1.8em;
  line-height: 1.4;
}

.prose ul, .prose ol {
  padding-left: 1.3em;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.5em; }

.prose a {
  color: var(--cyan-400);
  border-bottom: 1px solid currentColor;
}

.prose blockquote {
  padding: 18px 22px;
  border-left: 3px solid var(--cyan-400);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.9375rem;
}

/* ---------- 12. 图片容器基础规则 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 0;
}

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

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

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--fg-dim);
}

/* ---------- 13. 分段切换器 ---------- */
.segmented { display: block; }

.segmented__list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-4);
}

.segmented__tab {
  position: relative;
  margin-bottom: -1px;
  padding: 13px 20px;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  transition: color 180ms var(--ease), background 180ms var(--ease),
              border-color 180ms var(--ease);
}

.segmented__tab:hover {
  color: var(--fg);
  background: rgba(51, 230, 210, 0.07);
}

.segmented__tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--cyan-400);
}

.segmented__panel[hidden] { display: none; }

.segmented__panel:not([hidden]) {
  animation: segIn 200ms var(--ease) both;
}

@keyframes segIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 14. 显现 ---------- */
html.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}

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

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 70;
    width: min(86vw, 360px);
    padding: calc(var(--header-h) + 28px) 24px 36px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--abyss-800);
    border-left: 1px solid var(--abyss-600);
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(101%);
    transition: transform 260ms var(--ease), visibility 0s linear 260ms;
  }

  .site-nav[data-open="true"] {
    visibility: visible;
    transform: none;
    transition: transform 260ms var(--ease), visibility 0s linear 0s;
  }

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

  .nav-list li { border-bottom: 1px solid var(--rule); }

  .nav-list a {
    display: block;
    padding: 16px 2px;
    font-size: 1.0625rem;
    color: var(--paper-050);
  }

  .nav-list a::after { display: none; }

  .nav-list a[aria-current="page"] {
    color: var(--coral-500);
    font-weight: 600;
  }

  .nav-list a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 6px;
    height: 6px;
    background: var(--coral-500);
    transform: translateY(-50%);
  }

  .nav-cta {
    margin-top: 28px;
    width: 100%;
  }

  .brand__domain { display: none; }

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

  .footer-column--contact { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); }
  .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: span 6; }

  .footer-columns { grid-template-columns: minmax(0, 1fr); }
  .footer-column--contact { grid-column: auto; }
}

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

  .brand__mark { font-size: 0.9375rem; }
  .brand__mark::before { width: 7px; height: 7px; margin-right: 8px; }

  .nav-toggle { padding: 9px 12px; }
  .nav-toggle__text { display: none; }

  .section { padding-block: 44px; }

  .footer-contact { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .footer-contact dd { margin-bottom: 12px; }

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

/* ---------- 16. 动效偏好 ---------- */
@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;
  }

  .site-header .header-inner { transition: none; }
  html.js-reveal [data-reveal] { opacity: 1; transform: none; }
}
