/* ── 变量 ── */
:root {
  --bg: #0a0c14;
  --bg2: #0f1220;
  --surface: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.08);
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 12px;
}
.light {
  --bg: #f8fafc; --bg2: #f1f5f9;
  --surface: rgba(0,0,0,.04);
  --border: rgba(0,0,0,.1);
  --text: #0f172a; --text-muted: #64748b;
  --accent: #0284c7; --accent2: #7c3aed;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'PingFang SC', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  cursor: none;
  overflow-x: hidden;
}

/* ── 背景画布 ── */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: .85;
  transition: opacity .3s;
}
.light #bg-canvas { opacity: .25; }

/* ── 自定义光标 ── */
#cursor {
  position: fixed; width: 10px; height: 10px;
  background: var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .15s, height .15s, background .2s;
  mix-blend-mode: screen;
}
#cursor-trail {
  position: fixed; width: 32px; height: 32px;
  border: 1px solid var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  opacity: .5;
  transition: opacity .3s;
}
body:has(a:hover) #cursor,
body:has(button:hover) #cursor { width: 20px; height: 20px; background: var(--accent2); }

/* ── 顶栏 ── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background .3s;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 24px;
  max-width: 1200px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; color: var(--accent); }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.top-nav { display: flex; align-items: center; gap: 20px; }
.top-link { color: var(--text-muted); text-decoration: none; font-size: 13px; transition: color .2s; }
.top-link:hover { color: var(--accent); }
.nav-badge {
  font-size: 11px; padding: 2px 8px;
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 20px; text-decoration: none;
}
.btn-theme {
  background: none; border: 1px solid var(--border);
  color: var(--text); width: 32px; height: 32px;
  border-radius: 8px; cursor: none; font-size: 16px;
  transition: border-color .2s, color .2s;
}
.btn-theme:hover { border-color: var(--accent); color: var(--accent); }

/* ── 布局 ── */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── 侧边栏 ── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  scrollbar-width: none;
}
#sidebar::-webkit-scrollbar { display: none; }
.sidebar-inner { padding: 24px 0 40px; }
.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 20px 8px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 20px;
  color: var(--text-muted); text-decoration: none;
  font-size: 13.5px; border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
  position: relative;
}
.si {
  width: 14px; height: 14px; flex-shrink: 0;
  opacity: .5; transition: opacity .2s;
  filter: invert(1);
}
.light .si { filter: none; }
.sidebar-link:hover .si { opacity: .8; }
.sidebar-link.active .si { opacity: 1; filter: invert(62%) sepia(90%) saturate(400%) hue-rotate(160deg); }
.sidebar-link:hover { color: var(--text); background: var(--surface); }
.sidebar-link.active {
  color: var(--accent); border-left-color: var(--accent);
  background: rgba(0,212,255,.06);
}

/* ── 主内容 ── */
#content {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 56px 120px;
}

/* ── Hero ── */
.hero-section {
  padding: 60px 0 80px;
  position: relative;
}
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(0,212,255,.3);
  padding: 4px 14px; border-radius: 20px;
  background: rgba(0,212,255,.06); margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 70%, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 18px; color: var(--text-muted); margin-bottom: 36px;
  letter-spacing: 2px;
}
.hero-actions { display: flex; gap: 16px; margin-bottom: 56px; }
.btn-primary-glow {
  padding: 12px 28px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600; text-decoration: none;
  font-size: 14px; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 20px rgba(0,212,255,.3);
}
.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0,212,255,.5);
}
.btn-ghost {
  padding: 12px 28px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── 统计卡片 ── */
.hero-stats { display: flex; gap: 24px; }
.stat-card {
  flex: 1; padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color .3s, transform .3s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-num { font-size: 32px; font-weight: 800; color: var(--accent); }
.stat-unit { font-size: 18px; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── 文档章节 ── */
.doc-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.doc-section:last-child { border-bottom: none; }
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.section-tag {
  font-size: 11px; font-weight: 700; color: var(--accent2);
  background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.25);
  padding: 3px 10px; border-radius: 6px; letter-spacing: 1px;
}
.section-title {
  font-size: 26px; font-weight: 700;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 内容样式 ── */
.doc-p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.8; }
.sub-title { font-size: 18px; font-weight: 700; margin: 32px 0 12px; color: var(--text); }
.platform-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; margin: 24px 0 10px; color: var(--text);
}
.platform-title .si { width: 16px; height: 16px; opacity: .7; }
.doc-list { padding-left: 20px; color: var(--text-muted); line-height: 2; margin-bottom: 16px; }
.doc-list li::marker { color: var(--accent); }
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; padding: 2px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; color: var(--accent);
}
.code-block {
  position: relative; margin-bottom: 16px;
  background: rgba(0,0,0,.35); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.light .code-block { background: rgba(0,0,0,.05); }
.code-block pre { padding: 16px 20px; overflow-x: auto; margin: 0; }
.code-block code {
  background: none; border: none; padding: 0;
  color: #7dd3fc; font-size: 13px; line-height: 1.7;
}
.light .code-block code { color: #0369a1; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; padding: 3px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); cursor: none;
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.doc-img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 16px;
  display: block;
}
.alert-box {
  display: flex; gap: 14px; padding: 18px 20px;
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25);
  border-radius: var(--radius); margin-bottom: 28px;
}
.alert-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; filter: invert(80%) sepia(60%) saturate(500%) hue-rotate(5deg); }
.alert-box strong { display: block; margin-bottom: 8px; color: var(--text); }
.alert-box p { color: var(--text-muted); margin-bottom: 10px; }

/* ── 占位块 ── */
.placeholder-block {
  height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px;
  background: var(--surface);
}

/* ── 滚动动画初始状态 ── */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal-section { opacity: 0; transform: translateY(32px); }

/* ── 点击粒子 ── */
#click-particles { position: fixed; inset: 0; pointer-events: none; z-index: 9997; }
.click-particle {
  position: absolute; width: 6px; height: 6px;
  border-radius: 50%; pointer-events: none;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── 响应式 ── */
@media (max-width: 1240px) {
  .layout { max-width: 100%; }
}
@media (max-width: 960px) {
  :root { --sidebar-w: 200px; }
  #content { padding: 40px 32px 80px; }
}
@media (max-width: 768px) {
  #sidebar { display: none; }
  #content { padding: 40px 20px 80px; max-width: 100%; margin: 0; }
  .hero-stats { flex-direction: column; }
  .hero-actions { flex-direction: column; }
}

/* ── 语言切换 ── */
.btn-lang { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px 8px; opacity: .7; transition: opacity .2s; }
.btn-lang:hover { opacity: 1; }
.lang-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.lang-modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 28px; width: 560px; max-width: 90vw; position: relative; }
.lang-modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.lang-modal-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.lang-modal-icon { font-size: 32px; background: rgba(0,132,255,.1); border-radius: 50%; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.lang-modal-title { font-size: 20px; font-weight: 700; color: var(--text); }
.lang-modal-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.lang-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.lang-option { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px; text-align: left; transition: border-color .2s, background .2s; }
.lang-option:hover { border-color: var(--accent); background: rgba(0,212,255,.04); }
.lang-option.active { border-color: var(--accent); background: rgba(0,212,255,.08); }
.lang-name { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.lang-native { font-size: 12px; color: var(--text-muted); }
.lang-code { font-size: 11px; background: var(--border); border-radius: 20px; padding: 2px 8px; color: var(--text-muted); }
.lang-option.active .lang-code { background: var(--accent); color: #000; }
.lang-modal-footer { text-align: center; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 16px; }
