*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-fg);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 基础变量与上下文覆盖 */
:root {
  --c-dark: #240F29; --c-paper: #F6F3F7; --c-text: #201523; --c-brand: #A711CF; --c-accent: #ED6E73;
  --r-card: 0; --r-btn: 0; --c-border: 2px solid var(--c-text); --c-shadow: 4px 4px 0 var(--c-text);
  --sec-y: clamp(3.5rem, 7vw, 6rem); --gap: clamp(1rem, 2vw, 1.75rem); --max-w: 1120px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.paper-face { --c-bg: var(--c-paper); --c-fg: var(--c-text); --c-hl: var(--c-brand); }
.dark-face { --c-bg: var(--c-dark); --c-fg: var(--c-paper); --c-hl: var(--c-accent); }
.card { --c-bg: var(--c-paper); --c-fg: var(--c-text); --c-hl: var(--c-brand); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--sec-y); padding-bottom: var(--sec-y); }

/* 排版系统 */
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.15; margin-bottom: 1.5rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; margin-bottom: 1.25rem; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.3; }
p, li { margin-bottom: 1rem; max-width: 38em; }
a { color: var(--c-hl); text-decoration: underline; text-underline-offset: 0.2em; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.eyebrow {
  display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 0.75rem; color: var(--c-hl);
}
.hl { color: var(--c-hl); }

/* 按钮系统 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 48px; font-weight: 600; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-primary:hover { background: #d95c61; transform: translateY(-1px); }
.btn-secondary { background: transparent; border-color: var(--c-fg); color: var(--c-fg); }
.btn-secondary:hover { background: rgba(0,0,0,0.06); transform: translateY(-1px); }
.dark-face .btn-secondary { border-color: var(--c-fg); color: var(--c-fg); }
.dark-face .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* 卡片与面板 */
.card {
  background: var(--c-bg); border: var(--c-border); box-shadow: var(--c-shadow);
  padding: 1.5rem; transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.panel { background: var(--c-bg); border: var(--c-border); box-shadow: var(--c-shadow); padding: 2rem; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--c-fg); text-align: left; vertical-align: top; }
th { font-weight: 700; background: rgba(0,0,0,0.04); }
.dark-face th { background: rgba(255,255,255,0.06); }

/* FAQ */
details { border: var(--c-border); box-shadow: var(--c-shadow); margin-bottom: 0.75rem; background: var(--c-bg); }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.75rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: 0.5rem; top: 1rem; font-weight: 700; color: var(--c-hl); }
details[open] summary::before { content: "-"; }
details > div { padding: 0 1rem 1rem; line-height: 1.7; }

/* 布局辅助 */
.grid-2 { 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; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* 页头与页脚 */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--c-bg); border-bottom: 1px solid rgba(0,0,0,0.1); backdrop-filter: blur(8px); }
.dark-face .site-header { border-bottom: 1px solid rgba(255,255,255,0.1); }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 0.75rem var(--gap); display: flex; align-items: center; justify-content: space-between; }
.logo-wrap { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo-wrap img { height: 32px; width: auto; display: block; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--c-fg); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--c-hl); }
.nav-links a[aria-current="page"] { color: var(--c-hl); font-weight: 700; }

.site-footer { background: var(--c-bg); border-top: 1px solid rgba(0,0,0,0.1); padding: 3rem 0; margin-top: var(--sec-y); }
.dark-face .site-footer { border-top: 1px solid rgba(255,255,255,0.1); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-col h4 { font-weight: 700; margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--c-fg); text-decoration: none; }
.footer-col a:hover { color: var(--c-hl); }
.copyright { max-width: var(--max-w); margin: 2rem auto 0; padding: 1.5rem var(--gap) 0; border-top: 1px solid rgba(0,0,0,0.1); font-size: 0.85rem; opacity: 0.8; text-align: center; }
.dark-face .copyright { border-top: 1px solid rgba(255,255,255,0.1); }

/* SVG 动效基础 */
svg { width: 100%; height: auto; max-width: 100%; display: block; }
svg:not([width]):not([height]) { width: 24px; height: 24px; }
svg[width] { height: auto; }
svg[width][height] { width: var(--icon-w, auto); height: var(--icon-h, auto); }
svg path, svg rect, svg circle, svg polyline, svg line { vector-effect: non-scaling-stroke; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 5s ease-in-out infinite alternate; }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.float-element { animation: floatUp 6s ease-in-out infinite alternate; }
@keyframes floatUp { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }
.breath-opacity { animation: breathe 4.5s ease-in-out infinite alternate; }
@keyframes breathe { 0% { opacity: 0.65; } 100% { opacity: 1; } }
.slide-in { animation: slideIn 3.5s ease-out forwards; }
@keyframes slideIn { 0% { transform: translateX(-16px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.rotate-slow { animation: rotateSlow 12s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes rotateSlow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 减少动态效果 */
@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: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; background: none; border: none; color: var(--c-fg); font-size: 1.5rem; cursor: pointer; }
  .grid-2 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
