/* ============================================
   全局设计变量与基础重置
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0b0b12;
  --bg-secondary: #13131f;
  --bg-tertiary: #1a1a2c;
  --bg-card: #161625;
  --bg-card-hover: #1e1e33;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b82;
  --accent: #00e5a0;
  --accent-glow: rgba(0, 229, 160, 0.25);
  --accent-dark: #00c488;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 229, 160, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --font-heading: "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ============================================
   排版系统
   ============================================ */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 750; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin-bottom: 0.5em; }
p { margin-bottom: 1em; color: var(--text-secondary); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.section { padding: clamp(48px, 8vw, 96px) 0; position: relative; }
.section--dark { background: var(--bg-secondary); }
.section--accent-border { border-top: 1px solid var(--border-accent); }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6em;
  padding: 4px 12px;
  background: var(--accent-glow);
  border-radius: 20px;
}

/* ============================================
   页头 / Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 32px;
  width: auto;
}

.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--text-primary); }
.main-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.main-nav .nav-btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #0b0b12 !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}
.main-nav .nav-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ============================================
   页脚 / Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 0.85rem;
  margin-top: 8px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: #0b0b12;
}
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 18px; font-size: 0.85rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ============================================
   卡片网格
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
}
.card:hover { border-color: var(--border-accent); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.card h3 { font-size: 1.05rem; }
.card p { font-size: 0.9rem; margin-bottom: 0; }

/* ============================================
   FAQ Details/Summary
   ============================================ */
.faq-list { max-width: 820px; margin: 0 auto; }
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: border-color 0.2s;
}
details[open] { border-color: var(--border-accent); }
details summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.25s;
  flex-shrink: 0;
}
details[open] summary::after { transform: rotate(180deg); }
details .faq-answer {
  padding: 0 20px 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ============================================
   表格
   ============================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--bg-tertiary); }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-primary); font-size: 0.85rem; letter-spacing: 0.03em; }
td { color: var(--text-secondary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ============================================
   文章卡片
   ============================================ */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s;
}
.article-card:hover { border-color: var(--border-accent); transform: translateY(-3px); }
.article-meta { padding: 20px 20px 0; font-size: 0.78rem; color: var(--text-muted); }
.article-body { padding: 12px 20px 20px; }
.article-body h3 { font-size: 1rem; margin-bottom: 8px; }
.article-body p { font-size: 0.88rem; margin-bottom: 14px; }

/* ============================================
   相关链接
   ============================================ */
.related-links { max-width: 720px; margin: 0 auto; }
.related-links ul li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.related-links ul li:last-child { border-bottom: none; }
.related-links ul a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.related-links ul a:hover { color: var(--accent); }
.link-arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

/* ============================================
   分隔装饰
   ============================================ */
.section-divider {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

/* ============================================
   SVG 动效：折线绘制 + 节点浮动
   ============================================ */
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease-out forwards;
}
.float-node {
  animation: float-node 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* 延迟动画序列 */
.draw-delay-1 { animation-delay: 0.3s; }
.draw-delay-2 { animation-delay: 0.6s; }
.draw-delay-3 { animation-delay: 0.9s; }
.draw-delay-4 { animation-delay: 1.2s; }
.draw-delay-5 { animation-delay: 1.5s; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px clamp(16px, 4vw, 24px); gap: 12px; }
  .main-nav { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  h1 { font-size: 1.8rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================
   减少动态效果偏好
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .draw, .float-node, .pulse-glow { animation: none !important; }
}
