/* === 设计变量与基础重置 === */
:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  /* 结构尺寸 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  /* 排版 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --lh-text: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.container {
  width: min(100% - 32px, var(--content-max));
  margin-inline: auto;
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section.paper-face { background-color: var(--color-paper); color: var(--color-body); }
.section.dark-face { background-color: var(--color-dark); color: var(--color-paper); }
/* 深色面上的浅色卡片恢复纸面取色 */
.card.paper-surface {
  background-color: var(--color-paper);
  color: var(--color-body);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* === 排版组件 === */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.paper-face .badge { color: var(--color-brand); }
.dark-face .badge { color: var(--color-accent); }
.badge-line { width: 16px; height: 2px; background: currentColor; border-radius: 1px; }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 1.5rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.25rem; text-wrap: balance; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.text-hl { color: var(--color-brand); }
.dark-face .text-hl { color: var(--color-accent); }

/* === 按钮 === */
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 28px; border-radius: var(--radius-btn);
  font-size: 1rem; font-weight: 600; cursor: pointer; border: none;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s;
}
.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: #8A65E8; }
.btn-secondary { background: transparent; border: 2px solid var(--color-body); color: var(--color-body); }
.dark-face .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-face .btn-secondary:hover { background-color: rgba(255,255,255,0.08); }
.btn-icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* === 卡片 === */
.card {
  background-color: var(--color-paper);
  border: var(--card-border) solid var(--color-body);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
}
.dark-face .card { background-color: rgba(255,255,255,0.06); }
.card.paper-surface { background-color: var(--color-paper); color: var(--color-body); }
.dark-face .card.paper-surface { background-color: var(--color-paper); color: var(--color-body); }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }
.dark-face th, .dark-face td { border-color: rgba(255,255,255,0.15); }

/* === FAQ === */
.faq-item { border-bottom: 1px solid rgba(128,128,128,0.2); margin-bottom: 8px; }
.faq-item summary {
  padding: 16px 0; cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 16px; margin-top: 0; }

/* === 页头页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background-color: rgba(219, 212, 237, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(25,21,35,0.08);
}
.dark-face .site-header { background-color: rgba(27,18,49,0.85); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.dark-face .nav a:hover, .dark-face .nav a[aria-current="page"] { color: var(--color-accent); }
@media(max-width:768px){ .nav{display:none;} }

.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(128,128,128,0.2);
  text-align: center; font-size: 0.9rem; opacity: 0.8;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a:hover { text-decoration: underline; }

/* === SVG 动效基础 === */
.svg-deco { width: 100%; height: auto; }
svg path, svg circle, svg rect, svg line, svg polyline, svg polygon {
  vector-effect: non-scaling-stroke;
}
/* 描边绘制默认状态 */
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* 同心轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.8; }
}
.anim-orbit { animation: orbit-breathe 6s ease-in-out infinite; transform-origin: center; }
.anim-orbit.delay-1 { animation-delay: 1s; }
.anim-orbit.delay-2 { animation-delay: 2s; }

/* 气泡浮现与漂浮 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.anim-bubble { animation: bubble-float 4s ease-in-out infinite; }
.anim-bubble.delay-1 { animation-delay: 0.5s; }
.anim-bubble.delay-2 { animation-delay: 1.2s; }

/* 输入点呼吸 */
@keyframes dots-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-dot { animation: dots-breathe 1.8s ease-in-out infinite; }
.anim-dot:nth-child(2) { animation-delay: 0.3s; }
.anim-dot:nth-child(3) { animation-delay: 0.6s; }

/* 通知滑入（默认可见，循环微调） */
@keyframes slide-pulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}
.anim-slide { animation: slide-pulse 5s ease-in-out infinite; }

/* 连接线流动 */
@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-dash { animation: dash-flow 3s linear infinite; }

/* 旋转子元素中心修正 */
.rot-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; }
  .svg-deco { animation: none !important; }
}

/* 响应式微调 */
@media(max-width:640px){
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
  .btn { width: 100%; justify-content: center; }
}
