:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --header-bg: rgba(7, 11, 20, .78);
  --surface: rgba(16, 24, 40, .72);
  --surface-solid: #101828;
  --text: #e6edf7;
  --hero-first: #f7fbff;
  --muted: #8b9ab4;
  --border: rgba(120, 160, 220, .18);
  --grid-line: rgba(120, 160, 220, .055);
  --accent: #38e1ff;
  --accent-2: #7c8cff;
  --accent-soft: rgba(56, 225, 255, .10);
  --code-bg: #0d1526;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  --bg: #f4f8fc;
  --bg-2: #ffffff;
  --header-bg: rgba(255, 255, 255, .82);
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #ffffff;
  --text: #162033;
  --hero-first: #162033;
  --muted: #5b6b85;
  --border: rgba(38, 90, 150, .14);
  --grid-line: rgba(38, 90, 150, .06);
  --accent: #0e94b8;
  --accent-2: #4f5fd6;
  --accent-soft: rgba(14, 148, 184, .09);
  --code-bg: #eef3f9;
  --shadow: 0 14px 40px rgba(20, 50, 100, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(56,225,255,.10), transparent 34%),
    radial-gradient(circle at 88% 2%, rgba(124,140,255,.12), transparent 32%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(100% - 40px, 860px); margin: 0 auto; }
.site-header {
  background: var(--header-bg); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f;
  box-shadow: 0 0 20px rgba(56,225,255,.28); padding: 5px;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--accent); border-left: 1px solid var(--border); padding-left: 10px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav a { color: var(--muted); position: relative; }
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--accent);
  border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px;
}
.theme-toggle:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(56,225,255,.25); }
.hero { position: relative; padding: 96px 0 54px; text-align: center; }
.hero-glow {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  width: 420px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,225,255,.16), rgba(124,140,255,.08) 45%, transparent 70%);
  filter: blur(20px); z-index: -1; pointer-events: none;
}
.eyebrow { font-family: var(--mono); letter-spacing: .18em; font-size: 11px; font-weight: 700; color: var(--accent); margin: 0 0 16px; }
.prompt { color: var(--accent-2); margin-right: 8px; }
.hero h1 { font-size: clamp(44px, 9vw, 74px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.04em; font-weight: 800; }
.hero-title {
  background: linear-gradient(100deg, var(--hero-first) 5%, var(--accent) 55%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cursor { color: var(--accent); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--muted); font-size: 17px; margin: 0; }
.hero-line {
  width: 76px; height: 2px; margin: 28px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  box-shadow: 0 0 14px rgba(56,225,255,.5);
}
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 30px; }
.stat { display: flex; flex-direction: column; align-items: center; font-family: var(--mono); }
.stat strong { font-size: 22px; color: var(--text); line-height: 1.2; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .1em; margin-top: 4px; }
.page-head { padding: 58px 0 26px; }
.page-head h1 { font-size: 34px; margin: 0 0 8px; }
.page-desc { color: var(--muted); margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.section-head h2 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-index { font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.count { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.post-list { padding-bottom: 56px; }
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 30px; margin-top: 18px; box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2)); opacity: .7;
}
.card:hover {
  transform: translateY(-3px); border-color: rgba(56,225,255,.42);
  box-shadow: var(--shadow), 0 0 0 1px rgba(56,225,255,.14);
}
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.dot { opacity: .5; }
.category { color: var(--accent); }
.card-title { font-size: 22px; line-height: 1.4; margin: 10px 0 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-summary { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.tag { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); padding: 3px 9px; border-radius: 5px; font-family: var(--mono); }
.read-more { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--accent); }
.read-more:hover { text-decoration: none; text-shadow: 0 0 12px rgba(56,225,255,.6); }
.pagination { margin-top: 30px; text-align: center; }
.pagination a { border: 1px solid var(--border); background: var(--surface-solid); color: var(--accent); padding: 9px 20px; border-radius: 8px; font-family: var(--mono); }
.post { padding: 54px 0 70px; }
.post-head { border-bottom: 1px solid var(--border); padding-bottom: 28px; margin-bottom: 32px; }
.post-head h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.32; margin: 14px 0; }
.post-desc { color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.post-content { font-size: 16px; }
.post-content h2 { font-size: 24px; margin: 42px 0 14px; padding: 0 0 10px 16px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--accent); }
.post-content h3 { font-size: 19px; margin: 30px 0 10px; color: var(--accent); }
.post-content p, .post-content ul, .post-content ol { margin: 0 0 18px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
  margin: 22px 0; padding: 14px 20px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--muted);
}
.post-content blockquote p { margin: 0; }
.post-content code {
  background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: .9em;
}
.post-content pre {
  position: relative; background: var(--code-bg); padding: 40px 20px 18px; border-radius: 10px;
  overflow-x: auto; border: 1px solid var(--border); line-height: 1.65;
}
.post-content pre::before {
  content: "// terminal"; position: absolute; top: 10px; left: 18px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent);
}
.post-content pre code { background: none; color: var(--text); padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14.5px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.post-content th { background: var(--accent-soft); color: var(--accent); font-family: var(--mono); }
.post-content tr:hover td { background: var(--accent-soft); }
.post-content img { max-width: 100%; border-radius: 10px; }
.toc {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-2);
  border-radius: 10px; padding: 16px 22px; margin-bottom: 30px; font-size: 14px;
}
.toc nav > ol { margin: 0; padding-left: 20px; }
.toc p { margin: 0 0 6px; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.post-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin-top: 48px; padding-top: 22px;
  color: var(--muted); font-size: 13px; font-family: var(--mono);
}
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; padding: 26px 0 38px; font-family: var(--mono); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ee6a8; margin-right: 8px; box-shadow: 0 0 10px #2ee6a8; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--accent); background: var(--surface-solid); color: var(--accent);
  cursor: pointer; font-size: 17px; opacity: 0; pointer-events: none; transition: opacity .2s, box-shadow .2s;
  box-shadow: 0 0 16px rgba(56,225,255,.2);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { box-shadow: 0 0 22px rgba(56,225,255,.5); }
@media (max-width: 640px) {
  .wrap { width: min(100% - 28px, 860px); }
  .nav { gap: 14px; }
  .card { padding: 22px; }
  .hero { padding: 68px 0 42px; }
  .brand-text { font-size: 16px; }
  .brand-sub { display: none; }
  .hero-stats { gap: 22px; }
  .post-content pre { padding-left: 14px; padding-right: 14px; }
}
