:root {
  --bg-dark: #231334;
  --bg-paper: #F5F3F7;
  --text-body: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--text-body);
  --card-shadow: 4px 4px 0 var(--text-body);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--text-body);
  line-height: 1.55;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 深色面覆盖 */
.dark-section {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
}
.dark-section .hl { color: var(--accent); }
.dark-section .badge { color: var(--accent); }
.dark-section a { color: var(--accent); }
.dark-section a:hover { text-decoration: underline; }

/* 纸面/卡片覆盖 */
.card {
  background-color: var(--bg-paper);
  color: var(--text-body);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.card .hl { color: var(--brand); }
.card .badge { color: var(--brand); }

/* 排版 */
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: var(--gap); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; line-height: 1.25; margin-bottom: var(--gap); text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin-bottom: calc(var(--gap) / 2); }
p { margin-bottom: var(--gap); max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: calc(var(--gap) / 2); }
.hl { color: var(--brand); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; min-height: 48px;
  background-color: var(--accent); color: var(--bg-dark);
  border-radius: var(--radius-btn); border: none; cursor: pointer;
  font-weight: 600; text-decoration: none; transition: transform 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); background-color: #d4b85a; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-secondary {
  background: transparent; color: var(--text-body); border: 2px solid var(--text-body);
}
.dark-section .btn-secondary { color: var(--bg-paper); border-color: var(--bg-paper); }
.dark-section .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid currentColor; opacity: 0.9; }
th { font-weight: 600; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid currentColor; border-radius: var(--radius-card); padding: var(--gap); }
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: "-"; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(0,0,0,0.08); }
.dark-section header { background: var(--bg-dark); border-color: rgba(255,255,255,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo img { height: 32px; width: auto; vertical-align: middle; }
nav ul { display: flex; list-style: none; gap: var(--gap); }
nav a { text-decoration: none; color: inherit; font-weight: 500; padding: 8px; border-radius: 8px; }
nav a:hover, nav a[aria-current="page"] { background: rgba(0,0,0,0.05); }
.dark-section nav a:hover, .dark-section nav a[aria-current="page"] { background: rgba(255,255,255,0.1); }
footer { padding: var(--section-y) 0; border-top: 1px solid currentColor; margin-top: var(--section-y); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; gap: var(--gap); flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: inherit; opacity: 0.8; }
.footer-links a:hover { opacity: 1; }

/* SVG 面板基础 */
.svg-panel { width: 100%; max-width: 600px; aspect-ratio: 4/3; }
.svg-panel svg { width: 100%; height: auto; display: block; }

/* 动效关键帧 */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes rotateAlign { 0% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseNode { 0%, 100% { r: 4; opacity: 0.6; } 50% { r: 6; opacity: 1; } }

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease-in-out infinite alternate; }
.anim-rotate { transform-box: fill-box; transform-origin: center; animation: rotateAlign 12s linear infinite; }
.anim-pulse { animation: pulseNode 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; }
  .anim-float, .anim-breathe, .anim-draw, .anim-rotate, .anim-pulse { animation: none !important; }
}
