/* =========================================
   设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #0a0f1c;
  --color-surface: #111827;
  --color-surface-hover: #1e293b;
  --color-border: #1f2937;
  --color-primary: #38bdf8;
  --color-neon: #00e5ff;
  --color-text-main: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-accent-subtle: rgba(56, 189, 248, 0.08);
  
  --font-main: "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --space-section: clamp(4rem, 8vw, 8rem);
  --space-container: 1.5rem;
  --radius-lg: 1rem;
  --radius-md: 0.5rem;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

ul, ol {
  list-style: none;
}

/* =========================================
  排版与容器
   ========================================= */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-container);
}

.section {
  padding: var(--space-section) 0;
  position: relative;
}

h1, h2, h3, h4 {
  text-wrap: balance;
  color: var(--color-text-main);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--color-text-muted); }
p strong { color: var(--color-text-main); font-weight: 500; }

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* =========================================
  导航与页头页脚
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.8rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-main);
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-accent-subtle);
}

.footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  background: var(--color-surface);
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-link {
  display: block;
  color: var(--color-text-muted);
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.footer-link:hover { color: var(--color-text-main); }

.copyright {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* =========================================
  按钮与表单
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-neon));
  color: #020617;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-main);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  background: var(--color-accent-subtle);
}

.btn:focus-visible {
  outline: 2px solid var(--color-neon);
  outline-offset: 2px;
}

/* =========================================
  卡片与网格
   ========================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(56, 189, 248, 0.3);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--color-accent-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.icon-svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================
  表格
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

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-accent-subtle);
  font-weight: 600;
  color: var(--color-primary);
}

tr:last-child td { border-bottom: none; }
td { color: var(--color-text-muted); }

/* =========================================
  FAQ 手风琴
   ========================================= */
details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color var(--transition-base);
}

details[open] { border-color: rgba(56, 189, 248, 0.4); }

summary {
  padding: 1rem 1.25rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  color: var(--color-primary);
  font-weight: bold;
  transition: transform var(--transition-base);
}

details[open] summary::after { transform: rotate(45deg); }

details p {
  padding: 0 1.25rem 1rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* =========================================
  文章卡片与相关阅读
   ========================================= */
.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--color-neon);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.article-card p {
  flex-grow: 1;
  font-size: 0.95rem;
}

.link-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--color-border);
  transition: color var(--transition-base);
}

.link-item:hover { color: var(--color-primary); }

.link-title { font-weight: 500; flex: 1; }
.link-desc { font-size: 0.85rem; color: var(--color-text-muted); }

/* =========================================
  SVG 动效核心样式
   ========================================= */
.svg-canvas {
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
  overflow: visible;
}

.star-dot {
  fill: var(--color-neon);
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 6s ease-in-out infinite alternate;
}

.star-dot:nth-child(odd) { animation-delay: -2s; animation-duration: 7s; }
.star-dot:nth-child(3n) { animation-delay: -4s; animation-duration: 5s; }

.connect-line {
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  fill: none;
  opacity: 0.6;
  animation: drawLine 8s ease-in-out infinite;
}

.draw-icon {
  stroke: var(--color-text-muted);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  fill: none;
  animation: drawIcon 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  40% { stroke-dashoffset: 0; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes drawIcon {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@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-list { display: none; }
  .mobile-toggle { display: block; background: none; border: none; color: var(--color-text-main); cursor: pointer; }
  h1 { font-size: 1.8rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.mobile-toggle { display: none; }
@media (min-width: 769px) { .mobile-toggle { display: none; } }
