:root {
  color-scheme: light dark;
  --bg-page: #fbfbfd;
  --bg-surface: #ffffff;
  --bg-subtle: #f2f3f5;
  --bg-glass: rgba(251, 251, 253, 0.8);
  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #0066cc;
  --accent-btn: #0071e3;
  --accent-btn-hover: #005bb5;
  --accent-tint: rgba(0, 113, 227, 0.08);
  --l1: #15803d;
  --l1-bg: rgba(21, 128, 61, 0.1);
  --l2: #92400e;
  --l2-bg: rgba(217, 119, 6, 0.12);
  --l3: #c2410c;
  --l3-bg: rgba(234, 88, 12, 0.11);
  --l4: #b91c1c;
  --l4-bg: rgba(220, 38, 38, 0.1);
  --term-bg: #111317;
  --term-bar: #1a1d24;
  --term-text: #f3f4f6;
  --term-muted: #9ca3af;
  --term-green: #4ade80;
  --term-cyan: #38bdf8;
  --term-blue: #60a5fa;
  --term-yellow: #fbbf24;
  --term-red: #f87171;
  --term-magenta: #e879f9;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.035);
  --shadow-hero: 0 28px 60px rgba(0, 0, 0, 0.12);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  /* 中英混排优先系统字体：macOS 走 SF Pro / PingFang SC，跨平台非阻塞回退至 Inter / Noto Sans SC */
  --font-sans: "SF Pro SC", "SF Pro Display", "SF Pro Text", "PingFang SC", "Inter", "Noto Sans SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #000000;
    --bg-surface: #141519;
    --bg-subtle: #1d1f25;
    --bg-glass: rgba(12, 13, 16, 0.8);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.22);
    --accent: #2997ff;
    --accent-tint: rgba(41, 151, 255, 0.14);
    --l1: #4ade80;
    --l1-bg: rgba(74, 222, 128, 0.14);
    --l2: #facc15;
    --l2-bg: rgba(250, 204, 21, 0.14);
    --l3: #fb923c;
    --l3-bg: rgba(251, 146, 60, 0.14);
    --l4: #f87171;
    --l4-bg: rgba(248, 113, 113, 0.14);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.4);
    --shadow-hero: 0 30px 70px rgba(0, 0, 0, 0.65);
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(128, 128, 128, 0.45);
    --border-strong: rgba(128, 128, 128, 0.8);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 500;
}

p code, li code, td code {
  color: var(--text-primary);
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Liquid Glass 顶部导航 */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 400;
  padding: 8px 2px;
}

.nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.lang-switch:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-btn);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
}

.nav-cta:hover {
  background: var(--accent-btn-hover);
  text-decoration: none;
}

/* 精简首屏 Hero：只保留标题 + CTA + 视觉 Banner */
.hero {
  padding: 64px 0 36px;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto 38px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4.6vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hero-lead {
  margin: 0 auto 10px;
  max-width: 640px;
  font-size: clamp(1.06rem, 1.8vw, 1.22rem);
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 400;
}

.hero-meta {
  margin: 0 auto 28px;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-primary {
  background: var(--accent-btn);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-btn-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}

.hero-banner {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hero);
  background: var(--bg-surface);
}

.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* 交互式 CLI 橱窗 */
.terminal-wrap {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.terminal-card {
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--term-bar);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.traffic-lights {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-close { background: #ff5f57; }
.dot-min { background: #febc2e; }
.dot-max { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--term-muted);
}

.copy-btn {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--term-text);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.terminal-body {
  padding: 20px 24px 22px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.7;
  min-height: 220px;
  overflow-x: auto;
}

.term-cmd {
  color: var(--term-cyan);
  margin-bottom: 12px;
  font-weight: 500;
}

.term-line {
  color: var(--term-text);
  white-space: pre;
}

.term-muted { color: var(--term-muted); }
.term-green { color: var(--term-green); }
.term-cyan { color: var(--term-cyan); }
.term-blue { color: var(--term-blue); }
.term-yellow { color: var(--term-yellow); }
.term-red { color: var(--term-red); }
.term-magenta { color: var(--term-magenta); }

.mode-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.mode-pill {
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--term-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.mode-pill[aria-selected="true"] {
  background: var(--accent-btn);
  border-color: var(--accent-btn);
  color: #ffffff;
}

/* 通用区块排版 */
section {
  padding: 60px 0;
}

.section-header {
  max-width: 680px;
  margin: 0 auto 36px;
  text-align: center;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.surface-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.38;
}

.surface-card p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.cap-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 16px;
}

.cap-spec {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* 四级安全矩阵 */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.65;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.tier-l1 { background: var(--l1-bg); color: var(--l1); }
.tier-l2 { background: var(--l2-bg); color: var(--l2); }
.tier-l3 { background: var(--l3-bg); color: var(--l3); }
.tier-l4 { background: var(--l4-bg); color: var(--l4); }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

/* 分段安装与带复制按钮的代码块 */
.install-center {
  text-align: center;
}

.segmented-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-subtle);
  margin-bottom: 18px;
}

.seg-btn {
  min-height: 40px;
  padding: 8px 18px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.seg-btn[aria-selected="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.install-box {
  max-width: 780px;
  margin: 0 auto;
  text-align: left;
}

.code-block-wrap {
  position: relative;
}

.code-panel {
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: var(--radius-md);
  padding: 20px 76px 20px 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0;
}

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.install-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--text-tertiary);
  text-align: center;
}

.cli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.card-subtitle {
  margin: 14px 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .hero {
    padding: 44px 0 24px;
  }
  section {
    padding: 38px 0;
  }
  .terminal-body {
    padding: 16px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
