/* 设计 Token 与基础变量 */
:root {
  --bg-dark: #1B1231;
  --bg-paper: #DBD4ED;
  --text-main: #191523;
  --brand: #5214EB;
  --accent: #9977EE;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--text-main);
  --card-shadow: 4px 4px 0 var(--text-main);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
}

/* 重置与基础排版 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 0; list-style: none; }

/* 表面层上下文变量 */
.paper-surface { background: var(--bg-paper); color: var(--text-main); }
.dark-surface { background: var(--bg-dark); color: var(--bg-paper); }
.paper-card { background: var(--bg-paper); color: var(--text-main); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); }

/* 容器与区块节奏 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }
.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); }

/* 排版层级 */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: 0; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: calc(var(--gap) / 2); }
p { margin: 0 0 var(--gap); }
.text-muted { opacity: 0.85; }
.text-accent { color: var(--accent); }
.text-brand { color: var(--brand); }
.dark-surface .text-accent { color: var(--accent); }
.dark-surface .text-brand { color: var(--accent); }
.hl { color: var(--brand); }
.dark-surface .hl { color: var(--accent); }

/* 眉标 */
.subtitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) / 2);
}
.paper-surface .subtitle { color: var(--brand); }
.dark-surface .subtitle { color: var(--accent); }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--bg-dark); border: 2px solid var(--accent); }
.btn-secondary { background: transparent; color: var(--text-main); border: 2px solid var(--text-main); }
.dark-surface .btn-secondary { color: var(--bg-paper); border-color: var(--bg-paper); }

/* 卡片与面板 */
.card {
  background: var(--bg);
  color: var(--text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5);
  position: relative;
  overflow: hidden;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); table-layout: fixed; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid currentColor; overflow-wrap: break-word; word-break: break-all; }
th { font-weight: 600; }
td:first-child { font-weight: 600; }

/* 列表与步骤 */
.step-list { counter-reset: step; }
.step-item { position: relative; padding-left: 48px; margin-bottom: var(--gap); }
.step-badge {
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--accent); color: var(--bg-dark);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
dl { display: grid; grid-template-columns: 1fr; gap: calc(var(--gap) / 2); }
dt { font-weight: 600; margin-bottom: 4px; }
dd { margin: 0; opacity: 0.9; }

/* FAQ */
details { margin-bottom: var(--gap); border: var(--card-border); border-radius: var(--radius-card); overflow: hidden; background: var(--bg); color: var(--text); }
summary { padding: 16px; 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; opacity: 0.6; }
details[open] summary::after { content: "−"; }
details[open] summary { border-bottom: 1px solid currentColor; }
details p { margin: 16px; }

/* 页头与页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(0,0,0,0.08); padding: 16px 0; backdrop-filter: blur(8px); }
.dark-surface header { background: var(--bg-dark); border-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-weight: 500; position: relative; }
nav a:hover { opacity: 0.8; }
nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
footer { padding: 48px 0; border-top: 1px solid currentColor; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { margin-bottom: 12px; font-weight: 600; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { text-decoration: underline; }

/* SVG 基础与动效 */
svg.interface-svg { width: 100%; height: auto; max-width: 100%; }
svg.interface-svg rect, svg.interface-svg circle, svg.interface-svg polygon, svg.interface-svg path { transition: none; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulseDots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes rotateSnap { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(12deg); } }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 4s ease-in-out infinite alternate; }
.anim-float { animation: floatSoft 5s ease-in-out infinite; }
.anim-pulse { animation: pulseDots 2.5s ease-in-out infinite; }
.anim-rotate { transform-box: fill-box; transform-origin: center; animation: rotateSnap 8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .anim-draw, .anim-float, .anim-pulse, .anim-rotate { animation: none !important; }
}
/* 响应式调整 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  nav { gap: 16px; }
  .hero-layout { flex-direction: column-reverse !important; }
}
