/* ==========================================
   全局设计变量与基础重置
   ========================================== */
:root {
  /* 色彩系统：紫粉双色调 */
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-accent: #db2777;
  --color-accent-light: #f472b6;
  --color-surface: rgba(255, 255, 255, 0.65);
  --color-surface-hover: rgba(255, 255, 255, 0.85);
  --color-glass-border: rgba(255, 255, 255, 0.5);
  --color-text-main: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-bg-base: #f5f3ff;
  --color-bg-gradient: linear-gradient(135deg, #eef2ff 0%, #fce7f3 50%, #f5f3ff 100%);
  
  /* 间距与圆角 */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 排版流体控制 */
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 1.8vw, 1rem);
  --text-md: clamp(1rem, 2vw, 1.125rem);
  --text-lg: clamp(1.25rem, 2.5vw, 1.5rem);
  --text-xl: clamp(1.75rem, 3.5vw, 2.5rem);
  --text-2xl: clamp(2.25rem, 4.5vw, 3.5rem);

  /* 阴影与模糊 */
  --shadow-soft: 0 4px 20px rgba(124, 58, 237, 0.08);
  --shadow-hover: 0 8px 30px rgba(124, 58, 237, 0.15);
  --blur-glass: blur(16px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--color-text-main);
  background: var(--color-bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ==========================================
   布局容器与网格
   ========================================== */
.container {
  width: min(92%, 1200px);
  margin-inline: auto;
  padding-block: var(--space-lg);
}

.section {
  padding-block: var(--space-xl);
  position: relative;
}

.grid-auto {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.stagger-layout {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .stagger-layout.alternate {
    grid-template-columns: 1.2fr 0.8fr;
  }
  .stagger-layout.reverse {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

/* ==========================================
   排版组件
   ========================================== */
.heading-xl {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.02em;
}

.heading-lg {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.heading-md {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--space-sm);
}

.text-body {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.text-small {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.75rem;
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

/* ==========================================
   页头与导航
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--color-glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: var(--text-md);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: var(--space-md);
}

.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav a:hover, .nav a[aria-current="page"] {
  background: rgba(124, 58, 237, 0.08);
  color: var(--color-primary);
}

/* ==========================================
   通用按钮
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

.btn-outline {
  background: var(--color-surface);
  border-color: var(--color-glass-border);
  color: var(--color-text-main);
}

.btn-outline:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-light);
}

/* ==========================================
   卡片与玻璃拟态
   ========================================== */
.card {
  background: var(--color-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ==========================================
   表格样式
   ========================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-glass-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.data-table th {
  background: rgba(124, 58, 237, 0.06);
  font-weight: 600;
  color: var(--color-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================
   FAQ 组件
   ========================================== */
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-primary);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  background: rgba(255,255,255,0.5);
}

.faq-item .faq-content {
  padding: 0 1.25rem 1rem;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ==========================================
   页脚
   ========================================== */
.footer {
  background: rgba(30, 41, 59, 0.03);
  border-top: 1px solid var(--color-glass-border);
  padding-block: var(--space-xl);
  margin-top: var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.footer-col h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text-main);
}

.footer-col a {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-primary);
}

.copyright {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* ==========================================
   SVG 动效核心规则
   ========================================== */
.svg-anim-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@keyframes drawProgress {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

@keyframes slowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes floatShift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.anim-draw {
  animation: drawProgress 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-pulse {
  animation: slowPulse 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-float {
  animation: floatShift 8s ease-in-out infinite;
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  .anim-draw, .anim-pulse, .anim-float {
    animation: none !important;
  }
}

/* 响应式调整 */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; height: auto; padding-block: 1rem; }
  .nav { flex-wrap: wrap; justify-content: center; margin-top: var(--space-sm); }
  .heading-xl { font-size: var(--text-xl); }
  .card { padding: var(--space-md); }
}
