/* =========================================
   1. 设计变量 (Design Tokens)
   ========================================= */
:root {
  /* 配色 */
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  
  /* 圆角 */
  --radius-card: 0;
  --radius-btn: 0;
  
  /* 阴影与边框 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --hover-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.4);
  
  /* 间距与布局 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --header-height: 64px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================
   2. 基础排版与重置
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* =========================================
   3. 布局容器
   ========================================= */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section + .section {
  border-top: 1px solid rgba(31, 21, 35, 0.15);
}

.dark-section {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.dark-section .section-title-label {
  color: var(--color-accent);
}

.paper-card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  width: 100%;
}

/* =========================================
   4. 排版组件
   ========================================= */
.section-title-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.75rem;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--color-text);
}

.dark-section h1, 
.dark-section h2, 
.dark-section h3, 
.dark-section h4 {
  color: var(--color-paper);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.highlight {
  color: var(--color-brand);
}

.dark-section .highlight {
  color: var(--color-accent);
}

/* =========================================
   5. 按钮与交互
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 48px;
  padding-inline: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(237, 110, 192, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark-section .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(31, 21, 35, 0.05);
}

.dark-section .btn-secondary:hover {
  background-color: rgba(245, 240, 229, 0.1);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* =========================================
   6. 表格
   ========================================= */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.data-table th, 
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.15);
}

.dark-section .data-table th, 
.dark-section .data-table td {
  border-bottom-color: rgba(245, 240, 229, 0.15);
}

.data-table th {
  font-weight: 700;
  color: var(--color-brand);
}

.dark-section .data-table th {
  color: var(--color-accent);
}

/* =========================================
   7. 卡片网格
   ========================================= */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
}

/* 防止内容溢出 */
.container {
  overflow-x: hidden;
}

.card-grid-item {
  display: flex;
  flex-direction: column;
}

.card-grid-item h3 {
  margin-top: 0;
}

/* =========================================
   8. FAQ 样式
   ========================================= */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item summary {
  padding: 1rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-brand);
}

.dark-section .faq-item summary::after {
  color: var(--color-accent);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding-bottom: 1rem;
  color: var(--color-text);
}

.dark-section .faq-item p {
  color: var(--color-paper);
}

/* =========================================
   9. SVG 动效系统
   ========================================= */
svg.animated {
  overflow: visible;
}

svg.animated path,
svg.animated circle,
svg.animated rect,
svg.animated line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.draw-line {
  animation: drawPath 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.breathe-slow {
  animation: breathe 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.breathe-fast {
  animation: breathe 4s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.float-up {
  animation: floatUp 5s ease-in-out infinite alternate;
}

@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes breathe {
  from { transform: scale(0.95); opacity: 0.7; }
  to { transform: scale(1.05); opacity: 1; }
}

@keyframes floatUp {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@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;
  }
  svg.animated path,
  svg.animated circle,
  svg.animated rect,
  svg.animated line {
    stroke-dashoffset: 0;
  }
}

/* =========================================
   10. 响应式适配
   ========================================= */
@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
  }
  
  .hero-visual {
    width: 100%;
    margin-bottom: var(--gap);
  }
}
