/* ================= 设计变量 ================= */
:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  --font-sans: 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-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 容器 */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); overflow: hidden; }
.section { padding-block: var(--section-y); }

/* 标题系统 */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
p { max-width: 38em; margin-bottom: var(--gap); }

/* 眉标与高亮 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }

/* 链接 */
.link { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.surface-dark .link { color: var(--color-accent); }
.link:hover { opacity: 0.85; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { opacity: 0.85; }

/* 表面覆盖层 */
.surface-dark { background-color: var(--color-dark); color: var(--color-paper); }
.surface-dark .eyebrow { color: var(--color-accent); }
.surface-dark .link { color: var(--color-accent); }
.surface-dark p, .surface-dark li { color: var(--color-paper); }
.surface-dark .card-light {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
}
.surface-dark .card-light .eyebrow { color: var(--color-brand); }
.surface-dark .card-light p, .surface-dark .card-light li { color: var(--color-text); }

/* 卡片与网格 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow-wrap: break-word;
  word-break: break-word;
}
.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); }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; margin-top: var(--gap); table-layout: fixed; }
.data-table th, .data-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(25,21,35,0.12); overflow-wrap: break-word; word-break: break-word; }
.data-table th { font-weight: 700; width: 40%; }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); overflow: hidden; }
summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
details[open] summary { border-bottom: 1px solid rgba(25,21,35,0.1); }
.details-content { padding: 1rem 1.25rem; color: var(--color-text); }
.surface-dark details { border-color: rgba(247,245,243,0.2); }
.surface-dark summary { color: var(--color-paper); }
.surface-dark details[open] summary { border-bottom-color: rgba(247,245,243,0.2); }
.surface-dark .details-content { color: var(--color-paper); }

/* 列表标记 */
.list-disc { list-style: disc; padding-left: 1.5rem; }
.list-disc li { margin-bottom: 0.5rem; position: relative; }
.list-disc li::marker { color: var(--color-brand); }
.surface-dark .list-disc li::marker { color: var(--color-accent); }

/* 图标 SVG 通用 */
.icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.surface-dark .icon { stroke: var(--color-accent); }

/* 响应式布局：侧边栏导航 */
.site-layout { display: flex; min-height: 100vh; }
.sidebar-nav {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2rem 1.5rem;
  background: var(--color-paper);
  border-right: 1px solid rgba(25,21,35,0.08);
  overflow-y: auto;
}
.mobile-header { display: none; }
.page-content { flex: 1; min-width: 0; }

@media (max-width: 768px) {
  .sidebar-nav { display: none; }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--color-paper);
    border-bottom: 1px solid rgba(25,21,35,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .mobile-header .brand { font-weight: 800; font-size: 1.1rem; }
  .mobile-header nav { display: flex; gap: 1rem; font-size: 0.9rem; }
  .page-content { padding-top: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ================= SVG 视觉与动效 ================= */
.svg-visual { width: 100%; height: auto; max-width: 100%; }
.svg-panel { border-radius: var(--radius-card); overflow: hidden; background: var(--color-dark); padding: 1.5rem; }

/* 描边自绘 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes draw-stroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw { animation: draw-stroke 2s ease forwards; }

/* 同心轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}
.anim-orbit {
  animation: orbit-breathe 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-orbit-delay-1 { animation-delay: 1s; }
.anim-orbit-delay-2 { animation-delay: 2.5s; }

/* 气泡浮现与漂浮 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.anim-bubble { animation: bubble-float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 输入点呼吸 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-dot-1 { animation: dot-breathe 1.2s ease-in-out infinite; }
.anim-dot-2 { animation: dot-breathe 1.2s ease-in-out infinite 0.2s; }
.anim-dot-3 { animation: dot-breathe 1.2s ease-in-out infinite 0.4s; }

/* 减少动态效果 */
@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;
  }
}
