/* ==================== 基础变量与设计 Token ==================== */
:root {
  --bg-dark: #271231;
  --bg-paper: #F6F3F7;
  --text-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  --line-height: 1.65;
}

/* ==================== 重置与全局排版 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--line-height);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ==================== 布局结构 ==================== */
.site-wrapper { display: flex; min-height: 100vh; }

.brand-sidebar {
  width: 260px;
  background: var(--bg-dark);
  color: var(--bg-paper);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 100;
}
.brand-logo { margin-bottom: 2rem; display: flex; align-items: center; gap: 0.75rem; }
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }
.brand-logo span { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.05em; }
.nav-links { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.nav-links a {
  padding: 0.5rem 0;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--color-accent); }

.main-content {
  margin-left: 260px;
  flex: 1;
  background: var(--bg-paper);
  color: var(--text-body);
}

@media (max-width: 768px) {
  .brand-sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-dark);
  }
  .nav-links { flex-direction: row; gap: 1.5rem; }
  .nav-links a { padding: 0; }
  .main-content { margin-left: 0; }
}

/* ==================== 容器与区块节奏 ==================== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

.micro-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}
section.dark-face { background: var(--bg-dark); color: var(--bg-paper); }
section.dark-face .micro-label { color: var(--color-accent); }

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 1rem;
}
h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--color-brand); }
section.dark-face .hl { color: var(--color-accent); }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--bg-dark);
}
.btn-primary:hover { transform: translateY(-1px); background: #d95aa8; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-body);
  color: var(--text-body);
}
section.dark-face .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); }

/* ==================== 组件：卡片与表格 ==================== */
.card {
  border: var(--card-border);
  background: #fff;
  padding: 1.5rem;
  margin-bottom: var(--gap);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}
table.spec-table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
table.spec-table th, table.spec-table td {
  padding: 0.75rem;
  border-bottom: var(--card-border);
  text-align: left;
}
table.spec-table th { font-weight: 600; width: 40%; }
table.spec-table tr:last-child td, table.spec-table tr:last-child th { border-bottom: none; }

/* ==================== 组件：FAQ ==================== */
details.faq-item {
  border: var(--card-border);
  margin-bottom: var(--gap);
  background: #fff;
  border-radius: var(--radius-card);
}
summary.faq-item {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary.faq-item::-webkit-details-marker { display: none; }
summary.faq-item::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
details.faq-item[open] summary.faq-item::after { content: "−"; }
details.faq-item .answer { padding: 0 1.25rem 1rem; color: var(--text-body); }

/* ==================== 组件：时间线/步骤 ==================== */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--card-border);
}
.step { position: relative; margin-bottom: var(--gap); }
.step::before {
  content: attr(data-step);
  position: absolute;
  left: -2.5rem; top: 0;
  width: 2rem; height: 2rem;
  background: var(--color-accent);
  color: var(--bg-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-radius: var(--radius-card);
}
.step-title { font-weight: 700; margin-bottom: 0.25rem; }
.step-desc { color: rgba(31,21,35,0.8); }

/* ==================== SVG 动效系统 ==================== */
.svg-mockup { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-mockup path, .svg-mockup rect, .svg-mockup circle, .svg-mockup polyline {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 5s ease-in-out infinite alternate;
}
.float-slow { animation: floatSlow 7s ease-in-out infinite alternate; }
.float-fast { animation: floatFast 4.5s ease-in-out infinite alternate; }
.pulse-dot { animation: pulseDot 3s ease-in-out infinite alternate; }
.slide-in { animation: slideIn 6s ease-in-out infinite alternate; }

@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes floatSlow { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes floatFast { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes pulseDot { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes slideIn { from { transform: translateX(-8px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }

/* 旋转/缩放子元素中心修正 */
.svg-mockup [class*="rotate-"], .svg-mockup [class*="scale-"] {
  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;
  }
  .draw-path { stroke-dashoffset: 0; }
  .float-slow, .float-fast, .pulse-dot, .slide-in { transform: none; opacity: 1; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
