:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: 0; color: var(--color-text); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
ul, ol { margin-bottom: var(--gap); padding-left: 1.5em; }
li { margin-bottom: 0.5em; max-width: 38em; }

.subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
  display: block;
}
.dark-section .subtitle { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

/* Header & Nav */
header { position: sticky; top: 0; background: rgba(247, 245, 243, 0.95); backdrop-filter: blur(8px); z-index: 100; border-bottom: 1px solid rgba(23, 21, 35, 0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; color: var(--color-text); text-decoration: none; }
.logo img { width: 32px; height: 32px; }
nav ul { display: flex; list-style: none; gap: var(--gap); }
nav a { color: var(--color-text); font-weight: 500; padding: 8px 12px; border-radius: 8px; }
nav a:hover { background: rgba(23, 21, 35, 0.05); }
nav a[aria-current="page"] { background: var(--color-brand); color: var(--color-paper); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; text-decoration: none; border: none; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(137, 237, 110, 0.4); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(23, 21, 35, 0.05); }
.dark-section .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }

/* Cards */
.card { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: var(--gap); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -14px rgba(23, 21, 35, 0.35); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* Tables */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--gap) 0; }
table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); white-space: nowrap; }
th { font-weight: 600; color: var(--color-text); }
td { color: var(--color-text); }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid rgba(23, 21, 35, 0.1); border-radius: 12px; overflow: hidden; background: var(--color-paper); }
summary { padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; color: var(--color-brand); transition: transform 0.2s; }
details[open] summary::after { content: "−"; transform: rotate(180deg); }
details p { padding: 0 20px 16px; margin: 0; color: var(--color-text); }

/* SVG Container & Animations */
.svg-container { width: 100%; max-width: 640px; margin: 0 auto; }
.svg-container svg { width: 100%; height: auto; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-delayed { animation: float 6s ease-in-out infinite 2s; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease forwards; }

@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; }
  .anim-float, .anim-float-delayed, .anim-breathe, .anim-draw { animation: none !important; }
}

/* Dark Section Overrides */
.dark-section { background-color: var(--color-dark); color: var(--color-paper); }
.dark-section h1, .dark-section h2, .dark-section h3, .dark-section p, .dark-section li, .dark-section th, .dark-section td { color: var(--color-paper); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-section .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }
.dark-section .card { background: var(--color-paper); color: var(--color-text); }
.dark-section .card h3, .dark-section .card p, .dark-section .card li { color: var(--color-text); }

/* Footer */
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; gap: var(--gap); align-items: center; text-align: center; }
.footer-links { display: flex; gap: var(--gap); flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--color-paper); opacity: 0.8; }
.footer-links a:hover { opacity: 1; }
.footer-copy { font-size: 0.85rem; opacity: 0.6; margin-top: 1rem; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  nav ul { gap: 0.5rem; }
  .two-col { display: block; }
  .two-col > div { margin-bottom: var(--gap); }
}

/* 兜底：裁掉横向溢出 */
div.container,
section.container {
  overflow-x: clip;
}
