/* === 设计变量 === */
:root {
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-base: 1.75;
}

/* === 基础重置 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  background: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 主题覆盖 === */
.theme-dark { background: var(--color-dark); color: var(--color-paper); }
.theme-dark .hl { color: var(--color-accent); }
.theme-dark .badge { color: var(--color-accent); }
.theme-dark a:not(.btn) { color: var(--color-accent); text-decoration-thickness: 1px; }
.theme-dark details summary { color: var(--color-paper); }

.theme-paper { background: var(--color-paper); color: var(--color-text); }
.theme-paper .hl { color: var(--color-brand); }
.theme-paper .badge { color: var(--color-brand); }
.theme-paper a:not(.btn) { color: var(--color-brand); text-decoration-thickness: 1px; }
.theme-paper details summary { color: var(--color-text); }

.theme-card {
  background: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
}
.theme-card .hl { color: var(--color-brand); }
.theme-card .badge { color: var(--color-brand); }
.theme-card a:not(.btn) { color: var(--color-brand); text-decoration-thickness: 1px; }

/* === 排版 === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.15; margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.hl { font-weight: 800; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0 1.5rem; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; border: none; transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #7de062; }
.btn-secondary { background: transparent; border: 2px solid currentColor; }
.btn-secondary:hover { background: rgba(128,128,128,0.1); transform: translateY(-2px); }

/* === 组件：导航与页脚 === */
.header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(23,21,35,0.08); transition: background 0.3s ease, box-shadow 0.3s ease; }
.header.scrolled { background: rgba(214, 212, 237, 0.95); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; padding: 0.5rem 0; position: relative; }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.nav-links a:not([aria-current="page"]):hover { opacity: 0.8; }
.footer { padding: var(--section-y) 0; border-top: 1px solid rgba(23,21,35,0.1); }
.footer-inner { display: flex; flex-direction: column; gap: 2rem; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }

/* === 组件：卡片与网格 === */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.card { padding: var(--gap); border-radius: var(--radius-card); border: var(--card-border); background: var(--color-paper); }
article.card { display: flex; flex-direction: column; gap: 0.75rem; }
.meta { font-size: 0.85rem; opacity: 0.8; }

/* === 组件：表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(23,21,35,0.1); }
th { font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* === 组件：FAQ === */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 0.75rem; overflow: hidden; background: var(--color-paper); color: var(--color-text); }
summary { padding: 1rem var(--gap); 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; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details .faq-content { padding: 0 var(--gap) 1rem; color: inherit; }

/* === 组件：定义列表 === */
.dl-grid { display: grid; gap: 1.5rem; }
.dl-item dt { font-weight: 700; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.dl-item dd { padding-left: 1.5rem; margin-bottom: 0.5rem; }
.icon { width: 1em; height: 1em; vertical-align: -0.125em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* === SVG 动效 === */
.svg-visual { width: 100%; height: auto; max-width: 480px; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 2.5s ease forwards; }
.anim-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowDash 3s linear infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 4s ease-in-out infinite; }
.anim-float { animation: float 5s ease-in-out infinite; }

@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flowDash { 0%, 100% { stroke-dashoffset: 0; } 50% { stroke-dashoffset: 1; } }
@keyframes breathe { 0%, 100% { opacity: 0.4; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes slideIn { 0%, 10% { transform: translateX(20px); opacity: 0; } 20%, 80% { transform: translateX(0); opacity: 1; } 90%, 100% { transform: translateX(20px); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* 旋转/缩放子元素修正 */
svg [class*="anim-"] { transform-box: fill-box; transform-origin: center; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="ink"] {
    --fc: #171523 !important;
  }
}
@media (max-width: 1439px) {
  [data-fc-1440="ink"] {
    --fc: #d6d4ed !important;
  }
}
