/* ==================== 设计变量 ==================== */
:root {
  --bg-base: #0B0C10;
  --bg-surface: #151820;
  --bg-card: #1A1D26;
  --bg-elevated: #222630;
  --text-primary: #E8E9EB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --accent: #00E599;
  --accent-hover: #00FFA8;
  --accent-alpha: rgba(0, 229, 153, 0.12);
  --border: #2A2D37;
  --border-focus: #00E599;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-heading: "Noto Sans SC", system-ui, sans-serif;
}

/* ==================== 基础重置与排版 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 流体字号 */
h1 { font-size: clamp(2rem, 1.5rem + 3vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 1.2rem + 2vw, 2.2rem); font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem); font-weight: 600; margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--text-secondary); }
strong, b { color: var(--text-primary); font-weight: 600; }

/* ==================== 布局系统 ==================== */
.container {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.section { padding: var(--space-xl) 0; position: relative; }
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (max-width: 900px) {
  .split-section { grid-template-columns: 1fr; }
  .section { padding: var(--space-lg) 0; }
}
.grid-2, .grid-3 { display: grid; gap: var(--space-md); min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
/* 全局防硬性撑开策略 */
h1, h2, h3, h4, p, li, span, strong, b { overflow-wrap: break-word; word-break: break-word; }

/* ==================== 导航与页头 ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: var(--space-xs); }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-weight: 600; font-size: 1.1rem; letter-spacing: 0.02em; }
.nav-list { display: flex; gap: var(--space-md); align-items: center; }
.nav-link {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-link[aria-current="page"] { color: var(--accent); font-weight: 500; }
.mobile-toggle { display: none; background: transparent; border: none; color: var(--text-primary); cursor: pointer; }
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-list {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg-base);
    flex-direction: column;
    padding: var(--space-md);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav-list.open { transform: translateX(0); }
}

/* ==================== 通用组件 ==================== */
/* 表格防溢出核心规则 */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}
th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
th { color: var(--text-primary); font-weight: 600; background: var(--bg-surface); }
td { color: var(--text-secondary); }
tr:hover td { background: rgba(255,255,255,0.02); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 500; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent); color: #0B0C10;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 229, 153, 0.25); }
.btn-outline {
  background: transparent; border-color: var(--border); color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-md); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-alpha); box-shadow: var(--shadow-card); }
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; font-size: 0.8rem; font-weight: 500;
  background: var(--accent-alpha); color: var(--accent); border-radius: 99px; margin-bottom: var(--space-xs);
}

/* FAQ Details */
details {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: var(--space-sm); transition: border-color 0.2s;
}
details[open] { border-color: var(--accent-alpha); }
summary {
  padding: var(--space-sm) var(--space-md); cursor: pointer; font-weight: 500;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 300; font-size: 1.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 var(--space-md) var(--space-md); color: var(--text-secondary); }
.details-content p { margin-bottom: 0.6rem; }

/* ==================== SVG 动效 ==================== */
.svg-draw path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.svg-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: floatNode 4s ease-in-out infinite;
}
@keyframes floatNode {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .svg-draw path, .svg-node { animation: none; }
}

/* ==================== 焦点与无障碍 ==================== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -999px; left: 0; background: var(--accent); color: #0B0C10;
  padding: 0.5rem 1rem; z-index: 200; font-weight: 500;
}
.skip-link:focus { top: 0; }

/* 小屏布局防溢出适配 */
@media (max-width: 600px) {
  .interface-mock {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    height: auto !important;
    min-height: 220px;
  }
  .mock-sidebar { display: none; }
}
code, .brand-name {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==================== 页脚 ==================== */
.footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: var(--space-lg) 0 var(--space-md); margin-top: var(--space-xl);
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-lg);
  margin-bottom: var(--space-md);
}
.footer-col h4 { color: var(--text-primary); margin-bottom: var(--space-sm); font-size: 1rem; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
  border-top: 1px solid var(--border); padding-top: var(--space-md);
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
