/* ============================================================
   幻 · HUAN2022A — 深空霓虹主题
   手写 CSS，零外部依赖
   ============================================================ */
:root {
  --bg: #05060f;
  --bg-soft: #0a0d1c;
  --panel: rgba(13, 17, 32, 0.72);
  --line: rgba(140, 160, 210, 0.14);
  --text: #e2e8f0;
  --muted: #8a96b3;
  --cyan: #00e5ff;
  --violet: #a78bfa;
  --pink: #ff2e88;
  --green: #2bff88;
  --grad: linear-gradient(90deg, var(--cyan), var(--violet) 50%, var(--pink));
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
  --sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent; /* 触屏点按高亮关闭（对桌面无效果） */
}
::selection { background: rgba(0, 229, 255, 0.28); color: #fff; }
a { color: var(--cyan); text-decoration: none; transition: color .2s, text-shadow .2s; }
a:hover { color: #7df3ff; text-shadow: 0 0 12px rgba(0, 229, 255, 0.55); }
.mono { font-family: var(--mono); }
.neon { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

/* ---------- 背景层 ---------- */
#bg-canvas { position: fixed; inset: 0; z-index: -3; display: block; }
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .32; will-change: transform; }
.blob-a { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, #08507a, transparent 70%); animation: drift-a 26s ease-in-out infinite alternate; }
.blob-b { width: 40vw; height: 40vw; right: -10vw; top: 18vh; background: radial-gradient(circle, #4c1d95, transparent 70%); animation: drift-b 32s ease-in-out infinite alternate; }
.blob-c { width: 34vw; height: 34vw; left: 26vw; bottom: -16vw; background: radial-gradient(circle, #831843, transparent 70%); animation: drift-c 38s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-8vw, -6vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(6vw, -9vh) scale(1.12); } }
.scanlines {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .05;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.9) 2px 3px);
  mix-blend-mode: multiply;
}

/* ---------- 开机动画 ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100; background: #020308;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .45s ease; font-family: var(--mono); font-size: 14px;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot-text { color: var(--green); text-shadow: 0 0 8px rgba(43, 255, 136, 0.4); min-width: min(480px, 86vw); }

/* ---------- 自定义光标 ---------- */
#cursor-dot, #cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 90; border-radius: 50%; }
#cursor-dot { width: 6px; height: 6px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); transform: translate(-50%, -50%); }
#cursor-ring {
  width: 34px; height: 34px; border: 1px solid rgba(0, 229, 255, 0.55);
  transform: translate(-50%, -50%); transition: width .18s, height .18s, border-color .18s, background .18s;
}
#cursor-ring.hovering { width: 52px; height: 52px; border-color: var(--pink); background: rgba(255, 46, 136, 0.08); }
@media (hover: none), (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* ---------- 进度条 ---------- */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 95; box-shadow: 0 0 12px rgba(0, 229, 255, 0.8); }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px); height: 64px;
  background: rgba(5, 6, 15, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-logo { font-family: var(--mono); font-size: 20px; color: var(--text); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.nav-logo:hover { color: var(--text); text-shadow: none; }
.nav-logo-mark {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; animation: logo-pulse 3s ease-in-out infinite;
}
@keyframes logo-pulse { 0%, 100% { filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.0)); } 50% { filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.8)); } }
.nav-logo-path { color: var(--muted); }
.nav-links { display: flex; gap: clamp(10px, 2.4vw, 28px); align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--muted); font-size: 14.5px; padding: 6px 2px; position: relative; white-space: nowrap;
  font-family: var(--mono); letter-spacing: .5px;
}
.nav-links a:hover { color: var(--text); text-shadow: none; }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:not(.nav-gh):hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--grad); border-radius: 2px; box-shadow: 0 0 8px rgba(167, 139, 250, 0.7);
}
.nav-gh {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px !important;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .2s, box-shadow .2s, color .2s;
}
.nav-gh:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0, 229, 255, 0.35); color: var(--cyan) !important; }
.nav-gh::after { display: none !important; }

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 110px clamp(18px, 6vw, 80px) 60px; overflow: hidden; }
.grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: -6%; height: 46%;
  background-image: linear-gradient(rgba(0, 229, 255, 0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 229, 255, 0.16) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(420px) rotateX(58deg);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.85), transparent 82%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.85), transparent 82%);
  animation: grid-move 7s linear infinite; pointer-events: none;
}
@keyframes grid-move { to { background-position-y: 44px; } }
.hero-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center;
}
.hero-hi { font-family: var(--mono); color: var(--green); font-size: 13.5px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.blink-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.glitch {
  position: relative; font-size: clamp(72px, 11vw, 132px); font-weight: 900; line-height: 1.05;
  font-family: var(--sans); margin: 14px 0 6px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: none; -webkit-text-fill-color: currentColor;
}
.glitch::before { color: var(--cyan); -webkit-text-fill-color: var(--cyan); z-index: -1; animation: glitch-a 5.2s infinite steps(1); }
.glitch::after { color: var(--pink); -webkit-text-fill-color: var(--pink); z-index: -2; animation: glitch-b 5.2s infinite steps(1); }
@keyframes glitch-a {
  0%, 91%, 94%, 100% { transform: none; clip-path: inset(0 0 0 0); opacity: 0; }
  91.5% { transform: translate(-4px, 2px); clip-path: inset(12% 0 58% 0); opacity: .8; }
  92.5% { transform: translate(3px, -1px); clip-path: inset(62% 0 8% 0); opacity: .8; }
  93.5% { transform: translate(-2px, 1px); clip-path: inset(38% 0 42% 0); opacity: .8; }
}
@keyframes glitch-b {
  0%, 43%, 46%, 100% { transform: none; clip-path: inset(0 0 0 0); opacity: 0; }
  43.5% { transform: translate(4px, -2px); clip-path: inset(55% 0 22% 0); opacity: .8; }
  44.5% { transform: translate(-3px, 2px); clip-path: inset(8% 0 76% 0); opacity: .8; }
  45.5% { transform: translate(2px, -1px); clip-path: inset(70% 0 6% 0); opacity: .8; }
}
.hero-sub { font-family: var(--mono); font-size: clamp(15px, 2vw, 19px); color: var(--muted); margin-bottom: 18px; min-height: 1.8em; }
.hero-user { color: var(--violet); font-weight: 600; }
.hero-sep { margin: 0 10px; color: var(--pink); }
#typed-role { color: var(--cyan); }
.type-caret { display: inline-block; width: 9px; height: 1.15em; background: var(--cyan); margin-left: 4px; vertical-align: text-bottom; animation: caret 1s steps(1) infinite; box-shadow: 0 0 8px var(--cyan); }
@keyframes caret { 50% { opacity: 0; } }
.hero-bio { color: var(--muted); font-size: clamp(14.5px, 1.6vw, 16.5px); margin-bottom: 30px; }
.hero-bio .mono { color: var(--green); font-size: .92em; }

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 10px; font-family: var(--mono); font-size: 15px;
  cursor: pointer; transition: transform .18s, box-shadow .25s, border-color .25s;
  will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad); color: #04060e !important; font-weight: 700;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 0 38px rgba(255, 46, 136, 0.45); transform: translateY(-2px); text-shadow: none; }
