/* ═════════════════════════════════════════════
   NexT Gemini 风格 · 克制极简
   左侧固定侧边栏 + 右侧文章列表
   主色灰阶 + 单一点缀色
   ═════════════════════════════════════════════ */

:root {
  --bg: #222;
  --bg-card: #2b2b2b;
  --bg-sidebar: #222;
  --text: #ccc;
  --text-strong: #fff;
  --text-muted: #999;
  --line: #333;
  --accent: #bbb;
  --accent-hover: #fff;
  --font: "Lato", "Noto Sans", "DejaVu Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Source Code Pro", "Consolas", monospace;
}

/* ═══ 动画关键帧 ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.08); }
  50%      { box-shadow: 0 0 0 6px rgba(255,255,255,.02); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes borderPulse {
  0%, 100% { border-color: var(--line); }
  50%      { border-color: #555; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  background: var(--bg);
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  animation: fadeIn .6s ease;
}

/* 容器动画 */
.container { animation: fadeUp .5s ease .12s both; }

/* 侧边栏淡入 */
.sidebar { animation: fadeIn .8s ease; }

/* 侧边栏头像悬浮 */
.avatar-wrap { transition: .3s ease; }
.avatar-wrap:hover { transform: scale(1.04); animation: pulse 2s ease infinite; }

/* 侧边栏菜单项 */
.sidebar-menu a { transition: .2s ease; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

/* ═══ 布局容器 ═══ */
.container { display: flex; min-height: 100vh; max-width: 1440px; margin: 0 auto; }

/* ═══ 侧边栏 ═══ */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  padding: 40px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--line);
}
.sidebar-inner { text-align: center; width: 100%; padding: 0 20px; }

