:root {
  /* 颜色体系 */
  --bg-dark: #231334;
  --bg-paper: #E9E8EA;
  --text-body: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  
  /* 结构与圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  
  /* 节奏与间距 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  /* 字体栈 */
  --font-main: 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 {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--text-body);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 区块基础 */
section {
  padding-block: var(--section-y);
  position: relative;
}

.section-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(28, 21, 35, 0.1);
  border: none;
}

/* 文本层级 */
.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.paper-surface .kicker { color: var(--brand); }
.dark-surface .kicker { color: #1C1523; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: inherit;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.hl {
  color: var(--brand);
}
.dark-surface .hl {
  color: var(--accent);
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.btn-primary:focus-visible {
  outline: 3px solid var(--bg-paper);
  outline-offset: 2px;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-body);
  border: 1px solid var(--text-body);
}
.dark-surface .btn-secondary {
  color: var(--bg-paper);
  border-color: var(--bg-paper);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* 图标 SVG 基础 */
.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* 卡片系统 */
.card {
  background-color: var(--bg-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.dark-surface .card {
  background-color: rgba(255, 255, 255, 0.08);
}
/* 深色面上的浅色卡片，恢复纸面取色 */
.card-light-on-dark {
  background-color: var(--bg-paper);
  color: var(--text-body);
}
.card-light-on-dark .kicker { color: var(--brand); }
.card-light-on-dark .hl { color: var(--brand); }

/* 列表与网格 */
ul, ol {
  padding-left: 1.5rem;
}
li {
  margin-bottom: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.grid-2 > * {
  min-width: 0;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .visual-col { order: 2; margin-top: var(--gap); }
  .text-col { order: 1; }
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--gap);
}
th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(28, 21, 35, 0.1);
}
th {
  font-weight: 700;
  color: var(--text-body);
}
.dark-surface th, .dark-surface td {
  border-bottom-color: rgba(233, 232, 234, 0.15);
}
td:first-child {
  font-weight: 600;
  width: 40%;
}

/* FAQ 组件 */
details {
  margin-bottom: 1rem;
  border-radius: var(--radius-card);
  background-color: var(--bg-paper);
  border: var(--card-border);
  overflow: hidden;
}
.dark-surface details {
  background-color: rgba(255, 255, 255, 0.05);
}
summary {
  padding: 1rem var(--gap);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
details[open] summary::after {
  transform: rotate(45deg);
}
details p {
  padding: 0 var(--gap) 1rem;
  color: var(--text-body);
}
.dark-surface details p {
  color: var(--bg-paper);
}

/* 导航与页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.08);
}
.dark-surface header {
  background-color: rgba(35, 19, 52, 0.9);
  border-bottom-color: rgba(233, 232, 234, 0.1);
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-body);
}
.dark-surface .brand { color: var(--bg-paper); }
.brand img { width: 28px; height: 28px; object-fit: contain; }

/* 移动端导航折叠 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: inherit;
}
.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
nav a {
  color: var(--text-body);
  font-weight: 500;
  transition: color 0.2s ease;
}
.dark-surface nav a { color: var(--bg-paper); }
nav a:hover, nav a[aria-current="page"] {
  color: var(--brand);
}
.dark-surface nav a:hover, .dark-surface nav a[aria-current="page"] {
  color: var(--accent);
}

@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding-block: 1rem;
  }
  .nav-toggle {
    display: block;
  }
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-paper);
    border-bottom: 1px solid rgba(28, 21, 35, 0.1);
    padding: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 99;
    display: none;
  }
  header:has(.nav-toggle:checked) nav {
    display: block;
  }
  nav ul {
    flex-direction: column;
    gap: 0;
    align-items: center;
  }
  nav li {
    width: 100%;
  }
  nav a {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
  }
  /* 确保深色背景下的导航菜单文字可读 */
  .dark-surface nav {
    background-color: #231334;
    border-bottom-color: rgba(233, 232, 234, 0.1);
  }
  .dark-surface nav a {
    color: var(--bg-paper);
  }
}

footer {
  padding-block: var(--section-y);
  background-color: var(--bg-dark);
  color: var(--bg-paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-grid a {
  color: var(--bg-paper);
  margin-bottom: 0.5rem;
  display: block;
}
.footer-grid a:hover { color: var(--accent); }

/* SVG 动效定义 */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
.float-slow { animation: float-slow 6s ease-in-out infinite; }
.float-fast { animation: float-fast 4s ease-in-out infinite; }
.breath { animation: breath 3s ease-in-out infinite; }
.dash-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash-draw 4s linear infinite;
}
.slide-in { animation: slide-in 5s ease-in-out infinite; }

@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes float-fast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
@keyframes breath {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes dash-draw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes slide-in {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(10px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .float-slow, .float-fast, .breath, .dash-draw, .slide-in {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    color: #1c1523 !important;
    -webkit-text-fill-color: #1c1523 !important;
  }
}