.btn-ghost { border: 1px solid var(--line); color: var(--text) !important; background: rgba(13, 17, 32, 0.5); }
.btn-ghost:hover { border-color: var(--violet); box-shadow: 0 0 24px rgba(167, 139, 250, 0.3); transform: translateY(-2px); }

.stats { display: flex; gap: clamp(18px, 3vw, 40px); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--mono); font-size: clamp(24px, 3vw, 32px); font-weight: 700; color: var(--cyan); text-shadow: 0 0 16px rgba(0, 229, 255, 0.4); }
.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }

/* 终端卡片 */
.hero-right { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.terminal {
  width: 100%; max-width: 460px; border-radius: 12px; overflow: hidden;
  background: rgba(8, 10, 22, 0.85); border: 1px solid rgba(0, 229, 255, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 229, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-style: preserve-3d; will-change: transform;
}
.terminal-head {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  background: rgba(20, 25, 44, 0.9); border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.terminal-title { margin-left: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.terminal-body { padding: 16px 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.85; min-height: 232px; }
.t-cmd { color: var(--text); }
.t-prompt { color: var(--green); margin-right: 8px; }
.t-out { color: var(--muted); }
.t-out b { color: var(--cyan); font-weight: 600; }
.t-ok { color: var(--green); }
.t-cursor { display: inline-block; width: 8px; height: 1.1em; background: var(--green); vertical-align: text-bottom; animation: caret 1s steps(1) infinite; }

.hero-avatar-wrap { position: relative; }
.hero-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(5, 6, 15, 1), 0 0 28px rgba(0, 229, 255, 0.35);
  animation: avatar-float 5s ease-in-out infinite;
}
.hero-avatar-fb {
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: var(--cyan);
  background: radial-gradient(circle at 35% 35%, #123, #05060f);
}
@keyframes avatar-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.scroll-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 3px;
  animation: hint-bob 2.2s ease-in-out infinite;
}
@keyframes hint-bob { 0%, 100% { transform: translate(-50%, 0); opacity: .55; } 50% { transform: translate(-50%, 7px); opacity: 1; } }

/* ---------- 通用区块 ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(60px, 9vh, 110px) clamp(18px, 5vw, 40px) 0; }
.section-head { margin-bottom: 34px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.section-tag { font-family: var(--mono); font-size: 12.5px; color: var(--pink); letter-spacing: 2.5px; }
.section-head h2 {
  font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(120deg, #fff 30%, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content;
}
.section-note { font-size: 13.5px; color: var(--muted); }
.glass {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* 滚动浮现 */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22, .8, .3, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; align-items: start; }
.about-card { padding: clamp(22px, 3vw, 34px); font-size: 15.5px; color: #c3cce0; }
.about-card p + p { margin-top: 14px; }
.about-card blockquote {
  margin-top: 20px; padding: 12px 18px; border-left: 3px solid;
  border-image: var(--grad) 1; font-family: var(--mono); color: var(--cyan);
  background: rgba(0, 229, 255, 0.05); border-radius: 0 8px 8px 0; font-size: 15px;
}
.about-side { display: flex; flex-direction: column; gap: 22px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  transition: all .22s; cursor: default;
}
.chip:hover {
  color: var(--cyan); border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25); transform: translateY(-2px);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.contact { padding: 18px 20px; font-family: var(--mono); font-size: 13.5px; }
.contact-row { display: flex; gap: 14px; padding: 5px 0; }
.contact-row .k { color: var(--pink); min-width: 64px; }
.contact-row a { color: var(--muted); word-break: break-all; }
.contact-row a:hover { color: var(--cyan); }

/* ---------- 项目卡片 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.proj-card {
  position: relative; padding: 22px 22px 18px; border-radius: 14px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  transform-style: preserve-3d; will-change: transform;
  transition: border-color .25s, box-shadow .3s; display: block; color: var(--text);
}
.proj-card:hover { border-color: rgba(0, 229, 255, 0.5); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.13); color: var(--text); text-shadow: none; }
.proj-card .shine {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 229, 255, 0.13), transparent 65%);
}
.proj-card:hover .shine { opacity: 1; }
.proj-name { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--cyan); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fork-badge { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 5px; font-weight: 400; }
.proj-desc { margin: 10px 0 16px; font-size: 13.8px; color: var(--muted); min-height: 48px; }
.proj-meta { display: flex; align-items: center; gap: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; box-shadow: 0 0 8px currentColor; }
.proj-stars::before { content: "★"; color: var(--pink); margin-right: 4px; }
.proj-card .corner { position: absolute; top: 0; right: 0; font-family: var(--mono); font-size: 11px; color: var(--violet); opacity: .8; padding: 6px 10px; }

/* ---------- 跑马灯 ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.contrib-item {
  font-family: var(--mono); font-size: 13.5px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; color: var(--muted);
  transition: all .22s;
}
.contrib-item:hover { color: var(--cyan); border-color: rgba(0, 229, 255, 0.55); box-shadow: 0 0 16px rgba(0, 229, 255, 0.25); }
.contrib-item .ok { color: var(--green); margin-right: 7px; }

/* ---------- 文章卡片 ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.post-card {
  padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; color: var(--text); position: relative; overflow: hidden;
  transition: transform .28s, border-color .25s, box-shadow .3s;
}
.post-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); transform: scaleY(0); transform-origin: top; transition: transform .3s;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(255, 46, 136, 0.45); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 46, 136, 0.12); color: var(--text); text-shadow: none; }
.post-card:hover::after { transform: scaleY(1); }
.post-date { font-family: var(--mono); font-size: 12px; color: var(--pink); letter-spacing: 1.5px; }
.post-card h3 { font-size: 17.5px; font-weight: 700; line-height: 1.45; }
.post-desc { font-size: 13.8px; color: var(--muted); flex: 1; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags span { font-family: var(--mono); font-size: 11px; color: var(--violet); border: 1px solid rgba(167, 139, 250, 0.3); padding: 2px 9px; border-radius: 999px; }

/* ---------- 文章页 ---------- */
.page-head { padding-top: 130px; }
.post-view { max-width: 860px; }
.back-link { font-family: var(--mono); font-size: 13.5px; color: var(--muted); display: inline-block; margin-bottom: 26px; }
.back-link:hover { color: var(--cyan); }
.post-header { margin-bottom: 30px; }
.post-header h1 { font-size: clamp(24px, 4vw, 36px); line-height: 1.4; background: linear-gradient(120deg, #fff 40%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.post-meta { margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.post-loading { color: var(--muted); font-family: var(--mono); }
.md { padding: clamp(22px, 4vw, 44px); font-size: 15.8px; color: #c9d2e6; }
.md h2 { font-size: 23px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--text); }
.md h3 { font-size: 19px; margin: 26px 0 10px; color: var(--text); }
.md p { margin: 13px 0; }
.md ul, .md ol { margin: 13px 0 13px 24px; }
.md li { margin: 6px 0; }
.md li::marker { color: var(--cyan); }
.md blockquote {
  margin: 18px 0; padding: 10px 18px; border-left: 3px solid; border-image: var(--grad) 1;
  background: rgba(167, 139, 250, 0.06); color: var(--muted); border-radius: 0 8px 8px 0;
}
.md img { max-width: 100%; border-radius: 10px; margin: 12px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: rgba(0, 229, 255, 0.09); color: var(--cyan); padding: 2px 7px; border-radius: 6px; }
.md pre code { background: none; color: #c9d2e6; padding: 0; font-size: 13.5px; line-height: 1.7; }
.codeblock { margin: 20px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: rgba(4, 6, 14, 0.92); }
.codeblock-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: rgba(20, 25, 44, 0.8); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.copy-btn {
  font-family: var(--mono); font-size: 12px; color: var(--cyan); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 12px; cursor: pointer; transition: all .2s;
}
.copy-btn:hover { border-color: var(--cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
.codeblock pre { padding: 16px 18px; overflow-x: auto; }
.md hr { border: none; height: 1px; margin: 30px 0; background: linear-gradient(90deg, transparent, var(--violet), transparent); }

/* ---------- 页脚 ---------- */
.footer { margin-top: 110px; border-top: 1px solid var(--line); padding: 34px clamp(18px, 5vw, 40px) 40px; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.footer-links { display: flex; gap: 22px; font-family: var(--mono); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-right { flex-direction: row; justify-content: center; align-items: center; }
  .terminal { max-width: 100%; }
  .hero-avatar-wrap { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 96px; }
}
@media (max-width: 560px) {
  .nav { height: 56px; }
  .nav-logo { font-size: 17px; }
  .hero-cta { gap: 10px; }
  .btn { padding: 10px 18px; font-size: 13.5px; }
  .terminal-body { min-height: 200px; font-size: 12px; }
  .scroll-hint { display: none; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== posts-enhance ===== */

/* ---------- 文章列表页（#/blog）：搜索 / 标签筛选 / 年份分组 / 空状态 ---------- */
.blog-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.blog-search {
  flex: 1 1 340px; max-width: 580px; display: flex; align-items: center; gap: 11px;
  padding: 0 14px; border-radius: 12px;
  transition: border-color .25s, box-shadow .3s;
}
.blog-search:focus-within {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.07), 0 0 26px rgba(0, 229, 255, 0.16);
}
/* 纯 CSS 放大镜：圆环 + 手柄 */
.blog-search-icon { position: relative; width: 15px; height: 15px; flex: none; }
.blog-search-icon::before {
  content: ""; position: absolute; inset: 0;
  border: 2px solid var(--cyan); border-radius: 50%;
  box-shadow: 0 0 9px rgba(0, 229, 255, 0.45);
}
.blog-search-icon::after {
  content: ""; position: absolute; right: -4px; bottom: -3px;
  width: 7px; height: 2px; background: var(--cyan);
  transform: rotate(45deg); border-radius: 1px;
  box-shadow: 0 0 9px rgba(0, 229, 255, 0.45);
}
#blog-search {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 14px;
  padding: 13px 0; letter-spacing: .3px;
}
#blog-search::placeholder { color: var(--muted); opacity: .65; }
#blog-search::-webkit-search-cancel-button { display: none; }
.blog-search-clear {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; font-family: var(--mono); font-size: 12px; line-height: 1;
  padding: 5px 9px; cursor: pointer; transition: color .2s, border-color .2s, box-shadow .2s;
}
.blog-search-clear:hover { color: var(--pink); border-color: rgba(255, 46, 136, 0.55); box-shadow: 0 0 12px rgba(255, 46, 136, 0.25); }
.blog-count { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 1px; white-space: nowrap; }

.tag-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.tag-chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  background: rgba(13, 17, 32, 0.6); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
  transition: color .22s, border-color .22s, box-shadow .25s, transform .22s, background .25s;
}
.tag-chip span { margin-left: 6px; font-size: 10.5px; color: var(--violet); }
.tag-chip:hover { color: var(--cyan); border-color: rgba(0, 229, 255, 0.5); box-shadow: 0 0 14px rgba(0, 229, 255, 0.22); transform: translateY(-2px); }
.tag-chip.active {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-color: transparent; color: #04121e; font-weight: 700;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4), 0 0 34px rgba(167, 139, 250, 0.22);
}
.tag-chip.active span { color: rgba(3, 10, 20, 0.62); font-weight: 600; }

.blog-year-group { margin-bottom: 52px; }
.blog-year-group:last-child { margin-bottom: 0; }
.blog-year {
  font-family: var(--mono); font-size: clamp(30px, 4.6vw, 44px); font-weight: 800;
  letter-spacing: 3px; line-height: 1.15; margin-bottom: 20px;
  display: flex; align-items: center; gap: 18px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.blog-year::before {
  content: ""; width: 10px; height: 10px; flex: none; border-radius: 2px;
  background: var(--grad); box-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}
.blog-year::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.3), rgba(167, 139, 250, 0.18), transparent);
}

/* 列表首次进入的入场动画（backwards 填充，动画结束后回到常规样式，hover 位移不受阻塞） */
.blog-enter { animation: posts-card-in .55s cubic-bezier(.22, .8, .3, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes posts-card-in {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.blog-empty { text-align: center; padding: 70px 24px; border-radius: 16px; }
.blog-empty-ufo {
  display: inline-block; font-size: 46px; line-height: 1; margin-bottom: 16px;
  animation: posts-ufo 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.35));
}
@keyframes posts-ufo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.blog-empty p { font-family: var(--mono); color: var(--muted); margin-bottom: 24px; letter-spacing: 1px; }

/* ---------- 文章页（#/post/{slug}）：双栏布局 + TOC ---------- */
.post-view { max-width: 1180px; } /* 覆盖原有 860px，为右栏 TOC 留位 */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  grid-template-areas: "head head" "main toc";
  gap: 6px 48px; align-items: start;
}
.post-layout > .post-header { grid-area: head; }
.post-main { grid-area: main; min-width: 0; }
.toc-wrap {
  grid-area: toc; position: sticky; top: 96px;
  max-height: calc(100vh - 128px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(0, 229, 255, 0.25) transparent;
}
.toc-wrap::-webkit-scrollbar { width: 5px; }
.toc-wrap::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 3px; }
.toc-title { display: none; font-family: var(--mono); font-size: 12px; letter-spacing: 2.5px; color: var(--pink); padding: 14px 16px 8px; }
.toc-summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  font-family: var(--mono); font-size: 13.5px; color: var(--text); padding: 13px 16px; list-style: none;
}
.toc-summary::-webkit-details-marker { display: none; }
.toc-summary:hover { color: var(--cyan); }
.toc-ico { color: var(--cyan); font-size: 15px; text-shadow: 0 0 9px rgba(0, 229, 255, 0.5); }
.toc-arrow { margin-left: auto; color: var(--muted); font-size: 11px; transition: transform .25s; }
.toc[open] > .toc-summary .toc-arrow { transform: rotate(180deg); }
.toc-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 14px; }
.toc-link {
  position: relative; display: block; padding: 6px 10px 6px 16px;
  border-left: 2px solid var(--line);
  font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--muted);
  overflow-wrap: anywhere;
  transition: color .2s, border-color .2s, background .2s, text-shadow .2s;
}
.toc-link.lvl-3 { padding-left: 30px; font-size: 12.3px; }
.toc-link:hover { color: var(--cyan); border-left-color: rgba(0, 229, 255, 0.45); background: rgba(0, 229, 255, 0.05); text-shadow: 0 0 9px rgba(0, 229, 255, 0.45); }
.toc-link.active {
  color: var(--cyan); border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.12), rgba(0, 229, 255, 0.02));
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.65);
}
.md h2, .md h3 { scroll-margin-top: 96px; } /* 平滑滚动定位时避开固定导航 */