.avatar-wrap {
  width: 96px; height: 96px;
  margin: 0 auto 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.avatar-initial {
  width: 100%; height: 100%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 300;
  color: var(--text);
}

.site-author-name { font-size: 18px; font-weight: 400; color: var(--text-strong); margin-top: 8px; }
.site-description { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* 甜甜圈 */
.donut-wrap {
  margin: 6px auto 0;
  width: 192px;
  height: 90px;
  overflow: hidden;
  white-space: pre;
  font-size: 4px;
  line-height: 4px;
  font-family: 'Courier New', 'Source Code Pro', monospace;
  color: var(--text-muted);
  opacity: .65;
  letter-spacing: 0;
}

/* 侧边栏菜单 */
.sidebar-menu { margin-top: 28px; width: 100%; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 0;
  color: var(--text);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.sidebar-menu a:last-child { border-bottom: 1px solid var(--line); }
.sidebar-menu a:hover { color: var(--accent-hover); }
.sidebar-menu a.active { color: var(--accent-hover); }
.sidebar-menu a .m-icon { margin-right: 8px; font-size: 13px; color: var(--text-muted); }

/* 侧边栏社交 */
.social { margin-top: 22px; display: flex; justify-content: center; gap: 16px; font-size: 17px; }
.social a { color: var(--text-muted); }
.social a:hover { color: var(--accent-hover); }

/* 侧边栏访客 */
.site-visitors { margin-top: 22px; font-size: 12px; color: var(--text-muted); }

/* ═══ 主内容 ═══ */
.main { flex: 1; padding: 40px 40px; max-width: 960px; min-width: 0; }

/* 文章卡片 */
.post-block { padding: 26px 0; border-bottom: 1px solid var(--line); animation: fadeUp .5s ease both; }
.post-block { animation-delay: .15s; }
.post-block:last-child { border-bottom: none; }

.post-header { margin-bottom: 12px; }
.post-title {
  font-size: 21px;
  font-weight: 400;
  color: var(--text-strong);
  line-height: 1.5;
}
.post-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.post-meta .sep { margin: 0 8px; color: #444; }
.post-meta .cat { color: var(--text-muted); }
.post-meta .tag { color: var(--text-muted); }

.post-body { color: var(--text); font-size: 14px; }
.post-body p { margin-bottom: 10px; }

.read-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text);
  border: 1px solid #444;
  padding: 4px 16px;
  border-radius: 2px;
  transition: .2s;
}
.read-more:hover { border-color: var(--text); color: var(--text-strong); }

/* 文章内标题/代码 */
.post-content h2 { font-size: 19px; font-weight: 400; color: var(--text-strong); margin: 28px 0 10px; }
.post-content h3 { font-size: 16px; font-weight: 400; color: var(--text-strong); margin: 22px 0 8px; }
.post-content p { margin-bottom: 12px; }
.post-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: #333;
  color: var(--text-strong);
  padding: 2px 6px;
  border-radius: 3px;
}
.post-content pre { background: #1a1a1a; border: 1px solid var(--line); border-radius: 4px; padding: 14px; overflow-x: auto; margin: 14px 0; }
.post-content pre code { background: none; color: var(--text); padding: 0; }
.post-content blockquote { border-left: 3px solid #555; padding: 8px 16px; margin: 14px 0; color: var(--text); background: rgba(255,255,255,.02); }
.post-content ul, .post-content ol { padding-left: 20px; margin-bottom: 12px; }
.post-content li { margin-bottom: 4px; }
.post-content strong { color: var(--text-strong); font-weight: 400; }

/* ═══ 技术栈网格 ═══ */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.stack-card { border: 1px solid var(--line); border-radius: 4px; padding: 14px; background: var(--bg-card); transition: .2s ease; animation: fadeUp .5s ease both; }
.stack-card:hover { transform: translateY(-3px); border-color: #555; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.stack-card .st-name { font-size: 14px; font-weight: 400; color: var(--text-strong); margin-bottom: 8px; }
.stack-card .st-list { display: flex; flex-wrap: wrap; gap: 5px; }
.stack-card .st-list span { font-size: 12px; padding: 2px 9px; border-radius: 2px; background: #333; color: var(--text); transition: .15s ease; }
.stack-card:hover .st-list span { background: #3a3a3a; }

/* ═══ 项目网格 ═══ */
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.project-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  background: var(--bg-card);
  color: var(--text);
  transition: .2s;
}
.project-card { animation: fadeUp .5s ease both; }
.project-card:hover { border-color: #555; transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }

.project-card .p-top { display: flex; justify-content: space-between; align-items: center; }
.project-card .p-icon { font-size: 18px; color: var(--text-muted); }
.project-card .p-lang { font-size: 11px; font-family: var(--mono); padding: 2px 8px; border-radius: 2px; font-weight: 400; color: var(--text-muted); background: #333; }
.project-card .p-name { font-size: 15px; font-weight: 400; color: var(--text-strong); margin-top: 8px; }
.project-card .p-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.project-card .p-stack { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.project-card .p-stack span { font-size: 11px; padding: 1px 8px; border-radius: 2px; background: #333; color: var(--text-muted); }

/* ═══ 欢迎区 ═══ */
.welcome { padding: 16px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; animation: fadeUp .4s ease; }
.welcome h1 { font-size: 30px; font-weight: 300; color: var(--text-strong); letter-spacing: -0.5px; }
.welcome h1 .name { font-weight: 700; }
.welcome p { color: var(--text-muted); margin-top: 6px; font-size: 15px; }
.welcome .welcome-sub { margin-top: 10px; font-size: 14px; color: var(--text-muted); opacity: .85; }
.welcome-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.welcome-tags span {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
  border: 1px solid #444;
  padding: 3px 12px;
  border-radius: 12px;
  transition: .15s;
}
.welcome-tags span { animation: fadeUp .4s ease both; }

.welcome-tags span:hover { border-color: var(--text); color: var(--text-strong); }

/* ═══ 数据统计 ═══ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.stat {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  padding: 18px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeUp .5s ease both;
  transition: .2s ease;
}
.stat:hover { transform: translateY(-3px); border-color: #555; }

.stat .s-num { font-size: 30px; font-weight: 300; color: var(--text-strong); font-family: var(--mono); }
.stat .s-label { font-size: 12px; color: var(--text-muted); }

/* ═══ 标题英文小字 ═══ */
.post-title .en { font-size: 15px; font-weight: inherit; color: var(--text-muted); }

/* ═══ 中英文切换 ═══ */
body.lang-en .zh, body.lang-en .ru { display: none !important; }
body.lang-zh .en, body.lang-zh .ru { display: none !important; }
body.lang-ru .zh, body.lang-ru .en { display: none !important; }
.zh, .en, .ru { font-weight: inherit; }
body.lang-fade { animation: langFade .25s ease; }
@keyframes langFade {
  0%   { opacity: 1; }
  40%  { opacity: .6; }
  100% { opacity: 1; }
}

.lang-bar { display: flex; align-items: center; justify-content: center; margin-top: 22px; }
.lang-btn {
  cursor: pointer;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
  border: 1px solid #444;
  background: none;
  padding: 4px 14px;
  border-radius: 14px;
  transition: .2s ease, transform .15s ease;
  user-select: none;
}
.lang-btn:hover { border-color: var(--text); color: var(--text-strong); }
.lang-btn:active { transform: scale(.92); }

/* ═══ 项目列表（首页） ═══ */
.proj-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: .2s ease;
  animation: fadeUp .5s ease both;
}
.proj-item:hover { border-color: #555; transform: translateX(4px); }

.proj-item:hover { border-color: #555; }
.proj-head { display: flex; justify-content: space-between; align-items: center; }
.proj-name { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.proj-lang { font-size: 11px; font-family: var(--mono); color: var(--text-muted); background: #333; padding: 2px 8px; border-radius: 2px; }
.proj-desc { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.proj-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.proj-tags span { font-size: 11px; padding: 1px 8px; border-radius: 2px; background: #333; color: var(--text); }
.proj-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--text); }
.proj-link:hover { color: var(--text-strong); }

/* ═══ 项目卡片（归档页） ═══ */
.proj-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  padding: 16px;
  transition: .2s ease;
  animation: fadeUp .5s ease both;
  display: flex;
  flex-direction: column;
}
.proj-card:hover { border-color: #555; transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.proj-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
}
.proj-meta .pj-github {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  transition: .15s ease;
}
.proj-meta .pj-github:hover { color: var(--text-strong); }

/* ═══ 语言标签 · GitHub 语言色 ═══ */
.proj-lang { display: inline-flex; align-items: center; gap: 6px; }
.proj-lang::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.proj-lang.lang-python::before { background: #3572A5; }
.proj-lang.lang-go::before { background: #00ADD8; }
.proj-lang.lang-js::before,
.proj-lang.lang-javascript::before { background: #f1e05a; }
.proj-lang.lang-java::before { background: #b07219; }
.proj-lang.lang-ts::before,
.proj-lang.lang-typescript::before { background: #3178c6; }
.proj-lang.lang-html::before { background: #e34c26; }
.proj-lang.lang-css::before { background: #563d7c; }
.proj-lang.lang-shell::before,
.proj-lang.lang-bash::before { background: #89e051; }
.proj-lang.lang-c::before { background: #555555; }
.proj-lang.lang-cpp::before { background: #f34b7d; }
.proj-lang.lang-dockerfile::before { background: #384d54; }
.proj-lang.lang-none::before { background: #8b949e; }

/* 多语言徽章容器 */
.proj-langs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ═══ 动态时间线 ═══ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 4px; bottom: 4px;
  width: 1px;
  background: #444;
}
.tl-item { position: relative; padding: 8px 0; animation: fadeUp .5s ease both; }

.tl-dot { animation: pulse 3s ease infinite;
  position: absolute;
  left: -22px; top: 14px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #555;
  border: 2px solid var(--bg);
}
.tl-date { font-size: 12px; font-family: var(--mono); color: var(--text-muted); display: block; }
.tl-text { font-size: 14px; color: var(--text); }

/* ═══ 页脚 ═══ */
.footer { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 24px; }
.footer .heart { color: var(--text-muted); }

.widget {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  padding: 14px 16px;
  margin-bottom: 14px;
  animation: fadeUp .5s ease both;
  transition: .2s ease;
}
.widget:hover { border-color: #444; }
.widget-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.widget { text-align: center; }

.widget ul { list-style: none; width: 100%; display: inline-block; text-align: center; }
.widget li { padding: 5px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.03); }
.widget li:last-child { border-bottom: none; }
.widget li a,
.cat-item { color: var(--text); cursor: default; transition: .15s ease; }
.widget li a:hover,
.cat-item:hover { color: var(--text-strong); padding-left: 3px; }
.widget .count { color: var(--text-muted); font-size: 11px; font-family: var(--mono); margin-left: 6px; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag-cloud a,
.tag-item {
  font-size: 11px;
  color: var(--text);
  border: 1px solid #444;
  padding: 3px 10px;
  border-radius: 12px;
  transition: .2s ease;
  cursor: default;
}
.tag-cloud a:hover,
.tag-item:hover { border-color: #666; color: var(--text-strong); background: rgba(255,255,255,.03); }

/* 友情链接 */
.link-list a { display: block; padding: 5px 0; font-size: 13px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,.03); transition: .15s ease; }
.link-list a:last-child { border-bottom: none; }
.link-list a i { margin-right: 8px; color: var(--text-muted); width: 14px; }
.link-list a:hover { color: var(--text-strong); padding-left: 4px; }

/* ═══ 右侧边栏 ═══ */
.right-bar {
  width: 240px;
  flex-shrink: 0;
  padding: 40px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ═══ 文章页 ═══ */
.art-item { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.art-item:last-child { border-bottom: none; }
.art-title { font-size: 18px; margin: 0 0 6px; }
.art-title a { color: var(--text); text-decoration: none; }
.art-title a:hover { color: var(--accent); }
.art-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.art-summary { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0 0 10px; }
.art-content { line-height: 1.8; font-size: 15px; }
.art-content h3 { margin: 24px 0 12px; font-size: 18px; color: var(--text); }
.art-content h4 { margin: 20px 0 10px; font-size: 16px; color: var(--text); }
.art-content p { margin: 10px 0; }
.art-content code { background: var(--tag-bg); padding: 2px 6px; border-radius: 3px; font-size: 14px; }
.art-content pre { padding: 14px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 12px 0; background: #1e1e2e; border: 1px solid #333; }
.art-content pre code { background: none; padding: 0; }
.art-content blockquote { border-left: 3px solid var(--accent); margin: 12px 0; padding: 8px 16px; background: var(--tag-bg); border-radius: 0 6px 6px 0; }
.art-content ul, .art-content ol { margin: 8px 0; padding-left: 20px; }
.art-content li { margin: 4px 0; }
.art-content a { color: var(--accent); }
.art-ref { font-size: 14px; color: var(--text-muted); margin: 0 0 20px; }
.art-back { display: inline-block; margin-top: 20px; }

/* ═══ 代码块容器 ═══ */
.code-block { position: relative; margin: 12px 0; border-radius: 8px; overflow: hidden; border: 1px solid #333; }
.code-block .code-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: #181825; font-size: 12px; color: #a6adc8; border-bottom: 1px solid #333; user-select: none; }
.code-block .code-lang { font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.code-block .code-copy { background: none; border: 1px solid #444; color: #a6adc8; cursor: pointer; font-size: 12px; padding: 2px 10px; border-radius: 4px; transition: all .2s; }
.code-block .code-copy:hover { background: #313244; color: #cdd6f4; }
.code-block .code-copy.copied { background: #a6e3a1; color: #1e1e2e; border-color: #a6e3a1; }
.code-block pre { margin: 0 !important; border: none !important; border-radius: 0 !important; background: #1e1e2e !important; }

/* ═══ 复活节彩蛋 ═══ */
.easter-egg-btn { position: relative; display: inline; background: none; border: 1px solid var(--text-muted); color: var(--text-muted); font-size: 13px; cursor: pointer; opacity: .6; transition: all .2s; margin-left: 8px; padding: 2px 10px; border-radius: 4px; vertical-align: middle; line-height: 1.4; }
.easter-egg-btn:hover { opacity: 1; color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,.05); }
.easter-egg-btn:hover { opacity: .8; color: var(--accent); }
.bug-item { position: fixed; z-index: 100000; animation: bugDance var(--dur) infinite alternate ease-in-out; }
.bug-item img { width: 60px; height: 60px; display: block; }
.bug-msg { position: fixed; z-index: 100001; font-size: 20px; font-weight: 700; color: #f38ba8; text-shadow: 0 0 10px rgba(0,0,0,.9), 2px 2px 0 #000; pointer-events: none; animation: bugFadeOut 3s ease forwards; background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 8px; }
.bug-clear-btn { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 100002; background: #f38ba8; color: #1e1e2e; border: none; padding: 10px 24px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; pointer-events: auto; box-shadow: 0 4px 16px rgba(0,0,0,.5); opacity: 0; animation: bugFadeIn .3s ease .5s forwards; }
.bug-clear-btn:hover { background: #f5c2e7; }
@keyframes bugDance { 0% { transform: translate(0,0) rotate(0deg); } 25% { transform: translate(30px,-20px) rotate(10deg); } 50% { transform: translate(-20px,30px) rotate(-5deg); } 75% { transform: translate(20px,20px) rotate(8deg); } 100% { transform: translate(-30px,-10px) rotate(-3deg); } }
@keyframes bugFadeOut { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-40px) scale(1.2); } }
@keyframes bugFadeIn { 0% { opacity: 0; transform: translateX(-50%) translateY(10px); } 100% { opacity: 1; transform: translateX(-50%) translateY(0); } }

@media (max-width: 1100px) {
  .right-bar { display: none; }
}

/* ═══ 手机端适配 ═══ */
@media (max-width: 768px) {
  .container { flex-direction: column; }
  .sidebar { width: 100%; min-width: 100%; height: auto; position: static; padding: 10px 0 6px; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-inner { padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px 0; }
  .avatar-stack { width: 56px; height: 56px; margin: 0 auto; flex-shrink: 0; }
  .avatar-card { border-radius: 10px; }
  .site-author-name { font-size: 15px; margin-top: 2px; margin-right: 0; text-align: center; }
  .site-description { font-size: 11px; margin-top: 0; margin-right: 0; text-align: center; }
  .lang-bar { margin-top: 0; margin-right: 0; }
  .social { margin-top: 0; gap: 12px; font-size: 15px; margin-right: 0; }
  .sidebar-menu { display: flex; width: 100%; justify-content: space-around; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .sidebar-menu a { flex: 1; text-align: center; border-top: none; border-bottom: none; font-size: 13px; padding: 6px 4px; }
  .sidebar-menu a:last-child { border-bottom: none; }
  .sidebar-menu a .m-icon { display: none; }
  .donut-wrap { display: none; }
  .site-visitors { display: none; }
  .main { padding: 16px 14px; }
  .welcome { padding: 8px 0 14px; margin-bottom: 16px; }
  .welcome h1 { font-size: 22px; }
  .welcome p { font-size: 14px; margin-top: 4px; }
  .welcome-tags { gap: 6px; margin-top: 10px; }
  .welcome-tags span { font-size: 12px; padding: 3px 10px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 12px 0; }
  .stat { padding: 10px; }
  .stat .s-num { font-size: 20px; }
  .stat .s-label { font-size: 12px; }
  .post-block { padding: 14px 0; }
  .post-title { font-size: 17px; }
  .post-meta { font-size: 12px; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }
  .stack-card { padding: 10px; }
  .stack-card .st-name { font-size: 13px; }
  .stack-card .st-list { gap: 4px; margin-top: 5px; }
  .stack-card .st-list span { font-size: 11px; padding: 2px 7px; }
  .project-grid { grid-template-columns: 1fr; }
  .proj-item { padding: 12px; }
  .proj-name { font-size: 15px; }
  .proj-desc { font-size: 13px; }
  .proj-langs { gap: 3px; }
  .proj-lang { font-size: 10px; padding: 1px 6px; }
  .proj-tags { gap: 4px; margin-top: 6px; }
  .proj-tags span { font-size: 11px; padding: 2px 8px; }
  .proj-link { font-size: 13px; }
  .timeline { padding: 6px 0 6px 22px; }
  .tl-item { font-size: 13px; }
  .tl-date { font-size: 11px; min-width: 48px; }
  .footer { font-size: 12px; padding: 12px 0; }
  .widget { margin-bottom: 12px; }
  .widget-title { font-size: 14px; }
  .cat-item { font-size: 13px; }
  .tag-item { font-size: 12px; padding: 3px 10px; }
  .read-more { font-size: 13px; }
}

@media (max-width: 480px) {
  .sidebar { padding: 10px 0 8px; }
  .avatar-stack { width: 48px; height: 48px; margin-bottom: 4px; }
  .avatar-card { border-radius: 8px; }
  .site-author-name { font-size: 13px; }
  .site-description { font-size: 11px; }
  .sidebar-menu a { font-size: 12px; padding: 6px 0; }
  .main { padding: 12px 10px; }
  .welcome h1 { font-size: 18px; }
  .welcome p { font-size: 12px; }
  .welcome .welcome-sub { font-size: 12px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 8px 0; }
  .stat { padding: 8px; }
  .stat .s-num { font-size: 16px; }
  .stat .s-label { font-size: 10px; }
  .stack-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .stack-card { padding: 8px; }
  .post-title { font-size: 15px; }
  .proj-item { padding: 8px; }
  .proj-name { font-size: 13px; }
  .proj-desc { font-size: 12px; }
}
/* 头像图片样式 */
.avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* 翻牌头像（正方形圆角） */
.avatar-stack {
  width: 96px; height: 96px;
  margin: 0 auto 16px;
  position: relative;
  perspective: 600px;
  cursor: pointer;
}
.avatar-card {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  backface-visibility: hidden;
  transition: transform .5s ease;
}
.avatar-stack .card-front {
  transform: rotateY(0deg);
}
.avatar-stack .card-back {
  transform: rotateY(180deg);
}
.avatar-stack.flipped .card-front {
  transform: rotateY(180deg);
}
.avatar-stack.flipped .card-back {
  transform: rotateY(360deg);
}
.avatar-card .avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* 关于页 - 介绍卡片 */
.bio-card { padding: 0 0 8px; }
.bio-card p { margin: 6px 0; line-height: 1.7; }
.bio-contact { margin-top: 14px; display: flex; gap: 20px; flex-wrap: wrap; }
.bio-contact a { color: var(--accent); font-size: 14px; }
.bio-contact a:hover { text-decoration: underline; }
.bio-contact i { width: 16px; text-align: center; margin-right: 4px; }

/* 联系我/社交平台 - 关于页 (无方框纯文本风格) */
.contact-section {
  margin: 18px 0 8px;
  padding: 0 0 8px;
}
.contact-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  margin: 22px 0 8px;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.contact-links a {
  color: var(--accent);
  font-size: 14px;
  line-height: 1.7;
  transition: .15s ease;
}
.contact-links a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}
.contact-links i {
  width: 16px;
  text-align: center;
  margin-right: 6px;
  color: var(--text-muted);
}

/* 画廊网格 - 拼贴瀑布流 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 140px;
  gap: 6px;
  margin: 16px 0;
  grid-auto-flow: dense;
}
.g-item {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
  background: var(--bg-card);
  display: block;
  text-decoration: none;
}
.g-item:hover {
  transform: scale(1.03);
  box-shadow: 0 3px 15px rgba(0,0,0,.4);
  z-index: 2;
}
.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.g-item.span2 { grid-column: span 2; grid-row: span 2; }
.g-item.tall  { grid-column: span 1; grid-row: span 2; }
.g-item.normal { grid-column: span 1; grid-row: span 1; }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 90px; gap: 4px; }
  .g-item.span2 { grid-column: span 2; grid-row: span 2; }
  .g-item.tall  { grid-column: span 1; grid-row: span 2; }
  .g-item.normal { grid-column: span 1; grid-row: span 1; }
}

/* 图片查看器（内置灯箱） */
.lightbox {
  display: none;
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,.88);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}
.lightbox-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
}
.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lightbox-close {
  position: fixed; top: 20px; right: 30px;
  font-size: 38px; color: #aaa; cursor: pointer;
  width: 44px; height: 44px; line-height: 44px;
  text-align: center; border-radius: 50%;
  background: rgba(0,0,0,.3); z-index: 99999;
  transition: color .2s, background .2s;
}
.lightbox-close:hover { color: #fff; background: rgba(255,255,255,.15); }

