/* 基础变量与重置 */
:root {
  --bg-dark: #271334;
  --bg-paper: #E9E8EA;
  --text-body: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --text-on-dark: #E9E8EA;
  --text-on-accent: #271334;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --lh-base: 1.55;
  --lh-tight: 1.1;
  --tracking-tight: -0.02em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--lh-base);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 排版系统 */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s; }
.dark-bg a { color: var(--color-accent); }
.dark-bg a:hover { color: #b8f58a; }
.text-center { text-align: center; }
.mt-sm { margin-top: 0.5rem; }
.mb-lg { margin-bottom: 2rem; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; border-bottom: 1px solid rgba(29,21,35,0.08); }
.dark-bg section { border-bottom-color: rgba(233,234,234,0.1); }

/* 背景与取色类 */
.dark-bg { background: var(--bg-dark); color: var(--text-on-dark); }
.paper-bg { background: var(--bg-paper); color: var(--text-body); }
.card { border-radius: var(--radius-card); padding: 1.5rem; border: var(--card-border); box-shadow: var(--card-shadow); }
.paper-bg .card { background: #DAD9DB; }
.dark-bg .card { background: #1C0D26; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.25rem; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--text-on-accent); border: none; }
.btn-primary:hover { background: #b8f58a; transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 1px solid var(--text-body); color: var(--text-body); }
.btn-secondary:hover { border-color: var(--color-brand); color: var(--color-brand); transform: translateY(-2px); }
.dark-bg .btn-secondary { border-color: var(--text-on-dark); color: var(--text-on-dark); }
.dark-bg .btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.dark-bg .btn:focus-visible { outline-color: var(--color-accent); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(29,21,35,0.1); vertical-align: top; }
.dark-bg th, .dark-bg td { border-bottom-color: rgba(233,234,234,0.1); }
th { font-weight: 700; width: 40%; }
td { word-break: break-word; }

/* 导航与页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(233,234,234,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(29,21,35,0.08); }
.dark-bg header { background: rgba(39,19,52,0.92); border-bottom-color: rgba(233,234,234,0.1); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.25rem; text-decoration: none; color: inherit; }
.logo img { height: 32px; width: auto; display: block; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { text-decoration: none; color: inherit; font-weight: 500; padding: 0.25rem 0; }
nav a[aria-current="page"], nav a:hover { color: var(--color-brand); }
.dark-bg nav a[aria-current="page"], .dark-bg nav a:hover { color: var(--color-accent); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
footer { padding: 3rem 0; font-size: 0.9rem; color: inherit; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* 网格与弹性布局 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) {
  .feature-row { grid-template-columns: 1fr; }
  .nav-container { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.5rem; }
  nav ul { flex-wrap: wrap; justify-content: center; }
}

/* 眉标与高亮 */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; color: var(--color-brand); }
.dark-bg .badge { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-bg .hl { color: var(--color-accent); }

/* 步骤编号 */
.step-list { list-style: none; counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; }
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 6px;
  background: var(--color-accent); color: var(--text-on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}

/* FAQ */
details { margin-bottom: 1rem; border-radius: var(--radius-card); overflow: hidden; }
.paper-bg details { background: #DAD9DB; }
.dark-bg details { background: #1C0D26; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5rem; }
summary::before { content: "+"; position: absolute; left: 1rem; font-weight: 700; }
details[open] summary::before { content: "-"; }
details p { padding: 0 1rem 1rem; line-height: var(--lh-base); }

/* SVG 基础样式 */
svg { width: 100%; height: auto; display: block; overflow: visible; }
svg text { font-family: var(--font-sans); }
svg .ui-element { transform-box: fill-box; transform-origin: center; }

/* SVG 动效关键帧 */
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes fade-slide { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes pulse-dot { 0%, 100% { r: 2; opacity: 0.6; } 50% { r: 4; opacity: 1; } }

.star { animation: twinkle 4s ease-in-out infinite alternate; }
.star:nth-child(odd) { animation-delay: -1.5s; }
.line-path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 6s ease-in-out infinite; }
.bubble-anim { animation: float 5s ease-in-out infinite; }
.notif-anim { animation: fade-slide 3s ease-out forwards; }
.dot-pulse { animation: pulse-dot 3s ease-in-out infinite; }

/* 减少动态效果适配 */
@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;
  }
  .star, .line-path, .bubble-anim, .notif-anim, .dot-pulse { animation: none !important; }
}
