:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25,21,35,0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: calc(var(--gap) * 0.75);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--gap);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: calc(var(--gap) * 0.5);
}

p {
  margin: 0 0 var(--gap) 0;
}

/* Section Spacing */
section {
  padding-block: var(--section-y);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25,21,35,0.08);
  transition: box-shadow 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  gap: var(--gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

nav a:hover, nav a:focus-visible {
  color: var(--color-brand);
}

nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 600;
}

.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;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.dark-bg .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

/* Components */
.card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.paper-badge { color: var(--color-brand); }
.dark-badge { color: var(--color-accent); }

.highlight {
  color: var(--color-brand);
  font-weight: 600;
}

.dark-bg .highlight {
  color: var(--color-accent);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
}

.data-table th, .data-table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(25,21,35,0.08);
  text-align: left;
}

.data-table th {
  font-weight: 600;
  width: 40%;
}

/* Details/Summary (FAQ) */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  padding: 1rem var(--gap);
  background: #fff;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-brand);
  border-bottom: 2px solid var(--color-brand);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] summary::before {
  transform: rotate(45deg);
}

details p {
  margin-top: 0.75rem;
  color: var(--color-text);
  opacity: 0.9;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(25,21,35,0.1);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--section-y);
  padding-left: 1rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-brand);
  border: 3px solid var(--color-paper);
}

.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 0.25rem;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}

.step-card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}

.step-num {
  position: absolute;
  top: -12px;
  left: 16px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card article {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}

.news-card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* SVG Container */
.hero-visual {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
}

.svg-anim-container {
  width: 100%;
  height: 100%;
}

/* SVG Animation Classes */
.svg-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.draw-line {
  animation: drawStroke 6s ease-in-out infinite alternate;
}

.float-bubble {
  animation: floatBubble 7s ease-in-out infinite alternate;
}

.pulse-dot {
  animation: pulseDot 4s ease-in-out infinite alternate;
}

.fade-star {
  animation: fadeStar 8s ease-in-out infinite alternate;
}

.slide-in-card {
  animation: slideIn 9s ease-in-out infinite alternate;
}

@keyframes drawStroke {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes fadeStar {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

@keyframes slideIn {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

.transform-box {
  transform-box: fill-box;
  transform-origin: center;
}

/* Reduced Motion */
@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;
  }
}

/* Focus Visible Global */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.dark-bg :focus-visible {
  outline-color: var(--color-accent);
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--section-y);
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(244,243,247,0.1);
  padding-top: var(--gap);
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
