/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-body: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-line: rgba(28, 21, 35, 0.08);
  --color-line-strong: rgba(28, 21, 35, 0.15);

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  --card-shadow-hover: 6px 6px 0 var(--color-body);

  --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", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --lh-body: 1.55;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* ==================== 排版系统 ==================== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section-divider { border-bottom: 1px solid var(--color-line); }
.section-divider:last-of-type { border-bottom: none; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.2; margin-bottom: var(--gap); }
p { margin-bottom: 1em; max-width: 38em; }
mark, .hl { color: var(--color-brand); font-weight: 700; }
.dark-surface mark, .dark-surface .hl { color: var(--color-accent); }
.tag {
  display: inline-block; padding: 0.25em 0.6em; border-radius: 6px;
  background: rgba(125, 20, 235, 0.08); color: var(--color-brand);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em;
}
.dark-surface .tag { background: rgba(237, 210, 110, 0.15); color: var(--color-accent); }

/* ==================== 布局网格 ==================== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
@media (max-width: 768px) {
  .stack-mobile { flex-direction: column; align-items: stretch; }
}

/* ==================== 面板与卡片 ==================== */
.panel {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}
.dark-surface .panel { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); box-shadow: none; }
.card {
  background: var(--color-paper);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.75em 1.5em; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { background: #e0c35a; transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 2px solid var(--color-body); color: var(--color-body); }
.btn-secondary:hover { background: rgba(0,0,0,0.04); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-surface .btn-secondary:hover { background: rgba(255,255,255,0.08); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ==================== 表格组件 ==================== */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; font-size: 0.95rem; }
th, td { padding: 0.8em 1em; border-bottom: 1px solid var(--color-line); text-align: left; }
th { font-weight: 700; color: var(--color-brand); }
.dark-surface th { color: var(--color-accent); }
td { color: inherit; }
tr:last-child th, tr:last-child td { border-bottom: none; }

/* ==================== FAQ 组件 ==================== */
details { margin-bottom: var(--gap); border: var(--card-border); border-radius: var(--radius-card); overflow: hidden; background: var(--color-paper); }
summary {
  padding: 1em var(--gap); 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-size: 1.2em; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details[open] summary { background: rgba(0,0,0,0.03); }
details p { padding: 0 var(--gap) 1em; line-height: var(--lh-body); }

/* ==================== 导航与页脚 ==================== */
header { position: sticky; top: 0; z-index: 100; background: rgba(245, 243, 247, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--color-line); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6em; font-weight: 800; font-size: 1.1rem; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 0.4em 0; position: relative; }
nav a:hover { color: var(--color-brand); }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-brand); }
footer { border-top: 1px solid var(--color-line); padding: var(--gap) 0; text-align: center; font-size: 0.9rem; color: rgba(28, 21, 35, 0.7); }
.footer-links { display: flex; justify-content: center; gap: var(--gap); margin-bottom: 0.5em; flex-wrap: wrap; }
.footer-links a:hover { color: var(--color-brand); }

/* ==================== SVG 动效核心 ==================== */
.svg-container { width: 100%; height: auto; overflow: visible; }
svg { width: 100%; height: auto; }
.anim-transform { transform-box: fill-box; transform-origin: center; }

/* 路径绘制 */
@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 4s var(--ease-out) infinite alternate; }

/* 气泡漂浮 */
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.bubble-float { animation: floatY 5s var(--ease-in-out) infinite; }
.bubble-delay-1 { animation-delay: 0.6s; }
.bubble-delay-2 { animation-delay: 1.2s; }

/* 输入点呼吸 */
@keyframes breatheOpacity { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.input-breathe { animation: breatheOpacity 2.5s var(--ease-in-out) infinite; }
.input-breathe:nth-child(2) { animation-delay: 0.4s; }
.input-breathe:nth-child(3) { animation-delay: 0.8s; }

/* 通知滑入 */
@keyframes slideInLeft { from { transform: translateX(-24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.notify-slide { animation: slideInLeft 1.8s var(--ease-out) forwards; }

/* 数据流流动 */
@keyframes flowDash { to { stroke-dashoffset: -1; } }
.flow-line { pathLength: 1; stroke-dasharray: 0.2 0.8; stroke-dashoffset: 0; animation: flowDash 3s linear infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .draw-path { stroke-dashoffset: 0; }
  .bubble-float, .input-breathe, .notify-slide, .flow-line { animation: none; }
}
