/* ==========================================================================
   赵华的个人博客 · 主题样式
   纯手写，无任何外部依赖（无 webfont / 无 CDN / 无框架）
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --text: #111827;
  --text-2: #475569;
  --muted: #8b95a5;
  --border: rgba(17, 24, 39, 0.08);
  --border-strong: rgba(17, 24, 39, 0.14);
  --brand: #7c3aed;
  --brand-2: #2563eb;
  --brand-3: #06b6d4;
  --grad: linear-gradient(120deg, #7c3aed 0%, #2563eb 55%, #06b6d4 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 58, 237, 0.12), rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.12));
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 12px 32px -16px rgba(16, 24, 40, 0.22);
  --shadow-lg: 0 28px 70px -30px rgba(76, 44, 180, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --code-bg: #0f172a;
  --header-h: 64px;
  --header-bg: rgba(246, 247, 251, 0.78);
  --footer-bg: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] {
  --bg: #080c16;
  --bg-soft: #0c1322;
  --surface: #0f172a;
  --surface-2: #131d33;
  --text: #e9eef8;
  --text-2: #aab7cc;
  --muted: #7d8ba3;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 30px 80px -34px rgba(0, 0, 0, 0.85);
  --code-bg: #070d19;
  --header-bg: rgba(8, 12, 22, 0.75);
  --footer-bg: rgba(15, 23, 42, 0.5);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

/* 关键：让 hidden 属性始终生效（否则 .search-modal / .lightbox 的 display 会覆盖它） */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

::selection { background: rgba(124, 58, 237, 0.22); }

/* ---------- 背景装饰光斑 ---------- */
.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orb-1 {
  width: 480px; height: 480px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.55), transparent 68%);
}

.orb-2 {
  width: 520px; height: 520px;
  top: 120px; right: -180px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.42), transparent 70%);
}

.orb-3 {
  width: 460px; height: 460px;
  bottom: -220px; left: 30%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35), transparent 70%);
}

[data-theme="dark"] .orb { opacity: 0.32; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.brand-mark {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(124, 58, 237, 0.8);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font-size: 15px; letter-spacing: 0.2px; }
.brand-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover { color: var(--text); background: var(--bg-soft); }

.nav-link[aria-current="page"] { color: var(--brand); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-toggle { display: none; }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
html:not([data-theme]) .icon-moon { display: none; }

/* ---------- 首屏 Hero ---------- */
.hero { padding: 64px 0 12px; }

.hero-inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-avatar {
  position: relative;
  flex: 0 0 auto;
}

.hero-avatar::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.7;
  filter: blur(10px);
}

.hero-avatar img {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(16deg); }
  80% { transform: rotate(-8deg); }
  90% { transform: rotate(10deg); }
}

.hero-bio {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 15.5px;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.hero-stats span { display: inline-flex; align-items: center; gap: 6px; }
.hero-stats span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-3);
}

.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}

.pill:hover {
  color: var(--brand);
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(124, 58, 237, 0.6);
}

/* ---------- 通用区块 ---------- */
.section { padding: 44px 0 64px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.2px;
}

.section-head h2::before {
  content: "";
  display: inline-block;
  width: 4px; height: 18px;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--grad);
  vertical-align: -2px;
}

.more { font-size: 14px; color: var(--muted); }
.more:hover { color: var(--brand); }

/* ---------- 文章卡片 ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.post-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(124, 58, 237, 0.28);
}

.post-card:hover::before { opacity: 1; }

.post-card-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 18px;
  color: inherit;
  height: 100%;
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-card-top time { font-size: 12.5px; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.chip-ghost {
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 500;
}

.chip-accent {
  background: var(--grad);
  color: #fff;
}

.post-card h3 {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.45;
  letter-spacing: -0.1px;
  color: var(--text);
}

.post-card-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.post-card-foot .arrow {
  color: var(--brand);
  transition: transform 0.2s ease;
}

.post-card:hover .arrow { transform: translateX(4px); }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

.pager-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.pager-btn:hover:not(.disabled) {
  color: var(--brand);
  border-color: rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}

.pager-btn.disabled { opacity: 0.45; cursor: not-allowed; }

.pager-info { font-size: 13.5px; color: var(--muted); }

/* ---------- 文章页 ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  z-index: 60;
  transition: width 0.1s linear;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 72px;
  align-items: start;
}

.post-head { margin-bottom: 30px; }

.post-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.post-head h1 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.32;
  letter-spacing: -0.4px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}

.post-meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* 目录 */
.post-aside { position: sticky; top: 88px; }

