/* ============================================================
   青雲 · 知识积累 —— 全站设计变量与共享壳层
   首页与文章页共用，禁止在页面内再复制一份变量
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060912;
  --bg-soft: #0b1120;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #e6ecf5;
  --text-dim: #9aa7bd;
  --text-faint: #66748c;
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --violet: #818cf8;
  --pink: #e879f9;
  --gradient: linear-gradient(120deg, #22d3ee 0%, #818cf8 50%, #e879f9 100%);
  --measure: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(129, 140, 248, 0.35); color: #fff; }

/* ========== 背景光晕 ========== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
  animation: orbDrift 18s ease-in-out infinite alternate;
}
.bg-orb.o1 { width: 520px; height: 520px; top: -180px; left: -140px; background: #1d4ed8; }
.bg-orb.o2 { width: 440px; height: 440px; bottom: -200px; right: -120px; background: #7c3aed; animation-delay: -7s; }
.bg-orb.o3 { width: 360px; height: 360px; top: 40%; left: 55%; background: #0e7490; opacity: 0.12; animation-delay: -12s; }

@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}

/* ========== 滚动进度条 ========== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 100;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

/* ========== 导航 ========== */
header.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
header.nav.scrolled,
header.nav.solid {
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--text);
  text-decoration: none;
}
.logo .mark {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--gradient);
  color: #0b1120;
  font-size: 15px;
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.55);
}
.logo small { color: var(--text-faint); font-weight: 400; font-size: 11px; letter-spacing: 0.5px; }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.nav-links a.active {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 16px;
  cursor: pointer;
}

/* ========== 页脚 ========== */
footer {
  position: relative;
  z-index: 1;
  margin-top: 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(6, 9, 18, 0.6);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
}
.footer-brand .mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--gradient);
  color: #0b1120;
  font-size: 12px;
  font-weight: 700;
}
.footer-brand a { color: var(--text-dim); text-decoration: none; }
.footer-brand a:hover { color: var(--cyan); }
.footer-meta { color: var(--text-faint); font-size: 13px; line-height: 1.9; }
.footer-meta a { color: var(--text-faint); text-decoration: none; }
.footer-meta a:hover { color: var(--cyan); }
.ba-line { display: inline-flex; align-items: center; gap: 6px; }
.ba-icon { width: 14px; height: 14px; display: block; object-fit: contain; }

/* ========== 滚动显现 ========== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .logo small { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px 18px 16px;
    background: rgba(6, 9, 18, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 14px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-meta { text-align: center; }
  .ba-line { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
