/* =========================================================
   优越会指定站 · 共享样式表 /assets/site.css
   分屏系统 · 深海蓝基底 · 青柠绿行动点 · 琥珀金状态
   ========================================================= */

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

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

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

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

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

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

button { background: none; border: 0; }

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

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

/* ---------- 2. Tokens ---------- */
:root {
  /* 色板 */
  --c-deep: #0B2136;
  --c-midnight: #132C45;
  --c-abyss: #081726;
  --c-mist: #EAF1F6;
  --c-ivory: #F7FAFC;
  --c-silver: #C6D2DD;
  --c-slate: #8496A6;
  --c-lime: #A3E635;
  --c-amber: #F0A93B;
  --c-azure: #2F7BB5;
  --c-mint: #5ED3C0;

  /* 语义 */
  --ink: #0B2136;
  --ink-soft: #3D5568;
  --ink-mute: #5E7386;
  --paper: #F7FAFC;
  --paper-alt: #EAF1F6;
  --line: rgba(11, 33, 54, 0.12);
  --line-dark: rgba(198, 210, 221, 0.16);

  /* 字体 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 999px;

  /* 度量 */
  --rail-w: 272px;
  --header-h: 72px;
  --wrap-max: 1320px;
  --gutter: clamp(18px, 3.4vw, 40px);

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 180ms;
  --dur: 260ms;
  --dur-slow: 360ms;
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -0.012em;
}

h1 { font-size: clamp(34px, 5.2vw, 64px); }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3 { font-size: clamp(19px, 1.9vw, 24px); }

p { max-width: 76ch; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--c-lime);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--c-lime);
  color: var(--c-abyss);
}

/* ---------- 4. 布局骨架 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-main { display: block; flex: 1 0 auto; }

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: clamp(26px, 3.6vw, 56px);
  align-items: start;
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(26px, 3.6vw, 48px) clamp(60px, 8vw, 110px);
}

.shell > .shell-full { grid-column: 1 / -1; }

/* 左侧吸顶轨道 */
.rail {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--c-mist);
  border: 1px solid var(--line);
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.rail-link:hover { background: var(--c-ivory); color: var(--c-deep); }

.rail-link[aria-current="true"] {
  background: var(--c-deep);
  color: var(--c-ivory);
  border-color: rgba(163, 230, 53, 0.55);
}

.rail-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-slate);
  font-variant-numeric: tabular-nums;
}

.rail-link[aria-current="true"] .rail-index { color: var(--c-lime); }

/* 12 列网格 */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 32px);
}

.col-3 { grid-column: span 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; }

/* 正文容器 */
.prose {
  max-width: 74ch;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink-soft);
}

.prose h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  margin: 1.9em 0 0.6em;
}

.prose h3 { font-size: 20px; margin: 1.6em 0 0.5em; }

.prose p { margin-bottom: 1.05em; }

.prose ul { display: grid; gap: 10px; margin: 0 0 1.2em; }

.prose ul li {
  position: relative;
  padding-left: 20px;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-lime);
}

