:root {
  /* 色板 */
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;

  /* 结构性约束 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  /* 排版基础 */
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-base: 1.55;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* 容器与布局 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

section {
  padding-block: var(--section-y);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

section:last-of-type {
  border-bottom: none;
}

.chess-row {
  display: flex;
  gap: var(--gap);
  align-items: stretch;
}

.chess-row:nth-child(even) {
  flex-direction: row-reverse;
}

.chess-text, .chess-visual {
  flex: 1 1 0;
  min-width: 0;
}

.chess-visual {
  background: var(--color-dark);
  padding: var(--gap);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 取色工具类 */
.dark-face {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.dark-face a, .dark-face .hl {
  color: var(--color-accent);
}
.dark-face h1, .dark-face h2, .dark-face h3, .dark-face p, .dark-face li {
  color: var(--color-paper);
}

.paper-face {
  background-color: var(--color-paper);
  color: var(--color-text);
}
.paper-face a, .paper-face .hl {
  color: var(--color-brand);
}

/* 排版层级 */
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: calc(var(--gap) * 0.75);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: calc(var(--gap) * 0.5);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.text-center {
  text-align: center;
}

.mb-gap {
  margin-bottom: var(--gap);
}

/* 眉标 */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) * 0.5);
}
.paper-face .section-eyebrow {
  color: var(--color-brand);
}
.dark-face .section-eyebrow {
  color: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  background-color: #d95a75;
}

.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
}
.paper-face .btn-secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}
.dark-face .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.btn-secondary:hover {
  opacity: 0.85;
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}

/* 卡片 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.3s ease;
}
.dark-face .card {
  background: var(--color-paper);
  color: var(--color-text);
}
.card:hover {
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.data-table th {
  font-weight: 600;
  width: 40%;
}
.data-table tr:last-child td {
  border-bottom: none;
}

/* 列表与定义 */
dl.feature-list dt {
  font-weight: 600;
  margin-top: var(--gap);
  margin-bottom: 0.25em;
}
dl.feature-list dd {
  margin-left: 0;
  margin-bottom: var(--gap);
  color: rgba(25, 21, 35, 0.85);
}
.dark-face dl.feature-list dd {
  color: rgba(219, 212, 237, 0.85);
}

/* 步骤时间线 */
.step-item {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
}
.step-content strong {
  display: block;
  margin-bottom: 0.25em;
}

/* FAQ */
details.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: var(--gap) 0;
}
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
}
details[open] summary::after {
  content: "-";
}
details.faq-item p {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.dark-face .site-header {
  background: rgba(37, 25, 67, 0.95);
  border-bottom-color: rgba(219, 212, 237, 0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--color-brand);
}
.dark-face .nav-links a:hover, .dark-face .nav-links a[aria-current="page"] {
  color: var(--color-accent);
}
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
}

/* 页脚 */
.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-col h4 {
  font-weight: 600;
  margin-bottom: 12px;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col a:hover {
  text-decoration: underline;
}
.footer-bottom {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  text-align: center;
  color: rgba(25, 21, 35, 0.6);
}

/* SVG 动效基础 */
.svg-anim {
  width: 100%;
  height: auto;
  overflow: visible;
}
.svg-anim rect, .svg-anim circle, .svg-anim path, .svg-anim polygon {
  transition: transform 0.3s ease;
}

/* 浮动呼吸 */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes float-fast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.anim-float-slow {
  animation: float-slow 6s ease-in-out infinite;
}
.anim-float-fast {
  animation: float-fast 4.5s ease-in-out infinite;
  animation-delay: 1s;
}

/* 气泡浮现 */
@keyframes bubble-pop {
  0%, 100% { opacity: 0.6; transform: scale(0.95) translateY(2px); }
  50% { opacity: 1; transform: scale(1) translateY(0); }
}
.anim-bubble {
  animation: bubble-pop 5s ease-in-out infinite;
}
.anim-bubble-delay {
  animation: bubble-pop 5s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* 描边绘制 */
@keyframes dash-draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-draw 4s ease forwards;
}

/* 连接线流动 */
@keyframes flow-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flow-line 6s linear 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;
  }
}
