/* === 设计变量与基础重置 === */
:root {
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  
  --font-main: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, 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(--color-paper);
  color: var(--color-body);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .page-layout {
    grid-template-columns: 280px 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2rem 1.5rem;
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(27, 18, 49, 0.95);
    backdrop-filter: blur(8px);
  }
  .nav-links { display: none; }
  .mobile-nav { display: flex; gap: 1rem; align-items: center; }
}
@media (min-width: 1024px) {
  .mobile-nav { display: none; }
  .nav-links { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-paper);
}
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }

.nav-link {
  color: var(--color-paper);
  opacity: 0.8;
  padding: 0.5rem 0;
  transition: opacity 0.2s;
  font-size: 0.95rem;
}
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; color: var(--color-accent); }

.main-content {
  padding: var(--section-y) 1rem;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* === 区块通用 === */
.section {
  padding: var(--section-y) 0;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.section:last-child { border-bottom: none; }
.section.dark { background-color: var(--color-dark); color: var(--color-paper); }
.section.light { background-color: var(--color-paper); color: var(--color-body); }

.section-header { margin-bottom: var(--gap); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.light .eyebrow { color: var(--color-brand); }
.dark .eyebrow { color: var(--color-accent); }

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: var(--gap);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
p { margin-bottom: 1rem; max-width: 38em; }
.highlight { font-weight: 600; }
.light .highlight { color: var(--color-brand); }
.dark .highlight { color: var(--color-accent); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 2rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-body);
  color: var(--color-body);
}
.dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }

/* === 组件：卡片 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}
.dark .card { background: var(--color-paper); color: var(--color-body); }

/* === 组件：表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.15);
}
th { font-weight: 600; }
td { font-family: var(--font-main); }

/* === 组件：FAQ === */
details {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: 12px;
  margin-bottom: var(--gap);
  overflow: hidden;
}
summary {
  padding: 1rem 1.25rem;
  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.25rem; font-weight: 400; }
details[open] summary::after { content: "−"; }
.details-content { padding: 0 1.25rem 1rem; line-height: 1.6; }

/* === SVG 动效基础 === */
.svg-icon { width: 24px; height: 24px; flex-shrink: 0; }
svg.interface-mockup { width: 100%; height: auto; max-width: 600px; }
svg.interface-mockup path,
svg.interface-mockup circle,
svg.interface-mockup rect {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.draw-line { animation: drawStroke 5s ease-in-out infinite; }
.breathe { animation: breathe 4s ease-in-out infinite; }
.float-up { animation: floatUp 6s ease-in-out infinite; }
.slide-in { animation: slideIn 4s ease-in-out infinite; }

@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  50%, 100% { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slideIn {
  0% { transform: translateX(-10px); opacity: 0.5; }
  20%, 80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
/* 旋转/缩放子元素中心对齐 */
svg.interface-mockup g.animated-child {
  transform-box: fill-box;
  transform-origin: center;
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .main-content { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
.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); }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--gap); }
.mb-1 { margin-bottom: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.step-list { counter-reset: step; list-style: none; }
.step-list li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  counter-increment: step;
}
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 2.5rem; height: 2.5rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
}
.dark .step-list li::before { background: var(--color-accent); color: var(--color-dark); }
.news-card article { height: 100%; display: flex; flex-direction: column; }
.news-card time { font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.5rem; display: block; }
.news-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.news-card p { font-size: 0.95rem; opacity: 0.9; flex-grow: 1; }
.footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  margin-top: var(--section-y);
  font-size: 0.9rem;
  opacity: 0.8;
}
.footer .grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer a { display: block; padding: 0.25rem 0; }
.footer a:hover { opacity: 0.7; }
