:root {
  --bg-dark: #231334;
  --bg-paper: #E9E8EA;
  --text-main: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  --white: #FFFFFF;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--text-main);
  --card-shadow: 4px 4px 0 var(--text-main);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 排版基础 */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: 0; color: var(--text-main); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 0.8); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.5); }
p { margin-bottom: 1em; max-width: 38em; }
ul, ol { margin-bottom: 1em; padding-left: 1.5em; }
li { margin-bottom: 0.5em; }
a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section--dark a { color: var(--accent); }
.hl { color: var(--brand); font-weight: 700; }
.section--dark .hl { color: var(--accent); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); position: relative; }
.section--dark { background: var(--bg-dark); color: var(--paper); --text-main: var(--paper); --brand: var(--accent); }
.section--paper { background: var(--bg-paper); color: var(--text-main); }
.section-divider {
  width: 100%; height: 1px; background: rgba(28,21,35,0.12); margin: 0;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}

/* 眉标 */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 12px; text-transform: uppercase; }
.section--paper .badge { color: var(--brand); }
.section--dark .badge { color: var(--accent); }

/* 头部与导航 */
header {
  position: sticky; top: 0; z-index: 100; background: rgba(233,232,234,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28,21,35,0.08); transition: box-shadow 0.2s;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.2rem; color: var(--text-main); text-decoration: none; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 24px; }
nav a { color: var(--text-main); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 6px 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--brand); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 52px; border-radius: var(--radius-btn); font-weight: 600;
  text-decoration: none; cursor: pointer; border: none; font-size: 1rem; transition: transform 0.2s, opacity 0.2s, background 0.2s;
}
.btn--primary { background: var(--accent); color: var(--bg-dark); }
.btn--primary:hover { background: #f5de8c; transform: translateY(-2px); }
.btn--secondary { background: transparent; border: 2px solid var(--text-main); color: var(--text-main); }
.btn--secondary:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.section--dark .btn--secondary { border-color: var(--paper); color: var(--paper); }
.section--dark .btn--secondary:hover { border-color: var(--accent); color: var(--accent); }

/* 卡片 */
.card {
  background: var(--bg-paper); border: var(--card-border); box-shadow: var(--card-shadow);
  border-radius: var(--radius-card); padding: var(--gap); position: relative; overflow: hidden;
}
.card--light {
  background: var(--white); color: var(--text-main); --text-main: var(--text-main); --brand: var(--brand);
  border: var(--card-border); box-shadow: var(--card-shadow);
}
.card__icon { width: 32px; height: 32px; margin-bottom: 12px; color: var(--brand); }
.section--dark .card__icon { color: var(--accent); }

/* 网格与列表 */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--gap); }
.dl-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--gap); }
dl { margin: 0; }
dt { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
dd { margin-left: 0; margin-bottom: 12px; color: var(--text-main); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.95rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(28,21,35,0.1); }
th { font-weight: 700; background: rgba(125,20,235,0.06); }
td { vertical-align: top; }
.table-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.section--dark .table-link { color: var(--accent); }

/* FAQ */
details { border: 1px solid rgba(28,21,35,0.15); border-radius: var(--radius-btn); margin-bottom: 16px; padding: 16px; background: var(--bg-paper); }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { content: "-"; transform: rotate(180deg); }
details[open] summary { border-bottom: 1px solid rgba(28,21,35,0.1); padding-bottom: 12px; margin-bottom: 12px; }
.details-content { padding-top: 12px; color: var(--text-main); }

/* SVG 面板与动效 */
.svg-panel { background: var(--bg-dark); border-radius: var(--radius-card); padding: 24px; position: relative; overflow: hidden; }
svg { width: 100%; height: auto; overflow: visible; }
svg [class*="anim"], svg .breathe, svg .float-1, svg .float-2 { transform-box: fill-box; transform-origin: center; }
.float-1 { animation: floatY 6s ease-in-out infinite alternate; }
.float-2 { animation: floatY 7s ease-in-out infinite alternate-reverse; }
.breathe { animation: breathe 4s ease-in-out infinite; }
.slide-in { animation: slideX 5s ease-in-out infinite alternate; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 5s ease-in-out infinite alternate; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowDash 4s linear infinite; }

@keyframes floatY { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes slideX { from { transform: translateX(-24px); opacity: 0.4; } to { transform: translateX(0); opacity: 1; } }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

@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; }
  .float-1, .float-2, .breathe, .slide-in, .draw-path, .flow-line { animation: none !important; transform: none !important; opacity: 1 !important; }
}

/* 响应式 */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-layout { grid-template-columns: 1fr !important; }
  .hero-visual { order: -1; margin-bottom: 24px; }
  nav { display: none; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
}
