:root {
  --bg-dark: #271334;
  --bg-paper: #E9E8EA;
  --text-dark: #1D1523;
  --brand: #8A13DD;
  --accent: #9EED6E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--text-dark);
  --card-shadow: 4px 4px 0 var(--text-dark);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--bg-paper); color: var(--text-dark); line-height: 1.65; font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 表面与卡片取色重置 */
.dark-surface { background: var(--bg-dark); color: var(--bg-paper); }
.dark-surface h1, .dark-surface h2, .dark-surface h3, .dark-surface p, .dark-surface li, .dark-surface span { color: var(--bg-paper); }
.dark-surface .hl { color: var(--accent); }
.dark-surface .brand-link { color: var(--accent); }
.light-card { background: var(--bg-paper); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); color: var(--text-dark); }
.light-card h1, .light-card h2, .light-card h3, .light-card p, .light-card li, .light-card span { color: var(--text-dark); }
.light-card .hl { color: var(--brand); }

/* 排版 */
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5em; }
p { max-width: 38em; margin-bottom: 1em; }
.subtitle { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; display: block; margin-bottom: 0.5em; }
.dark-surface .subtitle { color: var(--accent); }
.paper-surface .subtitle { color: var(--brand); }
.hl { font-weight: 800; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0 1.25em; height: 48px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; border: none; }
.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 2px solid var(--text-dark); color: var(--text-dark); }
.dark-surface .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 1em 0; table-layout: fixed; }
th, td { padding: 0.75em 1em; border-bottom: 1px solid rgba(0,0,0,0.1); text-align: left; overflow-wrap: break-word; word-break: break-word; }
th { font-weight: 700; }
.dark-surface th, .dark-surface td { border-bottom-color: rgba(255,255,255,0.1); }

/* FAQ */
details { margin-bottom: 0.75em; border: var(--card-border); border-radius: var(--radius-card); padding: 1em; background: var(--bg-paper); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75em; font-size: 0.95em; }

/* 导航与页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(0,0,0,0.1); padding: 0.75em 0; }
.dark-surface header { background: var(--bg-dark); border-bottom-color: rgba(255,255,255,0.1); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 32px; width: auto; margin-right: 0.5em; vertical-align: middle; }
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand); }
.dark-surface .nav-links a:hover, .dark-surface .nav-links a[aria-current="page"] { color: var(--accent); }
footer { padding: 3em 0; border-top: 1px solid rgba(0,0,0,0.1); margin-top: 2em; }
.dark-surface footer { border-top-color: rgba(255,255,255,0.1); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-grid h4 { margin-bottom: 0.75em; font-weight: 700; }
.footer-grid a { display: block; margin-bottom: 0.5em; opacity: 0.8; }
.footer-grid a:hover { opacity: 1; }

/* SVG 动效 */
svg.animated-svg { width: 100%; height: auto; }
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes dashLoop { 0% { stroke-dashoffset: 0; } 50% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.star { animation: twinkle 4s ease-in-out infinite; }
.star:nth-child(odd) { animation-delay: 1s; }
.star:nth-child(even) { animation-delay: 2.5s; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashLoop 5s ease-in-out infinite; }
.float-panel { animation: floatY 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.bubble-dot { animation: breathe 2s ease-in-out infinite; }
.bubble-dot:nth-child(2) { animation-delay: 0.3s; }
.bubble-dot:nth-child(3) { animation-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
