:root {
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-text: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --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.75; color: var(--color-text); background-color: var(--color-paper); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--color-text); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 0.75rem; }
p { max-width: 38em; margin-bottom: 1rem; }
.label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5rem; display: inline-block; }
.hl { color: var(--color-brand); }

/* Contexts */
.dark-bg { background-color: var(--color-dark); color: var(--color-paper); }
.dark-bg h1, .dark-bg h2, .dark-bg h3, .dark-bg p, .dark-bg li, .dark-bg td { color: var(--color-paper); }
.dark-bg .hl, .dark-bg .label, .dark-bg a:not(.btn) { color: var(--color-accent); }
.paper-bg { background-color: var(--color-paper); color: var(--color-text); }
.paper-bg .hl, .paper-bg .label, .paper-bg a:not(.btn) { color: var(--color-brand); }

/* Layout */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* Header/Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(245, 240, 229, 0.85); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(21, 21, 35, 0.1); }
.nav-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.1rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
footer a { opacity: 0.8; }
footer a:hover { opacity: 1; }

/* 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, background-color 0.2s ease; border: none; }
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-bg .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-icon { width: 20px; height: 20px; stroke: currentColor; }

/* Cards */
.card { background: #fff; border-radius: var(--radius-card); border: var(--card-border); box-shadow: var(--card-shadow); padding: 24px; transition: box-shadow 0.3s ease, transform 0.3s ease; }
.card:hover { box-shadow: 0 14px 32px -12px rgba(21, 21, 35, 0.35); transform: translateY(-4px); }
.card.dark { background: var(--color-dark); color: var(--color-paper); }
.card.dark .hl { color: var(--color-accent); }

/* Table */
table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(21, 21, 35, 0.1); overflow-wrap: break-word; word-break: break-word; min-width: 0; }
th { font-weight: 700; color: var(--color-brand); }
.dark-bg th, .dark-bg td { border-bottom-color: rgba(245, 240, 229, 0.15); }
.dark-bg th { color: var(--color-accent); }

/* FAQ */
details { background: #fff; border-radius: 16px; margin-bottom: 12px; overflow: hidden; border: 1px solid rgba(21, 21, 35, 0.08); }
.dark-bg details { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
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.2rem; font-weight: 400; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 20px 16px; line-height: 1.7; }

/* SVG Animation Classes */
.svg-anim-group { animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes blinkStar { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes breatheDots { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.draw-line { animation: drawLine 3s ease forwards; }
.float-soft { animation: floatSoft 4s ease-in-out infinite; }
.blink-star { animation: blinkStar 2.5s ease-in-out infinite; }
.breathe-dot { animation: breatheDots 2s ease-in-out infinite; }

/* 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; }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-inner { flex-direction: column; height: auto; padding: 16px 0; gap: 12px; }
  nav ul { gap: 16px; }
  .hero-layout { flex-direction: column-reverse !important; }
}
