:root {
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;
  --color-text-light: #F6F3F7;
  --color-text-muted: rgba(31, 21, 35, 0.65);
  --color-border: rgba(31, 21, 35, 0.16);
  --color-border-light: rgba(31, 21, 35, 0.08);
  --color-border-dark: rgba(246, 243, 247, 0.12);

  --radius-card: 0;
  --radius-btn: 0;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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-inline: auto;
  padding-inline: var(--gap);
}

/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  gap: 24px;
}

nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 8px 0;
  position: relative;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: rgba(31, 21, 35, 0.05);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-text-light);
  padding-block: 48px;
  margin-top: var(--section-y);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--color-accent);
}

.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 0.95rem;
  color: rgba(246, 243, 247, 0.8);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-text-light);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-dark);
  font-size: 0.85rem;
  color: rgba(246, 243, 247, 0.6);
  text-align: center;
}

/* Typography */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.paper-theme .section-label {
  color: var(--color-brand);
}

.dark-theme .section-label {
  color: var(--color-accent);
}

/* zh-cn.html specific contrast fixes */
#features .section-label,
#scenarios .section-label {
  color: #1f1523;
}

#features .hl,
#scenarios .hl {
  color: #c70fa8;
}

#faq .section-label,
#overview .section-label,
#setup .section-label,
#platforms .section-label {
  color: #6a0da0;
}

#platforms .data-table strong {
  color: #ffffff;
}

#platforms .data-table td {
  color: #1f1523;
}

#platforms .data-table a {
  color: #b420f5;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: 16px;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 24px;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  max-width: 38em;
}

.hl {
  color: var(--color-brand);
}

.dark-theme .hl {
  color: var(--color-accent);
}

/* Sections & Dividers */
.section {
  padding-block: var(--section-y);
  position: relative;
}

.paper-theme {
  background: var(--color-paper);
  color: var(--color-text);
}

.dark-theme {
  background: var(--color-dark);
  color: var(--color-text-light);
}

.slant-top {
  clip-path: polygon(0 24px, 100% 0, 100% 100%, 0 100%);
  margin-top: -24px;
  padding-top: 24px;
}

.slant-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 24px));
  margin-bottom: -24px;
  padding-bottom: 24px;
}

.divider-line {
  height: 1px;
  background: var(--color-border);
  margin: 0;
  border: none;
}

/* Cards & Panels */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.card {
  background: var(--color-paper);
  border: var(--card-border);
  padding: 24px;
  position: relative;
}

.dark-theme .card {
  background: rgba(246, 243, 247, 0.05);
  border-color: var(--color-border-dark);
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel {
  background: var(--color-dark);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.dark-theme .panel {
  background: rgba(246, 243, 247, 0.08);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-weight: 600;
  background: rgba(31, 21, 35, 0.03);
}

.dark-theme .data-table th {
  background: rgba(246, 243, 247, 0.05);
}

/* FAQ */
.faq-list {
  margin-top: 24px;
}

details {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  font-weight: 700;
  color: var(--color-brand);
  display: inline-block;
  width: 20px;
  text-align: center;
}

details[open] summary::before {
  content: "-";
  color: var(--color-brand);
}

details p {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.news-card {
  background: var(--color-paper);
  border: var(--card-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Steps */
.steps-row {
  display: flex;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.step-item {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-badge {
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

/* SVG Animations */
.geo-shape {
  fill: none;
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.draw-line {
  animation: drawPath 3s ease-in-out infinite alternate;
}

.spin-geo {
  transform-box: fill-box;
  transform-origin: center;
  animation: spinRotate 12s linear infinite;
}

.assemble-geo {
  transform-box: fill-box;
  transform-origin: center;
  animation: assemblePulse 4s ease-in-out infinite alternate;
}

@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes spinRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes assemblePulse {
  0% { transform: scale(0.95) rotate(-2deg); opacity: 0.7; }
  100% { transform: scale(1.02) rotate(2deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .draw-line, .spin-geo, .assemble-geo {
    stroke-dashoffset: 0 !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .steps-row {
    flex-direction: column;
  }
  .header-inner {
    flex-direction: row;
    gap: 12px;
  }
  nav ul {
    gap: 12px;
  }
  .hero-layout {
    flex-direction: column;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
