/* === Design Tokens & Variables === */
:root {
  /* Colors */
  --color-dark-bg: #240F29;
  --color-paper-bg: #F6F3F7;
  --color-light-paper: #EBE7EC;
  --color-text-main: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-white: #FFFFFF;

  /* Spacing & Layout */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --header-height: 64px;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-body: 1.65;

  /* Radius & Borders */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text-main);
  --card-shadow: 4px 4px 0 var(--color-text-main);
  --border-thin: 1px solid rgba(32, 21, 35, 0.15);

  /* Sizes */
  --btn-h: 52px;
  --icon-size: 24px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background-color: var(--color-paper-bg);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === Container & Grid === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.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); }

/* === Header & Footer === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-paper-bg);
  border-bottom: 1px solid rgba(32, 21, 35, 0.1);
  height: var(--header-height);
  display: flex; align-items: center;
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 24px; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.footer {
  background: var(--color-dark-bg); color: var(--color-paper-bg);
  padding: 48px 0; margin-top: auto;
}
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 32px; }
.footer-col h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--color-accent); }
.copyright { text-align: center; padding-top: 32px; margin-top: 32px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: rgba(255,255,255,0.6); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--btn-h); padding: 0 28px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, background 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-bg);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover { background: #d95a5f; border-color: #d95a5f; transform: translateY(-2px); }
.btn-secondary {
  background: transparent; color: var(--color-text-main);
  border: 2px solid var(--color-text-main);
}
.btn-secondary:hover { background: rgba(32, 21, 35, 0.05); transform: translateY(-2px); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.9rem; }

/* === Typography Components === */
.section-label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 12px;
}
.label-on-paper { color: var(--color-brand); }
.label-on-dark { color: var(--color-accent); }
.hl { font-weight: 800; }
.paper .hl { color: var(--color-brand); }
.dark .hl { color: var(--color-accent); }

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; margin-bottom: 24px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: 32px; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 16px; }
p { margin-bottom: 16px; max-width: 38em; }

/* === Sections Backgrounds === */
.paper { background: var(--color-paper-bg); color: var(--color-text-main); }
.light-paper { background: var(--color-light-paper); color: var(--color-text-main); }
.dark { background: var(--color-dark-bg); color: var(--color-paper-bg); }
.dark .btn-secondary { color: var(--color-paper-bg); border-color: var(--color-paper-bg); }
.dark .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }

/* === Cards & Panels === */
.card {
  background: var(--color-paper-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.panel {
  background: var(--color-dark-bg);
  border: 2px solid var(--color-paper-bg);
  box-shadow: 6px 6px 0 var(--color-paper-bg);
  padding: 32px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.panel-inner { width: 100%; max-width: 400px; }

/* === Tabs (Core Features) === */
.tabs-nav { display: flex; gap: 8px; border-bottom: 2px solid var(--color-text-main); margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; padding: 12px 20px; font-size: 1rem; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; color: rgba(32, 21, 35, 0.5);
}
.tab-btn:hover { color: var(--color-text-main); }
.tab-btn.active { color: var(--color-brand); border-bottom-color: var(--color-brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Steps Timeline === */
.steps-list { counter-reset: step-counter; }
.step-item {
  position: relative; padding-left: 60px; margin-bottom: 32px;
}
.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px;
  background: var(--color-accent); color: var(--color-dark-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.step-item:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 44px; bottom: -32px;
  width: 2px; background: rgba(32, 21, 35, 0.15);
}

/* === Tables === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; table-layout: fixed; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid rgba(32, 21, 35, 0.15); word-break: break-word; }
th { font-weight: 700; background: rgba(32, 21, 35, 0.05); }
.dark th { background: rgba(255, 255, 255, 0.05); color: var(--color-paper-bg); }
.dark td { color: var(--color-paper-bg); border-bottom-color: rgba(255, 255, 255, 0.1); }

/* === FAQ Details === */
.faq-item { border-bottom: 1px solid rgba(32, 21, 35, 0.15); padding: 16px 0; }
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 12px; font-size: 0.95rem; color: rgba(32, 21, 35, 0.8); }

/* === News Cards === */
.news-card {
  background: var(--color-paper-bg); border: var(--card-border); box-shadow: var(--card-shadow);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.news-date { font-size: 0.8rem; font-weight: 600; color: var(--color-brand); }

/* === SVG Animations === */
.svg-canvas { width: 100%; height: auto; }
.dot { fill: var(--color-accent); opacity: 0.6; animation: twinkle 3s infinite alternate ease-in-out; }
.dot:nth-child(odd) { animation-duration: 4s; animation-delay: 1s; }
.line { stroke: var(--color-paper-bg); stroke-width: 1.5; fill: none; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s infinite linear; }
.bubble { fill: var(--color-paper-bg); opacity: 0.8; animation: floatUp 4s infinite ease-in-out; }
.bubble:nth-child(2) { animation-delay: 1.5s; }
.input-dots circle { fill: var(--color-paper-bg); animation: breathe 2s infinite ease-in-out; }
.input-dots circle:nth-child(2) { animation-delay: 0.3s; }
.input-dots circle:nth-child(3) { animation-delay: 0.6s; }

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.1); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  20% { stroke-dashoffset: 0; }
  80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-8px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.6; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; r: 2; }
  50% { opacity: 1; r: 3.5; }
}

@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;
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 16px; gap: 12px; }
  .nav-links { gap: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tabs-nav { flex-direction: column; border-bottom: none; }
  .tab-btn { border-bottom: none; border-left: 3px solid transparent; text-align: left; }
  .tab-btn.active { border-left-color: var(--color-brand); background: rgba(32, 21, 35, 0.05); }
  .panel { padding: 16px; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
