/* ==================== 基础变量与重置 ==================== */
:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.65;
  font-size: 16px;
  background: var(--color-paper);
  color: var(--color-text);
}

/* ==================== 上下文取色变量 ==================== */
.bg-paper {
  --ctx-bg: var(--color-paper);
  --ctx-text: var(--color-text);
  --ctx-highlight: var(--color-brand);
  --ctx-link: var(--color-brand);
  --ctx-icon: var(--color-text);
  --ctx-border: rgba(25, 21, 35, 0.12);
  --ctx-card-bg: var(--color-paper);
}
.bg-dark {
  --ctx-bg: var(--color-dark);
  --ctx-text: var(--color-paper);
  --ctx-highlight: var(--color-accent);
  --ctx-link: var(--color-accent);
  --ctx-icon: var(--color-accent);
  --ctx-border: rgba(244, 243, 247, 0.15);
  --ctx-card-bg: var(--color-paper);
}

section.bg-paper, section.bg-dark { background: var(--ctx-bg); color: var(--ctx-text); }

/* ==================== 排版系统 ==================== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.6em; }
p { margin-bottom: 1em; max-width: 38em; text-wrap: pretty; }
.hl { color: var(--ctx-highlight); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ctx-highlight);
  margin-bottom: 0.5em;
}

/* ==================== 布局与网格 ==================== */
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; }
.mt-2 { margin-top: var(--gap); }
.mb-2 { margin-bottom: var(--gap); }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 52px; padding: 0 28px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: 2px solid var(--color-accent); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary { background: transparent; color: var(--ctx-text); border: 2px solid var(--ctx-text); }
.btn-secondary:hover { transform: translateY(-2px); background: var(--ctx-text); color: var(--ctx-bg); }
.btn:focus-visible { outline: 3px solid var(--ctx-highlight); outline-offset: 3px; }

/* ==================== 组件：卡片 ==================== */
.card {
  background: var(--ctx-card-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.bg-dark .card {
  --ctx-card-bg: var(--color-paper);
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  background: var(--color-paper);
  border: 2px solid var(--color-text);
  box-shadow: 4px 4px 0 var(--color-text);
}
.card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5em; color: var(--ctx-text); }
.card-desc { font-size: 0.95rem; line-height: 1.6; color: var(--ctx-text); }

/* ==================== 组件：表格 ==================== */
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; min-width: 0; table-layout: auto; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--ctx-border); overflow-wrap: anywhere; }
th { font-weight: 700; color: var(--ctx-text); }
td { color: var(--ctx-text); }
tr:last-child td { border-bottom: none; }

@media (max-width: 768px) {
  th, td { padding: 10px 8px; font-size: 0.85rem; }
  .platform-table { font-size: 0.85rem; }
}

/* ==================== 组件：FAQ ==================== */
details {
  border: 1px solid var(--ctx-border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--ctx-card-bg);
  overflow: hidden;
}
summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ctx-text);
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-weight: 700; color: var(--ctx-highlight); transition: transform 0.2s; }
details[open] summary::before { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--ctx-border); }
.details-content { padding: 16px 20px; color: var(--ctx-text); line-height: 1.7; }

/* ==================== 组件：页头页脚 ==================== */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ctx-bg);
  border-bottom: 1px solid var(--ctx-border);
  backdrop-filter: blur(10px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; text-decoration: none; color: inherit; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; list-style: none; gap: 24px; }
nav a { text-decoration: none; color: var(--ctx-text); font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--ctx-highlight); }
footer { background: var(--ctx-bg); padding: var(--section-y) 0; border-top: 1px solid var(--ctx-border); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-size: 1rem; margin-bottom: 12px; color: var(--ctx-highlight); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--ctx-text); text-decoration: none; font-size: 0.95rem; }
.footer-col a:hover { color: var(--ctx-highlight); text-decoration: underline; }
.copyright { text-align: center; margin-top: 48px; font-size: 0.85rem; color: var(--ctx-text); opacity: 0.8; }

/* ==================== SVG 基础规则 ==================== */
svg.interface-svg { width: 100%; height: auto; display: block; }
svg.interface-svg path, svg.interface-svg rect, svg.interface-svg circle, svg.interface-svg line, svg.interface-svg polyline, svg.interface-svg polygon {
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
svg.interface-svg .fill-shape { fill: currentColor; stroke: none; }
svg.interface-svg .stroke-shape { fill: none; stroke: currentColor; }
svg.interface-svg g { transform-box: fill-box; transform-origin: center; }

/* ==================== SVG 动效关键帧 ==================== */
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breatheDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.anim-twinkle { animation: twinkle 3.5s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawPath 2.2s ease forwards; }
.anim-float { animation: floatUp 4s ease-in-out infinite; }
.anim-breathe { animation: breatheDot 1.6s ease-in-out infinite; }
.anim-breathe span:nth-child(2) { animation-delay: 0.4s; }
.anim-breathe span:nth-child(3) { animation-delay: 0.8s; }
.anim-slide { animation: slideIn 0.8s ease forwards; opacity: 0; }
.anim-slide.delay-1 { animation-delay: 0.2s; }
.anim-slide.delay-2 { animation-delay: 0.4s; }

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
  nav ul { gap: 16px; font-size: 0.9rem; }
  .btn { width: 100%; }
}

/* ==================== 减少动态效果 ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 焦点可见性 ==================== */
:focus-visible { outline: 3px solid var(--ctx-highlight); outline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ctx-highlight); outline-offset: 3px; border-radius: 4px; }
