:root {
  --bg-base: #0B1120;
  --bg-surface: #111827;
  --bg-card: #151E32;
  --bg-elevated: #1A2438;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --color-primary: #3B82F6;
  --color-accent: #06B6D4;
  --color-border: #2A3B52;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 24px rgba(6, 182, 212, 0.12);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
  --font-main: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --spacing-section: clamp(3rem, 6vw, 6rem);
  --container-width: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease, background 0.2s ease; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4 { text-wrap: balance; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.2; margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.25rem); margin-bottom: 1.25rem; position: relative; padding-bottom: 0.6rem; }
h2::after { content: ""; position: absolute; bottom: 0; left: 0; width: 50px; height: 3px; background: linear-gradient(90deg, var(--color-primary), var(--color-accent)); border-radius: 2px; }
h3 { font-size: 1.15rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }
.text-accent { color: var(--color-accent); }

/* Layout */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: var(--spacing-section) 0; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Header & Footer */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(11, 17, 32, 0.88); backdrop-filter: blur(14px); 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; font-weight: 600; font-size: 1.05rem; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.nav ul { display: flex; gap: 1.5rem; }
.nav a { font-size: 0.95rem; font-weight: 500; padding: 0.5rem 0; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-accent); border-radius: 1px; }
.mobile-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 768px) { .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-surface); padding: 1rem; flex-direction: column; border-bottom: 1px solid var(--color-border); } .nav.open { display: flex; } .mobile-toggle { display: block; } }

.site-footer { background: var(--bg-surface); border-top: 1px solid var(--color-border); padding: 3rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 1rem; color: var(--text-primary); letter-spacing: 0.05em; text-transform: uppercase; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--text-secondary); font-size: 0.9rem; display: inline-block; }
.footer-col a:hover { color: var(--color-accent); transform: translateX(2px); }
.copyright { text-align: center; color: var(--text-secondary); font-size: 0.8rem; border-top: 1px solid var(--color-border); padding-top: 1.5rem; margin-top: 1rem; }

/* Components: Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 1.8rem; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; border: none; transition: all 0.25s ease; font-size: 0.95rem; }
.btn-primary { background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-accent); color: var(--color-accent); }
.btn-outline:hover { background: rgba(6, 182, 212, 0.08); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: var(--radius-sm); }

/* Components: Cards */
.card { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.5rem; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--color-accent); }
.card-icon { width: 32px; height: 32px; margin-bottom: 1rem; color: var(--color-accent); }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary); border-top: 1px solid var(--color-border); padding-top: 0.75rem; }

/* Components: Table */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { padding: 1rem; text-align: left; vertical-align: top; }
th { background: var(--bg-surface); font-weight: 600; color: var(--color-accent); font-size: 0.9rem; white-space: nowrap; }
td { background: var(--bg-card); color: var(--text-secondary); font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 500; color: var(--text-primary); }

/* Components: FAQ */
details { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 1rem; overflow: hidden; }
summary { padding: 1.25rem; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; color: var(--color-accent); transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.25rem 1.25rem; color: var(--text-secondary); line-height: 1.85; }
details:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Components: Related Links */
.related-list li { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--color-border); }
.related-list a { color: var(--text-primary); font-weight: 500; }
.related-list a:hover { color: var(--color-accent); }
.related-desc { color: var(--text-secondary); font-size: 0.9rem; flex-grow: 1; }

/* SVG Animations */
.svg-canvas { width: 100%; height: auto; overflow: visible; }
.star-node { fill: var(--color-accent); opacity: 0.5; }
.star-node.dim { fill: var(--color-primary); opacity: 0.3; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.conn-line { stroke: var(--color-accent); stroke-width: 1.2; fill: none; pathLength: 1; stroke-dasharray: 1; animation: drawPath 5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.node-cluster { animation: drift 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse-ring { 0% { r: 2; opacity: 0.8; } 100% { r: 8; opacity: 0; } }
.pulse-ring { animation: pulse-ring 3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; animation: none !important; } }
