/* === 设计变量 === */
:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  --color-divider: rgba(31, 21, 35, 0.12);
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 容器与分节 === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section + .section::before {
  content: "";
  position: absolute; top: 0; left: var(--gap); right: var(--gap);
  height: 1px; background: var(--color-divider);
}
.section.dark { background: var(--color-dark); color: var(--color-paper); }
.section.dark .container, .section.dark h2, .section.dark h3, .section.dark p, .section.dark li { color: var(--color-paper); }
.section.dark .brand, .section.dark .hl, .section.dark .eyebrow, .section.dark a.link { color: var(--color-accent); }
.section.dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.section.dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }

/* === 标题与眉标 === */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--gap);
}
.section:not(.dark) .eyebrow { color: var(--color-brand); }
.section.dark .eyebrow { color: var(--color-accent); }
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--gap);
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.hl { color: var(--color-brand); }
.section.dark .hl { color: var(--color-accent); }

/* === 按钮 === */
.btn-group { display: flex; gap: var(--gap); flex-wrap: wrap; margin-top: var(--gap); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; padding: 0 24px; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.section.dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }

/* === 卡片与面板 === */
.card {
  background: #fff;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.4); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-divider); }
th { font-weight: 700; }
td strong { font-weight: 600; }

/* === FAQ (Details/Summary) === */
details { border-bottom: 1px solid var(--color-divider); padding: var(--gap) 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ""; }
summary::before { content: "+"; font-weight: 700; color: var(--color-brand); }
details[open] summary::before { content: "-"; }
details[open] summary { margin-bottom: 0.5rem; }
details p { color: inherit; opacity: 0.9; margin-top: 0.5rem; }

/* === 步骤条 === */
.steps { display: flex; gap: var(--gap); flex-wrap: wrap; }
.step { flex: 1 1 200px; counter-increment: step-num; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 800; font-size: 0.9rem; margin-bottom: 0.5rem;
}
.section.dark .step-num { background: var(--color-accent); color: var(--color-dark); }

/* === SVG 动效基础 === */
.svg-anim { width: 100%; height: auto; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.anim-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowDash 4s linear infinite; }
.anim-float { animation: floatY 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-rotate { animation: rotateSlow 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-align { animation: alignIn 8s ease-in-out infinite; }

@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flowDash { from { stroke-dashoffset: 1; } to { stroke-dashoffset: -1; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes rotateSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes alignIn { 0%, 100% { transform: translateX(0) scale(1); } 50% { transform: translateX(4px) scale(1.02); } }

@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; }
  .anim-draw, .anim-flow, .anim-float, .anim-breathe, .anim-rotate, .anim-align { animation: none !important; }
}

/* === 页头页脚 === */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(245, 240, 229, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-divider); }
.section.dark .site-header { background: rgba(39, 18, 49, 0.95); border-bottom-color: rgba(245, 240, 229, 0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: var(--gap); }
.nav a { font-weight: 500; font-size: 0.95rem; padding: 0.5rem 0; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.section.dark .nav a:hover, .section.dark .nav a[aria-current="page"] { color: var(--color-accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: currentColor; }
.footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; gap: var(--gap); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--gap); }
.footer-links a { opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.copyright { font-size: 0.85rem; opacity: 0.6; margin-top: var(--gap); }

/* === 响应式微调 === */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .steps { flex-direction: column; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px var(--gap); }
  .nav { order: 3; width: 100%; justify-content: center; margin-top: 12px; }
}
