:root {
  --color-bg-dark: #1B1231;
  --color-bg-paper: #F4F3F7;
  --color-text-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-paper-light: #EAE9EE;
  --color-dark-surface: #1B1231;
  --color-dark-card: #2A204D;

  --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);
  --content-max: 1280px;

  --font-main: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* 作用域颜色变量定义 */
.section-paper {
  --text-color: var(--color-text-body);
  --accent-color: var(--color-brand);
  --bg-base: var(--color-bg-paper);
  --bg-card: var(--color-paper-light);
}
.section-dark {
  --text-color: var(--color-bg-paper);
  --accent-color: var(--color-accent);
  --bg-base: var(--color-bg-dark);
  --bg-card: var(--color-dark-card);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-color);
  background-color: var(--bg-base);
  transition: color 0.3s ease, background-color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-color); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; border-radius: 2px; }

/* 标题系统 */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) / 2); }
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { color: var(--accent-color); }
.label {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent-color); margin-bottom: 0.5em; display: inline-block;
}

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; background-color: var(--bg-base); }
.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); }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0 1.5em; height: 52px; border-radius: var(--radius-btn);
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  border: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background-color: var(--accent-color); color: var(--color-bg-dark); }
.btn-secondary { background: transparent; border: 1px solid var(--text-color); color: var(--text-color); }
.section-dark .btn-secondary { color: var(--color-bg-paper); border-color: var(--color-bg-paper); }

/* 组件：卡片 */
.card {
  background-color: var(--bg-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }

/* 组件：表格 */
.table-wrapper { overflow-x: auto; margin: var(--gap) 0; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { text-align: left; padding: 0.85em 1em; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }
td { line-height: 1.6; }

/* 组件：步骤条 */
.steps { display: flex; flex-direction: column; gap: var(--gap); counter-reset: step; }
.step-item {
  display: flex; gap: 1em; align-items: flex-start;
  counter-increment: step; position: relative; padding-left: 3em;
}
.step-item::before {
  content: "0" counter(step);
  position: absolute; left: 0; top: 0;
  width: 2em; height: 2em; border-radius: 8px;
  background-color: var(--accent-color); color: var(--color-bg-dark);
  font-weight: 800; font-size: 0.9rem; line-height: 2em; text-align: center;
}
.step-title { font-weight: 700; margin-bottom: 0.25em; }

/* 组件：FAQ */
details { margin-bottom: var(--gap); background: var(--bg-card); border-radius: var(--radius-card); padding: 1em; }
summary { 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; transition: transform 0.2s ease; }
details[open] summary::after { content: "−"; transform: rotate(90deg); }
.details-content { margin-top: 0.75em; line-height: 1.65; }

/* 页头与页脚 */
header {
  position: sticky; top: 0; z-index: 100; background: var(--bg-base);
  border-bottom: 1px solid rgba(128,128,128,0.15); backdrop-filter: blur(8px);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo-link { display: flex; align-items: center; gap: 0.75em; text-decoration: none; color: var(--text-color); }
.nav-links { display: flex; align-items: center; gap: 1.5em; }
nav a { color: var(--text-color); text-decoration: none; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent-color); }
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(128,128,128,0.15); background-color: var(--bg-base); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--gap); }
.footer-nav a { margin-left: 1.5em; color: var(--text-color); font-weight: 500; }

/* SVG 缩放控制 */
.svg-panel { width: 100%; height: auto; max-width: 100%; display: block; }

/* SVG 动效关键帧 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes float-up {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-8px); opacity: 1; }
}
@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes slide-in {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.anim-orbit { animation: orbit-breathe 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: float-up 5s ease-in-out infinite; }
.anim-draw { animation: draw-path 3.5s linear infinite alternate; }
.anim-pulse { animation: pulse-dot 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-slide { animation: slide-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* 减少动态效果支持 */
@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;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .header-inner, .footer-inner { flex-direction: column; height: auto; padding: 1em 0; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