.toc {
  border-left: 2px solid var(--border);
  padding-left: 16px;
  font-size: 13.5px;
}

.toc-title {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.toc nav { display: flex; flex-direction: column; gap: 2px; }

.toc a {
  display: block;
  padding: 4px 0;
  color: var(--text-2);
  line-height: 1.5;
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: 16px;
  transition: all 0.15s ease;
}

.toc a:hover { color: var(--brand); }
.toc a.active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}
.toc a.toc-h3 { padding-left: 28px; font-size: 13px; opacity: 0.9; }

/* 上下篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.18s ease;
}

.post-nav-item:hover {
  border-color: rgba(124, 58, 237, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-nav-item .k { font-size: 12px; color: var(--muted); }
.post-nav-item b { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.post-nav-item.right { text-align: right; align-items: flex-end; }

.post-back { margin-top: 26px; font-size: 14px; }
.post-back a { color: var(--muted); }
.post-back a:hover { color: var(--brand); }

/* ---------- 正文排版 ---------- */
.markdown-body { color: var(--text); font-size: 16px; }

.markdown-body > *:first-child { margin-top: 0; }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 2em 0 0.7em;
  line-height: 1.35;
  letter-spacing: -0.2px;
  scroll-margin-top: 84px;
}

.markdown-body h1 { font-size: 26px; }
.markdown-body h2 {
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.markdown-body h3 { font-size: 18px; }
.markdown-body h4 { font-size: 16px; color: var(--text-2); }

.markdown-body p { margin: 0 0 1.1em; }

.markdown-body a {
  color: var(--brand-2);
  border-bottom: 1px solid rgba(37, 99, 235, 0.3);
  transition: border-color 0.15s ease;
}

.markdown-body a:hover { border-bottom-color: var(--brand-2); }

.markdown-body ul,
.markdown-body ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.markdown-body li { margin: 0.35em 0; }

.markdown-body blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--bg-soft);
  color: var(--text-2);
}

.markdown-body blockquote p:last-child { margin-bottom: 0; }

.markdown-body hr {
  border: none;
  height: 1px;
  margin: 2em 0;
  background: var(--border);
}

