/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body { font-family: var(--font-sans); line-height: 1.65; color: var(--color-body); background: var(--color-paper); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ==================== 面色控制 ==================== */
.face-dark { background: var(--color-dark); color: var(--color-paper); }
.face-dark .hl { color: var(--color-accent); }
.face-dark a:not(.btn) { color: var(--color-accent); text-decoration: underline; text-underline-offset: 4px; }
.face-dark .badge { color: var(--color-accent); }
.face-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }

.face-paper { background: var(--color-paper); color: var(--color-body); }
.face-paper .hl { color: var(--color-brand); }
.face-paper a:not(.btn) { color: var(--color-brand); text-decoration: underline; text-underline-offset: 4px; }
.face-paper .badge { color: var(--color-brand); }
.face-paper .btn-secondary { border-color: var(--color-body); color: var(--color-body); }

/* ==================== 布局与排版 ==================== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.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 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: var(--gap); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: calc(var(--gap) * 1.5); text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: var(--gap); }
p { margin-bottom: 1rem; max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 0.6rem; }

/* ==================== 组件：按钮 ==================== */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.6rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-secondary { background: transparent; border: 1px solid currentColor; }
.btn-secondary:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ==================== 组件：卡片与面板 ==================== */
.card { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); padding: var(--gap); box-shadow: var(--card-shadow); }
.face-dark .card { background: rgba(244, 243, 247, 0.06); border-color: rgba(244, 243, 247, 0.12); color: var(--color-paper); }
.panel { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); padding: var(--gap); }
.face-dark .panel { background: rgba(244, 243, 247, 0.08); border-color: rgba(244, 243, 247, 0.15); color: var(--color-paper); }

/* ==================== 组件：表格 ==================== */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: var(--card-border); }
th { font-weight: 600; }
td:first-child { font-weight: 500; color: var(--color-body); }
.face-dark td:first-child { color: var(--color-paper); }

/* ==================== 组件：FAQ ==================== */
details { margin-bottom: 1rem; border: var(--card-border); border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 2.5rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; font-weight: 400; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1rem 1rem; line-height: 1.75; }

/* ==================== 页头与页脚 ==================== */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
.face-dark header { background: var(--color-dark); border-bottom-color: rgba(244, 243, 247, 0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; align-items: center; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.face-dark nav a:hover, .face-dark nav a[aria-current="page"] { color: var(--color-accent); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding-bottom: 2rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.copyright { font-size: 0.85rem; opacity: 0.7; margin-top: 1rem; }

/* ==================== SVG 动效系统 ==================== */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
/* 描边绘制：默认完整显示，动画围绕默认状态循环 */
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawCycle 6s ease-in-out infinite alternate; }
@keyframes drawCycle { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
/* 浮动呼吸 */
.float-slow { animation: floatY 7s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
/* 滑入微移 */
.slide-h { animation: slideH 8s ease-in-out infinite alternate; }
@keyframes slideH { 0% { transform: translateX(0); } 100% { transform: translateX(5px); } }
/* 数据流点线 */
.flow-track { pathLength: 1; stroke-dasharray: 0.15 0.85; stroke-dashoffset: 0; animation: flowDash 5s linear infinite; }
@keyframes flowDash { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
/* 旋转缩放子元素基准 */
.anim-center { transform-box: fill-box; transform-origin: center; }

/* 无障碍：减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .draw-line, .float-slow, .slide-h, .flow-track { animation: none !important; }
}

/* ==================== 响应式微调 ==================== */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; height: auto; padding: 1rem 0; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  h1 { font-size: clamp(1.8rem, 5.5vw, 2.8rem); }
}
