:root {
  /* 基础色板 */
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;

  /* 设计 Token */
  --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: 1280px;
  --lh-body: 1.65;

  /* 组件衍生变量 */
  --btn-h: 52px;
  --focus-ring: 2px solid var(--color-brand);
}

*, *::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, "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

/* 排版 */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: calc(var(--gap) * 0.75);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.muted {
  color: rgba(31, 21, 35, 0.7);
  font-size: 0.9em;
}

.hl {
  color: var(--color-brand);
}

.dark-surface .hl {
  color: var(--color-accent);
}

/* 眉标 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--color-brand);
}

.dark-surface .badge {
  color: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--btn-h);
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background-color: rgba(31, 21, 35, 0.05);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(246, 243, 247, 0.1);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* 卡片 */
.card {
  background: #ffffff;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: var(--card-border);
}

th {
  font-weight: 600;
  color: var(--color-text);
}

td {
  color: rgba(31, 21, 35, 0.85);
}

tr:last-child td {
  border-bottom: none;
}

/* FAQ */
details {
  border: var(--card-border);
  margin-bottom: 12px;
  border-radius: var(--radius-card);
}

summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 32px;
}

summary::marker {
  display: none;
  content: "";
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}

details p {
  padding: 0 16px 16px;
  margin: 0;
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav a {
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

.dark-surface nav a:hover, .dark-surface nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* 页脚 */
.site-footer {
  padding: var(--section-y) 0;
  border-top: var(--card-border);
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a:hover {
  text-decoration: underline;
}

.copyright {
  margin-top: 32px;
  padding-top: 24px;
  border-top: var(--card-border);
  font-size: 0.85rem;
  color: rgba(31, 21, 35, 0.6);
  text-align: center;
}

/* SVG 动效基础 */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}

svg {
  width: 100%;
  height: auto;
}

.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.dot-flow {
  fill: var(--color-accent);
  opacity: 0;
}

.breathe {
  opacity: 1;
}

.slide-in {
  transform: translateY(12px);
  opacity: 1;
}

@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes flow-path {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes move-dot {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(120px); opacity: 0; }
}

@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slide-up {
  0% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.animate-draw { animation: draw-line 6s ease-in-out infinite; }
.animate-flow { animation: flow-path 8s ease-in-out infinite; }
.animate-dot { animation: move-dot 4s linear infinite; }
.animate-float { animation: float-bubble 5s ease-in-out infinite; }
.animate-breathe { animation: pulse-opacity 4s ease-in-out infinite; }
.animate-slide { animation: slide-up 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;
    animation: none !important;
  }
  .dot-flow { opacity: 1 !important; }
  .slide-in { transform: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .header-nav { display: none; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: var(--gap); }
}