@media (min-width: 1101px) {
  .toc-summary { display: none; } /* 桌面端无折叠开关，常开（JS 同步 open 属性） */
  .toc-title { display: block; }
}
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "toc" "main"; gap: 0; }
  .toc-wrap { position: static; max-height: none; overflow: visible; margin-bottom: 26px; }
}

/* ---------- 文章页：上一篇 / 下一篇导航 ---------- */
.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 46px; }
.post-pager[hidden] { display: none; }
.pager-item {
  display: flex; flex-direction: column; gap: 6px; padding: 17px 20px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); transition: border-color .25s, box-shadow .3s, transform .25s;
}
.pager-item:not(.disabled):hover {
  border-color: rgba(0, 229, 255, 0.55); transform: translateY(-3px);
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.2), 0 16px 36px rgba(0, 0, 0, 0.45);
  color: var(--text); text-shadow: none;
}
.pager-item.disabled { opacity: .32; }
.pager-label { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--pink); }
.pager-item.disabled .pager-label { color: var(--muted); }
.pager-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.pager-next { text-align: right; align-items: flex-end; }

/* ---------- 文章页：相关文章推荐 ---------- */
.post-related-wrap { margin-top: 38px; }
.post-related-head { font-family: var(--mono); font-size: 12.5px; color: var(--pink); letter-spacing: 2.5px; margin-bottom: 16px; }
.post-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.related-card {
  display: flex; flex-direction: column; gap: 7px; padding: 16px 18px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); transition: border-color .25s, box-shadow .3s, transform .25s;
}
.related-card:hover {
  transform: translateY(-4px); border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 24px rgba(167, 139, 250, 0.15);
  color: var(--text); text-shadow: none;
}
.related-date { font-family: var(--mono); font-size: 11.5px; color: var(--pink); letter-spacing: 1.5px; }
.related-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.related-tags { font-family: var(--mono); font-size: 11px; color: var(--violet); }

