/* SafeW Global Styles */
:root {
  /* Color Palette */
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* Derived UI Colors */
  --color-text-on-dark: var(--color-paper);
  --color-text-on-paper: var(--color-body);
  
  /* Spacing & Layout */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* Container */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(214, 212, 237, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(23, 21, 35, 0.08);
}
.dark-bg .site-header {
  background-color: rgba(19, 16, 45, 0.9);
  border-bottom: 1px solid rgba(214, 212, 237, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.dark-bg .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-icon { width: 20px; height: 20px; }

/* Headings */
.section-subtitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.paper-bg .section-subtitle { color: var(--color-brand); }
.dark-bg .section-subtitle { color: var(--color-accent); }

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 0;
  margin-bottom: 1rem;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1.25rem; }
strong { font-weight: 600; }

/* Sections */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.paper-bg { background-color: var(--color-paper); color: var(--color-text-on-paper); }
.dark-bg { background-color: var(--color-dark); color: var(--color-text-on-dark); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.card {
  background-color: rgba(255, 255, 255, 0.6);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.dark-bg .card {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Tables */
.table-wrapper { overflow-x: auto; border: var(--card-border); border-radius: var(--radius-card); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 600px; table-layout: fixed; }
th, td { padding: 16px 24px; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.08); word-wrap: break-word; overflow-wrap: break-word; }
th { font-weight: 600; background-color: rgba(23, 21, 35, 0.03); }
.dark-bg th { background-color: rgba(255, 255, 255, 0.05); border-bottom-color: rgba(255, 255, 255, 0.1); }
.dark-bg td { border-bottom-color: rgba(255, 255, 255, 0.1); }
td:last-child, th:last-child { text-align: right; }
.platform-link { color: var(--color-brand); font-weight: 500; }
.dark-bg .platform-link { color: var(--color-accent); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 16px; }
details {
  background-color: rgba(255, 255, 255, 0.5);
  border: var(--card-border);
  border-radius: 16px;
  padding: 20px 24px;
  transition: all 0.2s;
}
.dark-bg details { background-color: rgba(255, 255, 255, 0.05); }
summary {
  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;
  opacity: 0.5;
}
details[open] summary::after { content: '−'; }
.details-content { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(23, 21, 35, 0.08); }
.dark-bg .details-content { border-top-color: rgba(255, 255, 255, 0.1); }

/* News Cards */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-date { font-size: 0.8rem; opacity: 0.7; font-weight: 500; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; border-left: 2px solid rgba(23, 21, 35, 0.1); }
.dark-bg .timeline { border-left-color: rgba(255, 255, 255, 0.1); }
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -39px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-paper);
}
.dark-bg .timeline-item::before { border-color: var(--color-dark); }
.step-number {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* SVG Animation Classes */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.float-slow { animation: float-y 6s ease-in-out infinite alternate; }
.pulse-dot { animation: pulse-opacity 3s ease-in-out infinite alternate; }
.flow-line { animation: flow-dash 4s linear infinite; }

@keyframes draw-line {
  0% { stroke-dashoffset: 1; opacity: 0.5; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 1; opacity: 0.5; }
}
@keyframes float-y {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}
@keyframes pulse-opacity {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}
@keyframes flow-dash {
  to { stroke-dashoffset: -10; }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .nav-links { display: none; } /* Simplified for this task, ideally a hamburger menu */
  h1 { font-size: 2.5rem; }
}

/* 兜底：裁掉横向溢出 */
div {
  overflow-x: clip;
}
