/* === 设计变量 === */
:root {
  --color-bg: #0b1120;
  --color-surface: #1e293b;
  --color-surface-alt: #334155;
  --color-surface-highlight: #475569;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-accent: #f97316;
  --color-accent-hover: #ea580c;
  --color-border: #334155;
  --color-success: #22c55e;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --transition-base: 0.2s ease;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition-base); }
a:hover, a:focus-visible { color: var(--color-accent-hover); outline: none; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

/* 流体字号 */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.35; font-weight: 600; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--color-text-muted); }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* === 布局容器 === */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-md); }
section { padding: var(--spacing-xl) 0; position: relative; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }

/* === 页头与导航 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 17, 32, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--color-text); }
.brand-img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
nav ul { display: flex; list-style: none; gap: var(--spacing-md); }
nav a { font-size: 0.95rem; font-weight: 500; color: var(--color-text-muted); transition: color var(--transition-base); }
nav a:hover, nav a[aria-current="page"] { color: var(--color-accent); }
@media (max-width: 768px) {
  nav ul { gap: var(--spacing-sm); }
  .brand-name { display: none; }
}

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600;
  font-size: 1rem; cursor: pointer; border: none; transition: all var(--transition-base);
  text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--color-surface-highlight); border-color: var(--color-text-muted); }

/* === 卡片与组件 === */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--spacing-md);
  transition: transform var(--transition-base), border-color var(--transition-base);
}
.card:hover { transform: translateY(-4px); border-color: var(--color-surface-highlight); }
.icon-box {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: rgba(249, 115, 22, 0.1); color: var(--color-accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--spacing-sm);
}
.icon-box svg { width: 24px; height: 24px; stroke-width: 1.5; }

/* === 表格 === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface-alt); color: var(--color-accent); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td { color: var(--color-text-muted); }

/* === FAQ === */
.faq-list { max-width: 800px; margin: 0 auto; }
details { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 1rem; background: var(--color-surface); }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::marker, summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--color-accent); }
summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; transition: transform var(--transition-base); }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1rem 1rem; color: var(--color-text-muted); line-height: 1.7; }

/* === 最新文章卡片 === */
.update-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--spacing-md); }
.update-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.update-date { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.update-meta { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }

/* === 相关阅读 === */
.related-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--spacing-sm); }
.related-item { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.related-item:hover, .related-item:focus-within { background: var(--color-surface); border-color: var(--color-border); }
.related-item .arrow { color: var(--color-accent); font-weight: bold; flex-shrink: 0; }

/* === 页脚 === */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--spacing-lg) 0 var(--spacing-md); margin-top: var(--spacing-xl); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--spacing-lg); }
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--color-text); }
.copyright { color: var(--color-text-muted); font-size: 0.85rem; margin-top: var(--spacing-md); text-align: center; }

/* === SVG 动效 === */
@keyframes float-card-1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float-card-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.svg-float-slow { animation: float-card-1 6s ease-in-out infinite; }
.svg-float-med { animation: float-card-2 7s ease-in-out infinite 1.5s; }
.svg-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 4s ease forwards; }
svg { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .svg-float-slow, .svg-float-med, .svg-draw { animation: none !important; }
}