/* ---------- posts-enhance：响应式与可达性 ---------- */
@media (max-width: 560px) {
  .blog-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .blog-search { max-width: none; }
  .post-pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
}
.toc-link:focus-visible, .tag-chip:focus-visible, .blog-search-clear:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

/* ============================================================
   mobile-enhance：移动端适配（新增断点 ≤700px）
   1. 汉堡菜单（毛玻璃下拉面板，动画 ≤250ms）
   2. iOS 输入聚焦缩放（input ≥16px）
   3. 100vh → 100svh（iOS Safari 地址栏）
   4. 安全区 env(safe-area-inset-*)
   5. 触控目标 ≥44×44px
   6. 触屏 hover 粘滞消除 + :active 反馈
   7. 360px 窄屏溢出防护（boot / 终端卡 / 行内代码 / 代码块横滚）
   8. 移动端性能降级（粒子见 app.js；极光 / 扫描线 / 跑马灯 / glass）
   说明：全部放在 @media / @supports 内；桌面端（宽屏 + hover 设备）渲染不变
   ============================================================ */

/* ---------- 3. hero 100vh → 100svh：iOS 地址栏不再遮挡首屏 ---------- */
@supports (min-height: 100svh) {
  .hero { min-height: 100svh; }
}

/* ---------- 4. 安全区：仅在 viewport-fit=cover 时匹配（桌面端不命中，env 为 0） ---------- */
@media (viewport-fit: cover) {
  .nav {
    padding-left: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(16px, 4vw, 48px), env(safe-area-inset-right, 0px));
  }
  .footer { padding-bottom: max(40px, env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 1. 汉堡按钮：默认隐藏，≤700px 显示；纯 CSS 三条线，aria-expanded=true 变 X ---------- */
.nav-toggle {
  display: none; flex: none;
  width: 44px; height: 44px; padding: 0; margin-right: -8px;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle-box { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.nav-toggle-line {
  width: 20px; height: 2px; border-radius: 2px; background: var(--text);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.35);
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; border-radius: 10px; }

@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  /* 导航链接折叠为向下滑入的毛玻璃面板（.nav 为 fixed，absolute 子元素以它为基准） */
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    overflow-x: hidden; overflow-y: auto;
    max-height: calc(100vh - 64px);
    max-height: calc(100svh - 64px); /* 支持 svh 的浏览器：减去动态工具栏 */
    padding: 10px clamp(16px, 4vw, 24px) calc(14px + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 6, 15, 0.88);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
  }
  .nav-links.open {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: opacity .22s ease, transform .22s ease;
  }
  /* 面板内链接：整行 46px 高的可点区域 */
  .nav-links a {
    display: flex; align-items: center;
    min-height: 46px; padding: 8px 10px; font-size: 15px;
  }
  .nav-gh { justify-content: center; margin-top: 4px; }
}

/* ---------- 8/2/5/7. 小屏或触屏：性能降级 + 输入缩放 + 触控目标 + 代码块横滚 ---------- */
@media (max-width: 700px), (pointer: coarse) {
  /* 极光降为两块（blob-c 隐藏）、blur 与不透明度下调；扫描线透明度减半；跑马灯放缓 */
  .blob { filter: blur(56px); opacity: .22; }
  .blob-c { display: none; }
  .scanlines { opacity: .025; }
  .marquee-track { animation-duration: 46s; }
  /* glass 卡片去掉 backdrop-filter（低端机 blur 昂贵），改更实的半透明底；nav 与菜单面板保留毛玻璃 */
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 14, 27, 0.9); }
  /* 搜索框 ≥16px：避免 iOS 聚焦时自动放大页面 */
  #blog-search { font-size: 16px; }
  /* 代码块横向滚动：iOS 动量滚动 + 细滚动条 */
  .codeblock pre {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(0, 229, 255, 0.25) transparent;
  }
  .codeblock pre::-webkit-scrollbar { height: 5px; }
  .codeblock pre::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 3px; }
  /* 触控目标 ≥44×44px（padding / min-height 扩大有效触控区，不改变桌面布局） */
  .tag-chip { padding: 11px 16px; }
  .copy-btn { min-height: 44px; padding: 8px 14px; }
  .toc-link { min-height: 44px; padding: 12px 10px 12px 16px; }
  .toc-link.lvl-3 { padding-left: 30px; }
  .blog-search-clear { min-width: 44px; min-height: 44px; }
  .contrib-item { padding: 12px 18px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  .contact-row { padding: 3px 0; }
  .contact-row a { display: inline-flex; align-items: center; min-height: 44px; }
  .act-card-more a { display: inline-flex; align-items: center; min-height: 44px; }
  .section-note a { display: inline-flex; align-items: center; min-height: 44px; }
  .act-sig-main a { display: inline-block; padding: 10px 0; }
}

