/* 设计变量与基础设定 */
:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-light-surface: #EAE8F0;
  --color-dark-surface: #2A1F4D;
  --color-border: #D8D5E0;

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height: 1.55;
  --content-max: 1280px;

  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 主题覆盖：纸面 */
.theme-paper {
  --text-primary: #191523;
  --text-secondary: #191523;
  --link-color: var(--color-brand);
  --accent: var(--color-brand);
  --bg-surface: var(--color-paper);
}

/* 主题覆盖：深色面 */
.theme-dark {
  --text-primary: var(--color-paper);
  --text-secondary: var(--color-paper);
  --link-color: var(--color-accent);
  --accent: var(--color-accent);
  --bg-surface: var(--color-dark);
}

/* 主题覆盖：深色面上的浅色卡片 */
.theme-card-light {
  --text-primary: var(--color-body);
  --text-secondary: var(--color-body);
  --link-color: var(--color-brand);
  --accent: var(--color-brand);
  --bg-surface: var(--color-light-surface);
}

/* 重置与基础 */
*, *::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(--line-height);
  color: var(--text-primary);
  background: var(--bg-surface);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
}

/* 排版系统 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.badge::before {
  content: "";
  display: block;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: calc(var(--gap) * 0.75);
}
p { margin-bottom: var(--gap); color: var(--text-secondary); }
.hl { color: var(--accent); }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding-inline: 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
}
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--gap); }

/* 卡片与面板 */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.panel {
  background: var(--color-dark-surface);
  border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}
.dark-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 48px);
}

/* 网格与交错布局 */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.alt-row { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 768px) {
  .alt-row { grid-template-columns: 1fr 1fr; align-items: center; }
  .alt-row.reverse { direction: rtl; }
  .alt-row.reverse > * { direction: ltr; }
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--gap);
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table th { font-weight: 700; color: var(--text-primary); }
.data-table td { color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item { margin-bottom: var(--gap); border-bottom: 1px solid var(--color-border); padding-bottom: var(--gap); }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--color-dark);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.faq-item[open] summary::before { content: "−"; }
.faq-item p { margin-top: 10px; padding-left: 32px; }

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--color-border); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text-primary); }
.brand img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 600; color: var(--text-secondary); }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a[aria-current="page"] { color: var(--accent); }
@media (max-width: 640px) { .nav-links { display: none; } }

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-copy { font-size: 0.85rem; color: var(--text-secondary); opacity: 0.8; }

/* SVG 基础与动效 */
.svg-icon {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
.path-stroke {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.fill-solid { fill: var(--text-primary); }
.fill-accent { fill: var(--accent); }
.stroke-accent { stroke: var(--accent); }

/* 动效关键帧 */
@keyframes drawStroke {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(4px); opacity: 1; }
}

.anim-draw { animation: drawStroke 5s ease-in-out infinite; }
.anim-float { animation: floatSoft 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 4s ease-in-out infinite; }

/* 旋转/缩放子元素修正 */
.transform-correct {
  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;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
