/* === 设计变量 === */
:root {
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-body: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-border-subtle: rgba(29, 21, 35, 0.08);

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  --font-main: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --lh-body: 1.55;
  --lh-title: 1.15;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}

/* === 色面系统 === */
.face-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.face-dark .hl, .face-dark .tag, .face-dark a:not(.btn) { color: var(--color-accent); }
.face-dark .icon { stroke: var(--color-accent); fill: none; }

.paper {
  background: var(--color-paper);
  color: var(--color-body);
}
.paper .container > p,
.paper .card p,
.paper .details-content,
.paper .step-desc,
.paper .scene-card p {
  max-width: 40em;
}
.paper .hl, .paper .tag, .paper a:not(.btn) { color: var(--color-brand); }
.paper .icon { stroke: var(--color-brand); fill: none; }

.card-light {
  background: var(--color-paper);
  color: var(--color-body);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.card-light .container > p,
.card-light .card p,
.card-light .details-content,
.card-light .step-desc,
.card-light .scene-card p {
  max-width: 40em;
}
.card-light .hl, .card-light .tag, .card-light a:not(.btn) { color: var(--color-brand); }
.card-light .icon { stroke: var(--color-brand); fill: none; }

/* === 标题与眉标 === */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: var(--gap);
}
.section-index {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 0.15;
  line-height: 1;
}
.paper .section-index { color: var(--color-body); opacity: 0.85; }
.face-dark .section-index { opacity: 1; color: #ffffff; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
}
.section-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  display: block;
}
.paper .section-subtitle { color: var(--color-brand); }
.face-dark .section-subtitle { color: var(--color-accent); }

.hl { font-weight: 600; }
.paper .hl { color: var(--color-brand); }
.face-dark .hl { color: var(--color-accent); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding-inline: 1.4em;
  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:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
}
.paper .btn-secondary { color: var(--color-body); border-color: var(--color-body); }
.face-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片与网格 === */
.grid {
  display: grid;
  gap: var(--gap);
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

.card {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.face-dark .card { background: rgba(233, 232, 234, 0.06); }
.paper .card { background: #ffffff; }

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4em;
  line-height: 1.3;
}
.card p { font-size: 0.95rem; line-height: var(--lh-body); }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2em 0.6em;
  border-radius: 6px;
  background: rgba(138, 19, 221, 0.1);
  color: var(--color-brand);
  margin-bottom: 0.6em;
}
.face-dark .tag { background: rgba(158, 237, 110, 0.15); color: var(--color-accent); }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 500px;
}
th, td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}
th { font-weight: 600; }
.face-dark th, .face-dark td { border-color: rgba(233,232,234,0.15); }
td:first-child { font-weight: 500; white-space: nowrap; }

/* === 步骤条 === */
.steps {
  display: flex;
  gap: var(--gap);
  counter-reset: step;
}
.step-item {
  flex: 1;
  counter-increment: step;
  position: relative;
  padding-top: 2.2em;
}
.step-item::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-dark);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.face-dark .step-item::before { background: var(--color-accent); color: var(--color-dark); }
.step-title { font-weight: 600; margin-bottom: 0.3em; }
.step-desc { font-size: 0.9rem; opacity: 0.85; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: var(--gap); }
details {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.paper details { background: #ffffff; }
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
.details-content { margin-top: 0.8em; font-size: 0.95rem; line-height: var(--lh-body); }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.face-dark .site-header { background: rgba(39, 19, 52, 0.9); border-color: rgba(233,232,234,0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.6em; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 28px; width: auto; }
.nav { display: flex; gap: 1.2em; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; opacity: 0.8; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav .btn { height: 40px; font-size: 0.9rem; padding-inline: 1em; }

.site-footer {
  padding-block: var(--section-y);
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--section-y);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
}
.footer-col h4 { font-weight: 600; margin-bottom: 0.6em; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.5em; }
.footer-col a { opacity: 0.7; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-copy {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--color-border-subtle);
  text-align: center;
  opacity: 0.6;
}

/* === SVG 动效基座 === */
.svg-visual { width: 100%; height: auto; }
.svg-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-flow { animation: flowLine 4s linear infinite; }
.anim-float { animation: floatBubble 6s ease-in-out infinite; }
.anim-breathe { animation: breatheDots 2.5s ease-in-out infinite; }
.anim-slide-in { animation: slidePanel 5s ease-in-out infinite; }
.anim-pulse { animation: pulseRing 3s ease-out infinite; }

/* === Keyframes === */
@keyframes flowLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breatheDots {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes slidePanel {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(-4px); opacity: 1; }
}
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* === 响应式适配 === */
@media (max-width: 768px) {
  .steps { flex-direction: column; }
  .step-item { padding-top: 0; padding-left: 2.4em; }
  .step-item::before { position: absolute; left: 0; top: 0.2em; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* === 减少动态效果 === */
@media (prefers-reduced-motion: reduce) {
  .anim-flow, .anim-float, .anim-breathe, .anim-slide-in, .anim-pulse {
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