/* ---------- 6. 触屏：消除 hover 粘滞（还原为未 hover 样式）+ 补 :active 按压反馈 ---------- */
@media (hover: none), (pointer: coarse) {
  a:hover { text-shadow: none; } /* 全局链接发光仅限真正支持 hover 的设备 */
  .nav-links a:not(.nav-gh):hover::after { content: none; }
  .btn-primary:hover { transform: none; box-shadow: 0 0 22px rgba(0, 229, 255, 0.25); }
  .btn-ghost:hover { transform: none; border-color: var(--line); box-shadow: none; }
  .post-card:hover { transform: none; border-color: var(--line); box-shadow: none; }
  .post-card:hover::after { transform: scaleY(0); }
  .post-card:active { border-color: rgba(255, 46, 136, 0.45); }
  .proj-card:hover { border-color: var(--line); box-shadow: none; }
  .proj-card:hover .shine { opacity: 0; }
  .proj-card:active { border-color: rgba(0, 229, 255, 0.5); }
  .contrib-item:hover { color: var(--muted); border-color: var(--line); box-shadow: none; }
  .contrib-item:active { color: var(--cyan); border-color: rgba(0, 229, 255, 0.55); }
  .chip:hover { color: var(--muted); border-color: var(--line); box-shadow: none; transform: none; text-shadow: none; }
  .pager-item:not(.disabled):hover { transform: none; border-color: var(--line); box-shadow: none; }
  .pager-item:not(.disabled):active { border-color: rgba(0, 229, 255, 0.55); }
  .related-card:hover { transform: none; border-color: var(--line); box-shadow: none; }
  .related-card:active { border-color: rgba(167, 139, 250, 0.5); }
  .toc-link:not(.active):hover { color: var(--muted); border-left-color: var(--line); background: none; text-shadow: none; }
  .toc-link:not(.active):active { color: var(--cyan); border-left-color: rgba(0, 229, 255, 0.45); background: rgba(0, 229, 255, 0.05); }
  .copy-btn:hover { border-color: var(--line); box-shadow: none; }
  .copy-btn:active { border-color: var(--cyan); }
  .blog-search-clear:hover { color: var(--muted); border-color: var(--line); box-shadow: none; }
  .blog-search-clear:active { color: var(--pink); border-color: rgba(255, 46, 136, 0.55); }
  .tag-chip:not(.active):hover { color: var(--muted); border-color: var(--line); box-shadow: none; transform: none; }
  .tag-chip:not(.active):active { color: var(--cyan); border-color: rgba(0, 229, 255, 0.5); }
  .nav-gh:hover { border-color: var(--line); box-shadow: none; color: var(--muted) !important; }
  .nav-gh:active { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0, 229, 255, 0.35); color: var(--cyan) !important; }
  /* 跑马灯不做触屏暂停交互：避免手指划过后动画永久停住 */
  .marquee:hover .marquee-track { animation-play-state: running; }
}