.markdown-body img {
  display: block;
  margin: 1.4em auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

/* 行内代码 */
.markdown-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

/* 代码块 */
.markdown-body pre {
  position: relative;
  margin: 1.4em 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  box-shadow: var(--shadow);
}

.markdown-body pre code {
  padding: 0;
  background: none;
  color: #e2e8f0;
  font-size: inherit;
}

.highlight { position: relative; }
.highlight pre { margin: 1.4em 0; }

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.highlight:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* 表格 */
.markdown-body table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 14.5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.markdown-body th {
  background: var(--bg-soft);
  font-weight: 600;
  text-align: left;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.markdown-body tr:last-child td { border-bottom: none; }

/* ---------- Rouge 代码高亮（深色卡片） ---------- */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #64748b; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc, .highlight .kr, .highlight .kt { color: #c792ea; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss { color: #a5d6ff; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #f78c6c; }
.highlight .n, .highlight .na, .highlight .nb, .highlight .nc, .highlight .nd, .highlight .ne, .highlight .nf, .highlight .ni, .highlight .nl, .highlight .nn, .highlight .nt, .highlight .nv { color: #e2e8f0; }
.highlight .nf { color: #82aaff; }
.highlight .nc, .highlight .nn { color: #ffcb6b; }
.highlight .na { color: #c3e88d; }
.highlight .o, .highlight .ow, .highlight .p { color: #89ddff; }
.highlight .err { color: #ff5370; }
.highlight .gd { color: #ff5370; }
.highlight .gi { color: #c3e88d; }

/* ---------- 页面（分类 / 项目 / 关于） ---------- */
.page-main { min-height: calc(100vh - 320px); }

.page-block { padding-top: 44px; padding-bottom: 72px; }

.page-head { margin-bottom: 30px; }

.kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.4px;
  color: var(--brand);
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.4px;
}

.page-sub { margin: 0; color: var(--muted); font-size: 14.5px; }

/* 分类页 */
.cat-block {
  margin-bottom: 34px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.cat-head h2 { margin: 0; font-size: 17px; }

.cat-count {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
}

.post-list { list-style: none; margin: 0; padding: 0; }

.post-list li { border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }

.post-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 4px;
  color: var(--text);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.post-list a:hover { color: var(--brand); padding-left: 8px; }

.pl-title { font-size: 15px; }
.post-list time { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); }

/* 项目页 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.22s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: var(--shadow-lg);
}

.project-card.is-featured {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  border: 1px solid transparent;
}

.project-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.lang-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.project-lang { font-size: 12.5px; color: var(--muted); }

.project-card .chip-accent { margin-left: auto; font-size: 11px; padding: 2px 9px; }

.project-card h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  letter-spacing: -0.1px;
}

.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--brand); }

.project-desc {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 11.5px;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.stars svg { color: #f59e0b; }
.stars b { font-weight: 600; color: var(--text-2); }

.project-link { color: var(--brand-2); font-weight: 500; }
.project-link .arrow { transition: transform 0.18s ease; display: inline-block; }
.project-link:hover .arrow { transform: translateX(4px); }

.project-more { margin-top: 30px; text-align: center; }

.btn-ghost, .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  background: var(--surface);
}

.btn-ghost:hover {
  color: var(--brand);
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(124, 58, 237, 0.9);
}

.btn-primary:hover { color: #fff; transform: translateY(-2px); }

/* 关于页 */
.about-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.about-avatar {
  width: 112px; height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18), var(--shadow);
}

.about-hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.3px; }
.about-nick { font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.about-bio { margin: 0 0 10px; color: var(--text-2); font-size: 14.5px; }
.about-links { display: flex; gap: 16px; margin: 0; font-size: 14px; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.about-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.about-card h3 { margin: 0 0 12px; font-size: 15.5px; }
.about-card ul { margin: 0; padding-left: 1.1em; font-size: 14px; color: var(--text-2); }
.about-card li { margin: 5px 0; }
.about-text { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.7; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.skill-tags span {
  padding: 4px 11px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12.5px;
}

.about-note {
  margin-top: 26px;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--grad-soft);
  border: 1px dashed rgba(124, 58, 237, 0.35);
  text-align: center;
}

.about-note p { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.about-note-sub { margin-top: 8px !important; font-size: 14px !important; font-weight: 400 !important; color: var(--text-2); }

/* 404 */
.error-block { padding: 100px 24px 120px; text-align: center; }

.error-code {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -4px;
}

.error-block h1 { margin: 18px 0 8px; font-size: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* ---------- 搜索弹层 ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: rgba(9, 13, 24, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.16s ease;
}

.search-panel {
  width: 100%;
  max-width: 640px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px -30px rgba(8, 12, 24, 0.6);
  overflow: hidden;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.search-field input::placeholder { color: var(--muted); }

.search-field kbd {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-size: 11px;
  color: var(--muted);
}

.search-results {
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px;
}

.search-tip {
  margin: 0;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.search-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  transition: background 0.14s ease;
}

.search-item:hover, .search-item.is-active {
  background: var(--bg-soft);
}

.search-item b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.search-item span { font-size: 12.5px; color: var(--muted); }
.search-item mark { background: rgba(124, 58, 237, 0.22); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- 回到顶部 & 灯箱 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 45;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.18s ease;
}

.to-top:hover {
  color: var(--brand);
  transform: translateY(-3px);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  background: rgba(6, 9, 18, 0.9);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
  animation: fadeIn 0.16s ease;
}

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding: 36px 0 22px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-name { font-weight: 700; font-size: 15px; }
.footer-name span { color: var(--muted); font-weight: 400; font-size: 13px; }
.footer-muted { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 480px; }

.footer-links { display: flex; gap: 18px; align-items: flex-start; }
.footer-links a { color: var(--text-2); font-size: 13.5px; }
.footer-links a:hover { color: var(--brand); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { display: none; }
}

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-inner { gap: 20px; }
  .hero h1 { font-size: 27px; }
  .hero-avatar img { width: 76px; height: 76px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-hero { flex-direction: column; text-align: center; }
  .about-links { justify-content: center; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 12px; right: 12px;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 11px 14px; }
  .nav-toggle { display: grid; }
  .nav-link[aria-current="page"]::after { display: none; }
  .nav-link[aria-current="page"] { background: rgba(124, 58, 237, 0.1); }

  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 25px; }
  .post-grid, .project-grid { grid-template-columns: 1fr; }
  .post-head h1 { font-size: 25px; }
  .post-layout { padding-top: 32px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.right { text-align: left; align-items: flex-start; }
  .footer-inner { flex-direction: column; }
  .section { padding: 32px 0 48px; }
  .search-modal { padding-top: 8vh; }
  .to-top { right: 16px; bottom: 18px; }
  .error-code { font-size: 68px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .site-footer, .post-aside, .to-top, .search-modal, .bg-deco { display: none !important; }
  body { background: #fff; color: #000; }
  .post-layout { display: block; padding: 0; }
}
