/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-primary: #7c3aed;
  --color-secondary: #db2777;
  --gradient-accent: linear-gradient(135deg, #7c3aed, #db2777);
  --gradient-bg: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.12) 0%, rgba(219, 39, 119, 0.08) 100%);

  --bg-body: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.78);
  --border-glass: rgba(255, 255, 255, 0.45);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(124, 58, 237, 0.15);

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 999px;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;

  --font-base: "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --line-height-base: 1.8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--text-main);
  background-color: var(--bg-body);
  background-image: var(--gradient-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ==================== 排版系统 ==================== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; }
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  text-wrap: balance;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
}
.text-muted { color: var(--text-muted); font-size: 0.95rem; }
.prose p { margin-bottom: var(--space-md); color: var(--text-secondary); }
.prose ul, .prose ol { padding-left: var(--space-md); margin-bottom: var(--space-md); }
.prose li { margin-bottom: var(--space-xs); }

/* ==================== 布局组件 ==================== */
.grid-auto { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); }

/* ==================== 头部与导航 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
}
.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: var(--space-sm); }
.brand img { height: 36px; width: auto; object-fit: contain; }
.nav-list { display: flex; gap: var(--space-lg); }
.nav-link {
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-xs); }

/* ==================== 按钮与表单 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
  text-align: center;
}
.btn-primary {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35); }
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border-glass);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ==================== 卡片与玻璃拟态 ==================== */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: #fff;
}
.card-icon svg { width: 24px; height: 24px; stroke-width: 2; }

/* ==================== 表格与步骤 ==================== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-glass); background: var(--bg-glass); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: var(--space-md); text-align: left; border-bottom: 1px solid var(--border-glass); }
th { background: rgba(124, 58, 237, 0.05); font-weight: 600; color: var(--text-main); }
tr:last-child td { border-bottom: none; }
.step-list { counter-reset: step; padding-left: 0; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: var(--space-md);
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== FAQ 样式 ==================== */
.faq-item { margin-bottom: var(--space-md); border: 1px solid var(--border-glass); border-radius: var(--radius-md); background: var(--bg-glass); }
.faq-summary {
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "+"; font-size: 1.25rem; color: var(--text-muted); transition: transform 0.2s; }
.faq-item[open] .faq-summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 var(--space-lg) var(--space-md); color: var(--text-secondary); line-height: 1.7; }

/* ==================== 文章卡片与链接 ==================== */
.article-card { display: flex; flex-direction: column; height: 100%; }
.article-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--space-xs); }
.article-title { font-size: 1.1rem; font-weight: 600; margin-bottom: var(--space-sm); line-height: 1.4; }
.article-excerpt { flex-grow: 1; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--space-md); }
.related-list a { display: block; padding: var(--space-sm) 0; border-bottom: 1px dashed var(--border-glass); }
.related-list a:last-child { border-bottom: none; }
.related-link { font-weight: 500; }
.related-desc { font-size: 0.85rem; color: var(--text-muted); }

/* ==================== 页脚 ==================== */
.site-footer { background: #0f172a; color: #cbd5e1; padding: var(--space-xl) 0 var(--space-lg); margin-top: var(--space-xxl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-lg); }
.footer-heading { color: #fff; font-weight: 600; margin-bottom: var(--space-md); }
.footer-links a { display: block; padding: var(--space-xs) 0; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-lg); text-align: center; font-size: 0.85rem; }

/* ==================== SVG 动效系统 ==================== */
.svg-container { width: 100%; max-width: 480px; margin: 0 auto; }
.svg-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: stroke-advance 6s ease-in-out infinite;
}
.svg-pulse { animation: soft-pulse 4s ease-in-out infinite; }
.svg-rotate { animation: gentle-spin 20s linear infinite; transform-box: fill-box; transform-origin: center; }

@keyframes stroke-advance {
  0%, 100% { stroke-dashoffset: 1; opacity: 0.6; }
  50% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes soft-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes gentle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .svg-draw, .svg-pulse, .svg-rotate { animation: none !important; }
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
  .header-inner { height: 64px; }
  .nav-list { display: none; }
  .mobile-toggle { display: block; }
  .section { padding: var(--space-lg) 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .flex-between { flex-direction: column; align-items: flex-start; }
  .hero-content { text-align: center; }
}