/* ---------- 5b. 触屏平板（>700px 仍为横滚导航）：链接触控区加大到 44px ---------- */
@media (pointer: coarse) and (min-width: 701px) {
  .nav-links a { min-height: 44px; padding: 12px 4px; }
}

/* ---------- 7/10. 窄屏溢出防护与排版下限 ---------- */
@media (max-width: 560px) {
  #boot-text { white-space: pre-wrap; }          /* 开机动画长行换行，不撑出横向滚动 */
  .md code, .md a { overflow-wrap: anywhere; }   /* 行内代码 / 长链接兜底换行 */
  .proj-desc, .post-desc { font-size: 14px; }    /* 卡片摘要正文 ≥14px */
}
@media (max-width: 400px) {
  .terminal-body { overflow-wrap: break-word; }  /* 终端卡超窄屏长行兜底换行 */
}

/* ---------- 菜单开关的减少动态降级（visibility 延迟一并去除） ---------- */
@media (prefers-reduced-motion: reduce) {
  .nav-links, .nav-toggle-line { transition: none !important; }
}

/* ============================================================
   reader-enhance：文章阅读器增强（app.js 同名改造的样式面）
   1. GFM 管道表（.md-table-wrap 横向滚动 / 表头渐变底 / 行 hover 微亮 / 列对齐）
   2. 引用 callout 提示框（callout-note/tip/warning/important/caution 五色系）
   3. 代码块行号（CSS counter + ::before 伪元素，天然不进入复制文本）
   4. 图片灯箱（.rd-lightbox，Esc / 点击背景 / ✕ 关闭，z-index 高于 nav）
   5. 字号调节（--rd-fs 0.9/1/1.15 三档作用于 .md，localStorage 记忆）
   6. 首段导语强调（.md-lead）
   说明：全部为新增类名 / 新增规则，不覆盖 mobile-enhance 段任何既有规则
   ============================================================ */