.prose a {
  color: var(--c-azure);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

.prose strong { color: var(--ink); font-weight: 700; }

/* 面包屑 */
.breadcrumbs {
  font-size: 13px;
  color: var(--c-slate);
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

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

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

.breadcrumbs li::after {
  content: "/";
  color: var(--c-silver);
}

.breadcrumbs li:last-child::after { content: ""; }

.breadcrumbs a { color: var(--c-azure); }
.breadcrumbs a:hover { color: var(--c-deep); }

/* ---------- 5. 按钮与标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--c-lime);
  color: #07182a;
  border-color: var(--c-lime);
}

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

.btn-ghost {
  background: transparent;
  color: var(--c-mist);
  border-color: rgba(198, 210, 221, 0.34);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(198, 210, 221, 0.3);
  color: var(--c-slate);
  background: rgba(234, 241, 246, 0.05);
}

.tag--lime {
  border-color: rgba(163, 230, 53, 0.42);
  color: #4c6b12;
  background: rgba(163, 230, 53, 0.16);
}

.tag--amber {
  border-color: rgba(240, 169, 59, 0.45);
  color: #8a5a05;
  background: rgba(240, 169, 59, 0.16);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-amber);
  flex: none;
  animation: statusPulse 2.8s var(--ease) infinite;
}

@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 169, 59, 0.55); }
  60%  { box-shadow: 0 0 0 7px rgba(240, 169, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 169, 59, 0); }
}

/* ---------- 6. 图片 / 视觉容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(148deg, #0B2136 0%, #132C45 52%, #0d2a44 100%);
  isolation: isolate;
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(198, 210, 221, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 210, 221, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

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

.media-frame svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3  { aspect-ratio: 4 / 3; }
.media-frame--3x4  { aspect-ratio: 3 / 4; }
.media-frame--1x1  { aspect-ratio: 1 / 1; }

.media-frame--16x9 > img,
.media-frame--4x3 > img,
.media-frame--3x4 > img,
.media-frame--1x1 > img {
  position: absolute;
  inset: 0;
}

.media-frame__label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  background: rgba(8, 23, 38, 0.74);
  border: 1px solid rgba(198, 210, 221, 0.24);
  color: var(--c-mist);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ---------- 7. 头部命令栏 ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 120;
  padding: 10px 20px;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--c-lime);
  color: #07182a;
  font-size: 14px;
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus { top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 268px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
  min-height: 70px;
  padding: 9px var(--gutter);
  background: linear-gradient(180deg, #0B2136 0%, #102A44 100%);
  color: var(--c-mist);
  border-bottom: 1px solid rgba(198, 210, 221, 0.14);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(163, 230, 53, 0.55), transparent);
  pointer-events: none;
}

.header-rail {
  display: flex;
  align-items: center;
  min-width: 0;
}

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

.brand-mark {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--c-lime), var(--c-mint));
  color: #07182a;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
}

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

.brand-line {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--c-ivory);
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.09em;
  color: var(--c-slate);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.header-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-silver);
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.header-nav a:hover {
  background: rgba(234, 241, 246, 0.09);
  color: var(--c-ivory);
}

.header-nav a[aria-current="page"] {
  background: var(--c-lime);
  color: #07182a;
  border-color: var(--c-lime);
  font-weight: 600;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--c-slate);
  font-variant-numeric: tabular-nums;
}

.header-nav a[aria-current="page"] .nav-index { color: rgba(7, 24, 42, 0.6); }

.nav-label { white-space: nowrap; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(240, 169, 59, 0.38);
  background: rgba(240, 169, 59, 0.1);
  color: #F5C877;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(198, 210, 221, 0.3);
  background: transparent;
  color: var(--c-mist);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

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

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.site-header[data-open] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) 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(-6px) rotate(-45deg); }

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(198, 210, 221, 0.1);
  overflow: hidden;
  pointer-events: none;
}

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

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: auto;
  background: var(--c-abyss);
  color: var(--c-silver);
  border-top: 1px solid rgba(198, 210, 221, 0.1);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(198, 210, 221, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 210, 221, 0.05) 1px, transparent 1px);
  background-size: 68px 68px;
}

.footer-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr) minmax(0, 1.35fr);
  gap: clamp(28px, 4vw, 60px);
  padding-block: clamp(46px, 6.5vw, 80px) clamp(30px, 4vw, 52px);
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.footer-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--c-lime), var(--c-mint));
  color: #07182a;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}

.footer-logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--c-ivory);
}

.footer-note {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--c-slate);
  max-width: 40ch;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(163, 230, 53, 0.28);
  background: rgba(163, 230, 53, 0.1);
  color: #C7EE8C;
  font-size: 12.5px;
  letter-spacing: 0.05em;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--c-slate);
  margin-bottom: 18px;
}

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

.footer-links a {
  position: relative;
  display: inline-block;
  padding-left: 17px;
  font-size: 15px;
  color: #D6E1EA;
  transition: color var(--dur-fast) var(--ease);
}

.footer-links a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--c-slate);
  transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.footer-links a:hover { color: var(--c-lime); }
.footer-links a:hover::before { width: 12px; background: var(--c-lime); }

.footer-meta { display: grid; gap: 12px; margin-bottom: 18px; }

.footer-meta li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.footer-meta-key {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--c-slate);
}

.footer-meta-val {
  font-size: 14px;
  color: #D6E1EA;
  word-break: break-word;
}

.footer-meta-val.is-mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.footer-hint {
  max-width: 42ch;
  padding-left: 12px;
  border-left: 2px solid rgba(240, 169, 59, 0.55);
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--c-slate);
}

.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  padding-block: 20px 30px;
  border-top: 1px solid rgba(198, 210, 221, 0.12);
}

.footer-legal {
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--c-slate);
}

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

.footer-legal--dim { color: var(--ink-mute); }

/* ---------- 9. 滚动显现 ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

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

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px var(--gutter) 20px;
    background: var(--c-abyss);
    border-bottom: 1px solid rgba(198, 210, 221, 0.16);
    box-shadow: 0 26px 52px -26px rgba(0, 0, 0, 0.7);
  }

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

  .header-nav a {
    padding: 13px 15px;
    border-radius: var(--r-md);
    font-size: 15.5px;
  }

  .header-nav a[aria-current="page"] {
    border-color: rgba(163, 230, 53, 0.5);
  }

  .header-nav a[aria-current="page"] .nav-index { color: rgba(7, 24, 42, 0.6); }

  .header-actions { display: none; }

  .nav-toggle { display: flex; }

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

  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }

  .rail-link { padding: 9px 14px; }
}

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

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

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

  .brand-sub { display: none; }
  .brand-line { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }

  .read-progress { height: 3px; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-meta li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .media-frame { border-radius: var(--r-md); }
}

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

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

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