:root {
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --font-main: 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; }

body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: var(--section-y) 0;
  position: relative;
}

/* 分节细线（仅纸面区块） */
.paper-surface + .paper-surface::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--color-text);
  opacity: 0.15;
  margin: 0 calc(var(--gap) * -1);
  width: calc(100% + var(--gap) * 2);
}

/* 表面修饰类：控制取色变量 */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .badge { color: var(--color-accent); }
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.surface-dark .card { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); }
.surface-dark table th, .surface-dark table td { border-color: rgba(255,255,255,0.12); }
.surface-dark details { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: var(--color-paper); }
.surface-dark .svg-panel { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }

.paper-surface { background: var(--color-paper); color: var(--color-text); }
.paper-surface .hl { color: var(--color-brand); }
.paper-surface .badge { color: var(--color-brand); }
.paper-surface .btn-primary { background: var(--color-brand); color: var(--color-paper); }
.paper-surface .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.paper-surface .card { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); }
.paper-surface table th, .paper-surface table td { border-color: rgba(0,0,0,0.1); }
.paper-surface details { background: var(--color-paper); border-color: rgba(0,0,0,0.15); color: var(--color-text); }
.paper-surface .svg-panel { background: var(--color-dark); }

/* 排版 */
.badge {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
  display: inline-block;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1em;
  text-wrap: balance;
  hyphens: none;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.8em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.6em;
}

p, li {
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  line-height: 1.75;
  max-width: 38em;
}

.lead {
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.8;
  max-width: 42em;
  margin-bottom: 1.5em;
}

.hl { font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.5em;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-brand); color: var(--color-paper); }
.btn-secondary { background: transparent; color: var(--color-text); border: 2px solid var(--color-text); }

/* 卡片 */
.card {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* 网格布局 */
.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);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

th { font-weight: 600; }

/* FAQ / Details */
details {
  background: var(--color-paper);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-card);
  margin-bottom: 1em;
  padding: 1em 1.2em;
  transition: background 0.2s ease;
}

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-weight: 400;
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

details[open] summary::after { transform: rotate(45deg); }
details[open] summary { margin-bottom: 0.5em; }

/* SVG 基础 */
svg.interface-svg {
  width: 100%;
  height: auto;
  display: block;
}

.svg-panel {
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
}

/* SVG 动效 Keyframes */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes floatDelay {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulseDots {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

@keyframes slideInCard {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes flowDash {
  to { stroke-dashoffset: -24; }
}

@keyframes rotateGeo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes mergeAlign {
  0% { transform: scale(0.95) rotate(-2deg); opacity: 0.7; }
  50% { transform: scale(1.02) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 动效应用类 */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 5s ease forwards;
}

.anim-float { animation: floatBubble 6s ease-in-out infinite; }
.anim-float-delay { animation: floatDelay 7s ease-in-out infinite 1.2s; }

.anim-pulse { animation: pulseDots 3s ease-in-out infinite; }

.anim-slide { animation: slideInCard 4s ease-out forwards; }

.anim-flow {
  stroke-dasharray: 12 12;
  animation: flowDash 4s linear infinite;
}

.anim-rotate {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateGeo 15s linear infinite;
}

.anim-merge {
  transform-box: fill-box;
  transform-origin: center;
  animation: mergeAlign 8s ease-in-out infinite alternate;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .flex-row { flex-direction: column; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  .card { padding: 1.5rem; }
}

/* 兜底：裁掉横向溢出 */
html, body {
  overflow-x: hidden;
}