/* ---------- 1. GFM 管道表 ---------- */
.md-table-wrap {
  margin: 22px 0; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(8, 11, 22, 0.45);
  scrollbar-width: thin; scrollbar-color: rgba(0, 229, 255, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}
.md-table-wrap::-webkit-scrollbar { height: 6px; }
.md-table-wrap::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 3px; }
.md-table-wrap table { width: 100%; border-collapse: collapse; font-size: .94em; }
.md table th {
  font-family: var(--mono); font-size: .86em; letter-spacing: .5px; color: var(--text);
  text-align: left; padding: 11px 14px; white-space: nowrap;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.14), rgba(167, 139, 250, 0.16) 55%, rgba(255, 46, 136, 0.10));
  border-bottom: 1px solid rgba(140, 160, 210, 0.25);
}
.md table td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: #c3cce0; }
.md table tbody tr:last-child td { border-bottom: none; }
.md table tbody tr:hover { background: rgba(0, 229, 255, 0.05); } /* 行 hover 微亮 */
/* 列对齐由 mdToHtml 输出的内联 style="text-align:…" 生效，此处只兜底 */

/* ---------- 2. callout 提示框（左侧色条 + 图标 + 小标题） ---------- */
.callout {
  --co: var(--cyan); --co-line: rgba(0, 229, 255, 0.28); --co-bg: rgba(0, 229, 255, 0.06);
  margin: 20px 0; padding: 13px 18px;
  border: 1px solid var(--co-line); border-left: 3px solid var(--co);
  border-radius: 0 12px 12px 0; background: var(--co-bg);
}
.callout-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px;
  color: var(--co); margin-bottom: 6px;
}
.callout-ico { filter: drop-shadow(0 0 6px var(--co)); }
.callout-body { font-size: .97em; line-height: 1.75; color: #c3cce0; }
.callout-tip { --co: var(--green); --co-line: rgba(43, 255, 136, 0.26); --co-bg: rgba(43, 255, 136, 0.05); }
.callout-warning { --co: var(--pink); --co-line: rgba(255, 46, 136, 0.30); --co-bg: rgba(255, 46, 136, 0.06); }
.callout-important { --co: var(--violet); --co-line: rgba(167, 139, 250, 0.30); --co-bg: rgba(167, 139, 250, 0.07); }
.callout-caution { --co: #e5484d; --co-line: rgba(229, 72, 77, 0.32); --co-bg: rgba(229, 72, 77, 0.07); } /* 暗红色系 */

/* ---------- 3. 代码块行号（counter + ::before，不进 textContent/innerText） ---------- */
.codeblock pre { counter-reset: rd-ln; }
.codeblock pre code { display: block; white-space: normal; } /* 行距交给块级 .cl，避免行间 \n 文本节点被 pre 渲染成空行 */
.codeblock .cl { display: block; white-space: pre; counter-increment: rd-ln; }
.codeblock .cl::before {
  content: counter(rd-ln);
  display: inline-block; min-width: 2.1em; padding-right: .9em; margin-right: 1.3em;
  text-align: right; color: rgba(138, 150, 179, 0.55);
  border-right: 1px solid rgba(140, 160, 210, 0.15);
  user-select: none; -webkit-user-select: none;
}

/* ---------- 4. 图片灯箱 ---------- */
html.rd-lb-open, html.rd-lb-open body { overflow: hidden; } /* 打开时锁定背景滚动 */
.rd-lightbox {
  position: fixed; inset: 0; z-index: 120; /* 高于 nav(60)/progress(95)/boot(100) */
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 64px);
}
.rd-lightbox[hidden] { display: none; }
.rd-lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 3, 9, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rd-lb-fade .3s ease;
}
.rd-lb-img {
  position: relative; max-width: 100%; max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 0 70px rgba(0, 229, 255, 0.16), 0 0 140px rgba(167, 139, 250, 0.12), 0 30px 90px rgba(0, 0, 0, 0.65); /* 柔光 */
  animation: rd-lb-zoom .42s cubic-bezier(.22, .8, .3, 1);
}
@keyframes rd-lb-fade { from { opacity: 0; } }
@keyframes rd-lb-zoom { from { opacity: 0; transform: scale(.86); } } /* 缩放入场 */
.rd-lb-cap {
  position: absolute; left: 50%; bottom: clamp(14px, 3.5vw, 26px); transform: translateX(-50%);
  max-width: min(80vw, 640px); text-align: center;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .5px;
  background: rgba(5, 6, 15, 0.6); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-lb-close {
  position: absolute; top: clamp(12px, 3vw, 22px); right: clamp(12px, 3vw, 22px);
  width: 44px; height: 44px; border-radius: 12px;
  font-family: var(--mono); font-size: 16px; color: var(--text);
  background: rgba(13, 17, 32, 0.7); border: 1px solid var(--line); cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.rd-lb-close:hover { color: var(--pink); border-color: rgba(255, 46, 136, 0.55); box-shadow: 0 0 16px rgba(255, 46, 136, 0.3); }
.rd-lb-close:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

/* ---------- 5. 字号三档（--rd-fs 由 JS 写在 #post-content 上，缺省 1） ---------- */
.md { font-size: calc(15.8px * var(--rd-fs, 1)); }
.md pre code { font-size: calc(13.5px * var(--rd-fs, 1)); } /* 代码块同步缩放 */
.rd-toolbar { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; }
.rd-toolbar-label {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 2px; margin-right: 2px; user-select: none;
}
.rd-fs-btn {
  font-family: var(--mono); color: var(--muted);
  background: rgba(13, 17, 32, 0.6); border: 1px solid var(--line); border-radius: 8px;
  min-width: 36px; height: 30px; padding: 0 10px; cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.rd-fs-btn[data-fs="0.9"] { font-size: 11px; }
.rd-fs-btn[data-fs="1"] { font-size: 13px; }
.rd-fs-btn[data-fs="1.15"] { font-size: 15px; }
.rd-fs-btn:hover { color: var(--cyan); border-color: rgba(0, 229, 255, 0.5); box-shadow: 0 0 12px rgba(0, 229, 255, 0.22); }
.rd-fs-btn[aria-pressed="true"] {
  color: #04121e; background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-color: transparent; font-weight: 700;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}
.rd-fs-btn:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

/* ---------- 6. 首段导语强调 ---------- */
.md-lead {
  font-size: 1.07em; line-height: 1.85; color: var(--muted);
  padding-bottom: 16px; margin: 4px 0 24px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(0, 229, 255, 0.35), rgba(167, 139, 250, 0.22), transparent) 1;
}

/* ---------- reader-enhance：移动端 / 触屏 / 减少动态 ---------- */
@media (max-width: 700px), (pointer: coarse) {
  .rd-fs-btn { min-width: 44px; min-height: 44px; height: auto; } /* 触控目标 ≥44px */
  .callout { padding: 12px 14px; }
  .md table th, .md table td { padding: 9px 11px; }
  .md-table-wrap { border-radius: 10px; }
}
@media (hover: none), (pointer: coarse) {
  .rd-fs-btn:hover { color: var(--muted); border-color: var(--line); box-shadow: none; } /* 消除触屏 hover 粘滞 */
  .rd-fs-btn:active { color: var(--cyan); border-color: rgba(0, 229, 255, 0.5); }
  .rd-lb-close:hover { color: var(--text); border-color: var(--line); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-lb-backdrop, .rd-lb-img { animation: none; } /* 灯箱降级为直接呈现 */
}
