:root {
  --bg-dark: #371E1B;
  --bg-paper: #F6F5F3;
  --bg-paper-light: #EDECEA;
  --text-body: #231715;
  --brand: #B6392B;
  --accent: #ABB6E3;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(35, 23, 21, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", 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(--text-body); background: var(--bg-paper); -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 { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
section.dark { background: var(--bg-dark); color: var(--bg-paper); }
section.paper-alt { background: var(--bg-paper-light); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); overflow-x: visible; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); overflow-x: visible; }

/* Typography */
h1, h2, h3 { font-weight: 600; letter-spacing: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: calc(var(--gap) * 0.5); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 0.75); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.5); }
.lead { font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.7; max-width: 38em; margin-bottom: var(--gap); }
.text-muted { opacity: 0.8; }
.hl { color: var(--brand); }
section.dark .hl { color: var(--accent); }

.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; color: var(--brand); }
section.dark .eyebrow { color: var(--accent); }

/* Components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; font-weight: 600; border-radius: var(--radius-btn); transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease; cursor: pointer; border: none; font-size: 1rem; }
.btn-primary { background: var(--brand); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(182, 57, 43, 0.35); }
.btn-secondary { background: transparent; color: var(--text-body); border: 1px solid var(--text-body); }
.btn-secondary:hover { background: rgba(35, 23, 21, 0.05); transform: translateY(-2px); }
section.dark .btn-secondary { color: var(--bg-paper); border-color: var(--bg-paper); }
section.dark .btn-secondary:hover { background: rgba(246, 245, 243, 0.1); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.card { background: var(--bg-paper); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: calc(var(--gap) * 1.5); border: var(--card-border); transition: box-shadow 0.2s ease; }
.card:hover { box-shadow: 0 14px 32px -12px rgba(35, 23, 21, 0.35); }
section.dark .card { background: var(--bg-paper); color: var(--text-body); }

table { width: 100%; border-collapse: collapse; margin-top: var(--gap); }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(35, 23, 21, 0.1); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }
td:first-child { font-weight: 500; color: var(--text-body); }

details { margin-bottom: var(--gap); border-bottom: 1px solid rgba(35, 23, 21, 0.1); padding-bottom: var(--gap); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
summary::marker { display: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-weight: bold; color: var(--brand); }
section.dark details { border-color: rgba(246, 245, 243, 0.15); }
section.dark summary::before { color: var(--accent); }
details[open] summary::before { content: "-"; }
.faq-answer { margin-top: 0.5rem; line-height: 1.7; }

/* Header/Footer */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(35, 23, 21, 0.08); padding: 1rem 0; backdrop-filter: blur(8px); }
section.dark header { background: var(--bg-dark); border-color: rgba(246, 245, 243, 0.1); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; }
.logo-img { height: 32px; width: auto; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--brand); }
section.dark .nav-links a { color: var(--bg-paper); }
section.dark .nav-links a:hover, section.dark .nav-links a[aria-current="page"] { color: var(--accent); }
.mobile-toggle { display: none; background: none; border: none; color: inherit; font-size: 1.5rem; cursor: pointer; }

footer { background: var(--bg-dark); color: var(--bg-paper); padding: var(--section-y) 0; text-align: center; }
footer p { opacity: 0.7; font-size: 0.9rem; margin-top: 1rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }
.footer-links a { opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--accent); }

/* Layout Utilities */
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
.timeline-item { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; margin-bottom: var(--gap); }
.timeline-num { display: flex; align-items: center; justify-content: center; background: var(--brand); color: var(--bg-dark); font-weight: 700; border-radius: 8px; font-size: 1.1rem; }
.section-dark .timeline-num { background: var(--accent); color: var(--bg-dark); }
.magazine-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--gap); }
.toc-list { position: sticky; top: 100px; }
.toc-list li { margin-bottom: 0.75rem; }
.toc-list a { font-size: 0.95rem; opacity: 0.7; transition: opacity 0.2s; }
.toc-list a:hover { opacity: 1; color: var(--brand); }
section.dark .toc-list a { color: var(--bg-paper); }
section.dark .toc-list a:hover { color: var(--accent); }

/* SVG Animation Classes */
.anim-wave-1 { animation: wave-rise 6s ease-in-out infinite; }
.anim-wave-2 { animation: wave-rise 7s ease-in-out infinite 0.5s; }
.anim-wave-3 { animation: wave-rise 8s ease-in-out infinite 1s; }
.anim-float { animation: float-up 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-draw.line-active { stroke-dashoffset: 1; animation: dash-flow 6s linear infinite; }
svg { overflow: visible; }

@keyframes wave-rise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes float-up {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.9; }
  50% { transform: translateY(-8px) scale(1.02); opacity: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes dash-flow {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 900px) {
  .hero-grid, .feature-row, .magazine-layout { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-text { order: unset; }
  .feature-row.reverse .feature-visual { order: unset; }
  .mobile-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-paper); flex-direction: column; padding: 1rem; box-shadow: var(--card-shadow); }
  section.dark .nav-links { background: var(--bg-dark); }
  .nav-links.open { display: flex; }
  .magazine-layout { grid-template-columns: 1fr; }
  .toc-list { position: static; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 1rem; border-top: 1px solid rgba(35,23,21,0.1); padding-top: 1rem; }
  section.dark .toc-list { border-color: rgba(246,245,243,0.1); }
}

/* 兜底：裁掉横向溢出 */
html {
  overflow-x: clip;
}
