:root {
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --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);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 上下文取色覆盖 */
.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .link { color: var(--color-accent); }
.bg-dark .badge { color: var(--color-accent); }
.bg-dark .card-light { background-color: var(--color-paper); color: var(--color-text); }
.bg-dark .card-light .hl { color: var(--color-brand); }
.bg-dark .card-light .link { color: var(--color-brand); }
.bg-dark .card-light .badge { color: var(--color-brand); }
.bg-dark .card-light table th, .bg-dark .card-light table td { border-bottom-color: var(--color-text); }

/* 排版 */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin-bottom: calc(var(--gap) / 2); }
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { font-weight: 700; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.link:hover { text-decoration-thickness: 2px; }

/* 布局 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.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); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* 组件基础 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.25rem; height: 48px; font-size: 1rem; font-weight: 600;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius-btn) !important;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); background-color: #c255d8; }
.btn-secondary { background: transparent; border-color: currentColor; color: inherit; }
.btn-secondary:hover { transform: translateY(-2px); background-color: rgba(0,0,0,0.05); }
.focus-visible:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  background: var(--color-paper);
  position: relative;
  border-radius: var(--radius-card) !important;
}
.bg-dark .card { background: var(--color-dark); border-color: var(--color-paper); box-shadow: 4px 4px 0 var(--color-paper); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--color-text); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }
td { max-width: 100%; overflow-wrap: anywhere; }

/* FAQ */
details { border: var(--card-border); margin-bottom: var(--gap); }
summary { padding: var(--gap); 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; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 var(--gap) var(--gap); }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid var(--color-text); padding: 0.75rem 0; transition: background 0.3s ease, border-color 0.3s ease; }
header.scrolled { background: rgba(244, 243, 247, 0.95); backdrop-filter: blur(4px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; gap: var(--gap); }
.nav-links a { text-decoration: none; color: var(--color-text); font-weight: 600; padding: 0.5rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
footer { border-top: 1px solid var(--color-text); padding: var(--section-y) 0; margin-top: var(--section-y); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; gap: var(--gap); flex-wrap: wrap; }
.footer-links a { color: var(--color-text); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

/* SVG 图标基础 */
.svg-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.svg-panel { width: 100%; height: auto; }

/* SVG 动效 */
@keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes floatC { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes pulseDots { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideInX { 0% { transform: translateX(-20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

.anim-float-a { animation: floatA 6s ease-in-out infinite; }
.anim-float-b { animation: floatB 7s ease-in-out infinite 1s; }
.anim-float-c { animation: floatC 5s ease-in-out infinite 2s; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease forwards; }
.anim-pulse { animation: pulseDots 2s ease-in-out infinite; }
.anim-slide { animation: slideInX 1.5s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .anim-float-a, .anim-float-b, .anim-float-c, .anim-draw, .anim-pulse, .anim-slide { animation: none !important; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 0.5rem; }
  .nav-links { order: 3; }
  p { max-width: 100%; }
}
