/* === 基础重置与变量定义 === */
:root {
  /* 配色方案 */
  --color-deep: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  
  /* 组件样式变量 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  
  /* 布局节奏 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding-left: 0;
  list-style: none;
}

/* === 排版系统 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 眉标 */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}

.dark-section .badge {
  color: var(--color-accent);
}

/* 标题 */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.text-highlight {
  color: var(--color-brand);
}

.dark-section .text-highlight {
  color: var(--color-accent);
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-deep);
}

.btn-primary:hover {
  background-color: #5ce096;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(110, 237, 168, 0.4);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.dark-section .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(31, 21, 35, 0.05);
  transform: translateY(-1px);
}

.dark-section .btn-secondary:hover {
  background-color: rgba(246, 243, 247, 0.1);
}

/* === 卡片与面板 === */
.card {
  background-color: white;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.dark-section .card {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-2px);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

/* === 列表与定义列表 === */
dl.feature-list dt {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--color-brand);
}

.dark-section dl.feature-list dt {
  color: var(--color-accent);
}

dl.feature-list dd {
  margin-bottom: 1.5rem;
  color: var(--color-text);
  opacity: 0.9;
}

/* === 时间轴组件 === */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(158, 19, 221, 0.2);
}

.dark-section .timeline {
  border-left-color: rgba(110, 237, 168, 0.3);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.55rem;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-brand);
  border: 2px solid var(--color-paper);
}

.dark-section .timeline-marker {
  background-color: var(--color-accent);
  border-color: var(--color-deep);
}

.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 0.25rem;
  display: block;
}

.dark-section .timeline-time {
  color: var(--color-accent);
}

/* === 表格组件 === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid rgba(31, 21, 35, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}

th {
  font-weight: 700;
  background-color: rgba(31, 21, 35, 0.03);
  width: 30%;
}

tr:last-child td {
  border-bottom: none;
}

/* === FAQ 组件 === */
details.faq-item {
  background-color: white;
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

summary {
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 3rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--color-brand);
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.details-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--color-text);
  opacity: 0.9;
}

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  padding: 0.75rem 0;
}

.dark-section-bg {
  background-color: var(--color-deep);
  color: var(--color-paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-logo img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-brand);
}

.dark-section .nav-link:hover, 
.dark-section .nav-link[aria-current="page"] {
  color: var(--color-accent);
}

.footer {
  background-color: var(--color-deep);
  color: var(--color-paper);
  padding: 3rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 1;
  color: var(--color-accent);
}

/* === SVG 动效 (Grid Nodes) === */
@keyframes node-light {
  0%, 100% {
    fill: rgba(110, 237, 168, 0.1);
    stroke: rgba(110, 237, 168, 0.2);
  }
  50% {
    fill: rgba(110, 237, 168, 0.8);
    stroke: rgba(110, 237, 168, 1);
  }
}

@keyframes float-panel {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.svg-node {
  animation: node-light 4s infinite ease-in-out;
}

.svg-node-1 { animation-delay: 0s; }
.svg-node-2 { animation-delay: 0.5s; }
.svg-node-3 { animation-delay: 1s; }
.svg-node-4 { animation-delay: 1.5s; }
.svg-node-5 { animation-delay: 2s; }
.svg-node-6 { animation-delay: 2.5s; }

.svg-panel-float {
  animation: float-panel 6s infinite ease-in-out;
}

/* === 响应式适配 === */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* 简化移动端，实际项目可加汉堡菜单 */
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 2rem;
  }
}

/* === 减少动态效果支持 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
