@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

/* ── 基础重置与 CSS 变量 ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base: #000000;
  --bg-surface: #121212;
  --bg-raised: #1a1a1a;
  --bg-card: #0d0d0d;
  --border: #1e2a3a;
  --border-bright: #2a3f5f;
  --accent-blue: #1a6bff;
  --accent-blue-soft: #2979ff;
  --accent-neon: #00e5ff;
  --accent-gold: #ffd600;
  --accent-purple: #b388ff;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a8b8;
  --text-muted: #606880;
  --text-bright: #ffffff;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-card: 10px;
  --radius-pill: 999px;
  --header-h: 64px;
  --anchor-h: 40px;
  --scroll-offset: 108px;
  --max-content: 1200px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 每个 article 给出 scroll-margin-top，避免粘性导航遮挡 */
article[id], div[id] {
  scroll-margin-top: var(--scroll-offset);
}

/* ── 通用工具 ── */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 顶部导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 品牌标记 */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* 主导航 —— nav > ol > li > a */
.primary-nav {
  flex: 1;
}

.primary-nav ol {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.primary-nav ol li {
  display: flex;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-pill:hover,
.nav-pill:focus-visible {
  color: var(--text-bright);
  border-color: var(--border-bright);
  background: var(--bg-raised);
  outline: none;
}

/* 顶部 CTA */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}

.header-cta {
  background: var(--accent-blue);
  color: #fff;
  flex-shrink: 0;
}

.header-cta:hover,
.header-cta:focus-visible {
  background: var(--accent-blue-soft);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(26, 107, 255, 0.5);
  outline: none;
}

.cta-primary {
  background: var(--accent-blue);
  color: #fff;
}

.cta-primary:hover,
.cta-primary:focus-visible {
  background: var(--accent-blue-soft);
  box-shadow: 0 0 20px rgba(26, 107, 255, 0.6);
  transform: translateY(-2px);
  outline: none;
}

.cta-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.cta-ghost:hover,
.cta-ghost:focus-visible {
  background: var(--bg-raised);
  color: var(--text-bright);
  outline: none;
}

/* 汉堡按钮（移动端） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

/* ── 二级粘性锚点条 ── */
.sticky-anchors {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: var(--anchor-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-anchors::-webkit-scrollbar { display: none; }

.anchors-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

.anchor-link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.anchor-link:first-child { border-left: 1px solid var(--border); }

.anchor-link:hover,
.anchor-link:focus-visible {
  color: var(--accent-neon);
  background: rgba(0, 229, 255, 0.05);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  outline: none;
}

/* ── Hero ── */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}

.hero-bg-num {
  position: absolute;
  left: -0.08em;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(120px, 22vw, 280px);
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26, 107, 255, 0.12);
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-media {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-bright);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.hero-placeholder {
  background: var(--bg-surface);
}

.placeholder-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--border-bright);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-neon);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
}

.hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── 主内容区 ── */
main {
  flex: 1;
}

.wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 40px 24px;
}

/* 契约结构: main > div.wrap > article > section */
.content-section {
  width: 100%;
}

.content-article {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

/* ── 文章正文 ── */
.article-body {
  min-width: 0;
}

/* 正文内 article 样式（page.content 带来的 article[id]） */
.article-body article {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.article-body article:last-child {
  border-bottom: none;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 10px;
}

.article-body p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}

.article-body a {
  color: var(--accent-blue-soft);
  text-decoration: underline;
  text-decoration-color: rgba(41, 121, 255, 0.4);
  transition: color var(--transition), text-decoration-color var(--transition);
}

.article-body a:hover {
  color: var(--accent-neon);
  text-decoration-color: var(--accent-neon);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
  margin-bottom: 14px;
}

.article-body li {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
}

.article-body th {
  background: var(--bg-surface);
  color: var(--text-bright);
  font-weight: 700;
}

.article-body td {
  color: var(--text-secondary);
}

/* small 眉题（h2 前） */
.article-body small,
.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-gold);
  padding-left: 8px;
}

/* ── 侧边栏 aside ── */
.content-aside {
  position: sticky;
  top: calc(var(--header-h) + var(--anchor-h) + 20px);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-purple);
  text-transform: uppercase;
  border-left: 3px solid var(--accent-purple);
  padding-left: 8px;
  display: block;
}

.aside-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.aside-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  counter-reset: aside-counter;
}

.aside-nav-list li {
  counter-increment: aside-counter;
}

.aside-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 40px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.aside-link::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 24px;
  font-variant-numeric: tabular-nums;
}

.aside-link:hover,
.aside-link:focus-visible {
  background: var(--bg-raised);
  color: var(--accent-neon);
  outline: none;
}

.aside-tip {
  background: var(--bg-raised);
  border-radius: 6px;
  padding: 12px;
  border-left: 2px solid var(--accent-blue);
}

.aside-tip small {
  font-size: 0.7rem;
  color: var(--accent-blue-soft);
  font-weight: 700;
  letter-spacing: 0.08em;
  border: none;
  padding: 0;
  margin: 0 0 4px;
}

.aside-tip p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── 页脚（极简：p + small） ── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.footer-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── 动效：Stagger List + Scroll Reveal ── */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: fadeSlideUp 0.6s ease both;
  }

  .hero-media {
    animation: fadeSlideUp 0.6s 0.12s ease both;
  }

  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Stagger list: nav pills */
  .primary-nav ol li {
    animation: fadeSlideDown 0.4s ease both;
  }

  @keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .primary-nav ol li:nth-child(1) { animation-delay: 0.05s; }
  .primary-nav ol li:nth-child(2) { animation-delay: 0.10s; }
  .primary-nav ol li:nth-child(3) { animation-delay: 0.15s; }
  .primary-nav ol li:nth-child(4) { animation-delay: 0.20s; }
  .primary-nav ol li:nth-child(5) { animation-delay: 0.25s; }
  .primary-nav ol li:nth-child(6) { animation-delay: 0.30s; }
  .primary-nav ol li:nth-child(7) { animation-delay: 0.35s; }
}

/* ── 响应式 ── */
@media (max-width: 960px) {
  .content-article {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  :root {
    --scroll-offset: 112px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 16px;
  }

  .hero-media {
    max-height: 220px;
  }

  .hero-section {
    min-height: auto;
  }

  /* 移动端导航 */
  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    z-index: 99;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ol {
    flex-direction: column;
    gap: 4px;
  }

  .primary-nav ol li {
    width: 100%;
  }

  .nav-pill {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    min-height: 44px;
  }

  .header-cta {
    display: none;
  }

  .header-inner {
    padding: 0 16px;
  }

  .hero-bg-num {
    font-size: clamp(80px, 30vw, 140px);
    opacity: 0.5;
  }

  .wrap {
    padding: 24px 16px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .cta-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .anchors-inner {
    padding: 0 8px;
  }

  .anchor-link {
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .content-aside {
    padding: 16px;
  }
}

/* ── 焦点可见性 ── */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* ── 选中颜色 ── */
::selection {
  background: rgba(26, 107, 255, 0.35);
  color: #fff;
}

/* ── 滚动条 ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }
