/* =========================================================
 * lily'epitaph · Modern Minimalist Style
 * 配色：薄荷绿 + 粉红（贴合头像）
 * 设计：圆角卡片、柔和阴影、充足留白
 * ========================================================= */

:root {
  /* 主色调 - 基于头像 */
  --mint: #7FB5B0;
  --mint-light: #A8D5D1;
  --mint-dark: #5A8F8A;
  --pink: #E8839B;
  --pink-light: #F4A7B9;
  --pink-dark: #C96B82;
  
  /* 中性色 */
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F5F3;
  --ink: #2C3E50;
  --ink-soft: #5A6B7C;
  --muted: #8B95A5;
  --border: #E8E8E6;
  --border-light: #F0F0EE;
  
  /* 代码块 */
  --code-bg: #F8F9FA;
  --code-border: #E9ECEF;
  
  /* 布局 */
  --maxw: 1200px;
  --readw: 720px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  
  /* 字体 */
  --serif: "Playfair Display", Georgia, "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #1A1A1A;
  --bg-card: #242424;
  --bg-hover: #2A2A2A;
  --ink: #E8E8E8;
  --ink-soft: #B8B8B8;
  --muted: #888888;
  --border: #333333;
  --border-light: #2A2A2A;
  --code-bg: #1E1E1E;
  --code-border: #333333;
  --shadow: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(ellipse at top left, rgba(127, 181, 176, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(232, 131, 155, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(168, 213, 209, 0.04) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background-image: 
    radial-gradient(ellipse at top left, rgba(127, 181, 176, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(232, 131, 155, 0.04) 0%, transparent 50%);
}

a { 
  color: var(--mint-dark); 
  text-decoration: none; 
  transition: color 0.2s ease;
}
a:hover { color: var(--pink); }

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

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.masthead {
  padding: 12px 0 8px;
  text-align: center;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.masthead-title {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.2s ease;
}
.masthead-title:hover { 
  color: var(--mint); 
  text-decoration: none; 
}

.masthead-sub {
  margin-top: 4px;
  font-style: italic;
  color: var(--muted);
  font-size: 12px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
}

.nav { 
  display: flex; 
  gap: 24px; 
}
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.nav a:hover { 
  color: var(--mint-dark); 
  text-decoration: none; 
}
.nav a.active { 
  color: var(--mint-dark); 
  border-bottom-color: var(--mint); 
}

.header-actions { 
  margin-left: auto; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

/* Search */
.search-box { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}
.search {
  width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}
.search:focus { 
  border-color: var(--mint); 
  width: 220px;
  box-shadow: 0 0 0 3px rgba(127, 181, 176, 0.1);
}

.search-mode {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.search-mode-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.search-mode-btn + .search-mode-btn { 
  border-left: 1px solid var(--border); 
}
.search-mode-btn:hover:not(.active) { 
  color: var(--ink); 
  background: var(--bg-hover);
}
.search-mode-btn.active { 
  background: var(--mint); 
  color: white; 
}

/* Theme toggle */
.icon-btn {
  min-width: 36px; 
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.2s ease;
}
.icon-btn:hover { 
  border-color: var(--mint); 
  color: var(--mint-dark);
}

/* ---------- Layout ---------- */
main { 
  padding: 24px 0 80px; 
  min-height: calc(100vh - 160px); 
}

/* Section title */
.section-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 40px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.section-title .count {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- Front page: lead headline ---------- */
.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mint-dark);
  margin-bottom: 10px;
}

a.post-link { 
  color: var(--ink); 
  text-decoration: none; 
  display: block; 
}
a.post-link:hover .item-title { 
  color: var(--mint-dark); 
}

.dateline {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.dateline::before { content: "— "; }

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

/* Article list */
.front-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.front-grid .post-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}
.front-grid .post-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--mint-light);
}

.item-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 8px;
}
.item-title .lock-chip { 
  vertical-align: middle; 
  margin-left: 8px; 
  font-size: 10px; 
}

.item-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.tag:hover { 
  text-decoration: none; 
  border-color: var(--mint); 
  color: var(--mint-dark);
  background: var(--mint-light);
}

.tag-cloud { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  margin-top: 16px; 
}
.tag-cloud .tag { 
  font-size: 14px; 
  padding: 8px 16px; 
  cursor: pointer; 
}
.tag-cloud .tag .tcount { 
  opacity: 0.6; 
  margin-left: 4px; 
  font-size: 12px; 
}

/* ---------- Article detail ---------- */
.post-header {
  max-width: var(--readw);
  margin: 0 auto 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.post-header .dateline { 
  margin-bottom: 12px; 
}
.post-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  margin: 12px 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.post-header .pc-tags { 
  justify-content: center; 
}

.post-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}
.post-meta span + span::before { 
  content: "·"; 
  margin: 0 8px; 
  color: var(--border); 
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.back-link:hover { 
  color: var(--mint-dark); 
  background: var(--bg-hover);
}

/* Article body */
.article {
  max-width: var(--readw);
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
}

.article h1, .article h2, .article h3, .article h4, .article h5, .article h6 {
  font-family: var(--serif);
  line-height: 1.3;
  margin: 2em 0 0.8em;
  font-weight: 700;
  scroll-margin-top: 80px;
}
.article h2 { 
  font-size: 1.6em; 
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
.article h3 { font-size: 1.3em; }
.article p { margin: 1.2em 0; }
.article img { 
  max-width: 100%; 
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

/* Blockquote */
.article blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 4px solid var(--mint);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-style: italic;
}

.article ul, .article ol { 
  padding-left: 1.8em; 
  margin: 1em 0;
}
.article li { margin: 0.5em 0; }

.article code {
  font-family: var(--mono);
  background: var(--code-bg);
  padding: 2px 6px;
  font-size: 0.9em;
  border-radius: 4px;
}

/* Code block */
.article pre {
  position: relative;
  background: var(--code-bg);
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
}
.article pre code { 
  background: none; 
  padding: 0; 
  font-size: 14px; 
  line-height: 1.6;
}

.article table { 
  width: 100%; 
  border-collapse: collapse; 
  margin: 1.5em 0; 
}
.article th, .article td { 
  border: 1px solid var(--border); 
  padding: 10px 14px; 
  text-align: left; 
}
.article th { 
  background: var(--bg); 
  font-weight: 600;
}

/* Ornamental hr */
.article hr {
  border: none;
  text-align: center;
  margin: 2.5em 0;
  height: auto;
}
.article hr::after {
  content: "· · ·";
  letter-spacing: 0.5em;
  color: var(--muted);
  font-size: 14px;
}

/* Tag bar */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--readw);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

/* Prev/next navigation */
.post-nav {
  max-width: var(--readw);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}
.post-nav a {
  color: var(--ink-soft);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.post-nav a:hover { 
  color: var(--mint-dark); 
  border-color: var(--mint);
  background: var(--bg);
}
.post-nav .nav-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.post-nav .nav-title {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-nav .nav-next { text-align: right; }

/* ---------- About ---------- */
.about { 
  max-width: var(--readw); 
  margin: 0 auto; 
}
.about h1 { 
  font-family: var(--serif); 
  font-size: 32px; 
  margin-top: 0; 
}
.about .avatar-img {
  width: 120px; 
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 24px;
  border: 3px solid var(--mint-light);
  box-shadow: var(--shadow);
}
.about p { 
  font-size: 16px; 
  line-height: 1.8;
}

/* ---------- Links ---------- */
.links { 
  max-width: 880px; 
  margin: 0 auto; 
}
.links .section-title {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}
.friend-card:hover {
  border-color: var(--mint);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.friend-avatar {
  width: 60px; 
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid var(--border-light);
}
.friend-avatar--text {
  display: flex; 
  align-items: center; 
  justify-content: center;
  background: var(--mint); 
  color: white;
  font-family: var(--serif); 
  font-size: 24px; 
  font-weight: 700;
}

.friend-meta { min-width: 0; }
.friend-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
}
.friend-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.site-footer .muted { 
  font-size: 13px; 
  margin-top: 8px;
}
.site-footer code { 
  font-family: var(--mono); 
  background: var(--code-bg); 
  padding: 2px 6px; 
  border-radius: 4px;
}

.empty { 
  text-align: center; 
  color: var(--muted); 
  padding: 60px 0; 
}

/* ---------- Encrypted articles ---------- */
.lock-chip {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pink);
  border: 1px solid var(--pink);
  padding: 2px 8px;
  border-radius: 12px;
}

.lock-box {
  max-width: 480px;
  margin: 48px auto;
  padding: 40px 32px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}
.lock-box .lock-icon { 
  margin-bottom: 16px; 
  color: var(--pink); 
}
.lock-box .lock-icon svg { 
  width: 48px; 
  height: 48px; 
}
.lock-box p { 
  color: var(--muted); 
  margin: 0 0 20px; 
}

.lock-form { 
  display: flex; 
  gap: 12px; 
  justify-content: center; 
  flex-wrap: wrap; 
}
.lock-form input[type="password"] {
  flex: 1 1 240px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}
.lock-form input[type="password"]:focus { 
  border-color: var(--mint); 
  box-shadow: 0 0 0 3px rgba(127, 181, 176, 0.1);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--mint);
  color: white;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover { 
  background: var(--mint-dark); 
  transform: translateY(-1px);
}

.lock-err { 
  margin-top: 16px; 
  min-height: 20px; 
  color: var(--pink); 
  font-size: 14px; 
}

/* ---------- Enhancements ---------- */
::selection { 
  background: var(--mint-light); 
  color: var(--ink);
}

* { 
  scrollbar-width: thin; 
  scrollbar-color: var(--border) transparent; 
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { 
  background: var(--border); 
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover { 
  background: var(--muted); 
}

/* Reading progress */
.reading-progress {
  position: fixed; 
  top: 0; 
  left: 0; 
  height: 3px; 
  width: 0;
  background: linear-gradient(90deg, var(--mint), var(--pink));
  z-index: 200; 
  transition: width 0.1s linear;
  opacity: 0;
}
.reading-progress.show { opacity: 1; }

/* Back to top */
.to-top {
  position: fixed; 
  right: 24px; 
  bottom: 24px; 
  z-index: 100;
  width: 44px; 
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card); 
  color: var(--ink);
  cursor: pointer; 
  font-size: 18px; 
  box-shadow: var(--shadow);
  opacity: 0; 
  transform: translateY(12px); 
  pointer-events: none;
  transition: all 0.3s ease;
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.to-top.show { 
  opacity: 1; 
  transform: translateY(0); 
  pointer-events: auto; 
}
.to-top:hover { 
  color: var(--mint-dark); 
  border-color: var(--mint);
  transform: translateY(-2px);
}

/* Fade animation */
.fade { 
  animation: fadeIn 0.4s ease; 
}
@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(12px); } 
  to { opacity: 1; transform: none; } 
}

#app.leaving { 
  animation: fadeOut 0.25s ease forwards; 
}
@keyframes fadeOut { 
  from { opacity: 1; transform: translateY(0); } 
  to { opacity: 0; transform: translateY(-8px); } 
}

#app { min-height: calc(100vh - 200px); }

/* Code copy button */
.code-copy {
  position: absolute; 
  top: 12px; 
  right: 12px;
  font-size: 12px; 
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card); 
  color: var(--muted);
  cursor: pointer; 
  opacity: 0; 
  transition: all 0.2s ease;
}
.article pre:hover .code-copy { opacity: 1; }
.code-copy:hover { 
  color: var(--mint-dark); 
  border-color: var(--mint); 
}
.code-copy.done { 
  color: #10B981; 
  border-color: #10B981; 
}

/* ---------- TOC ---------- */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  align-items: start;
}
.post-main { min-width: 0; }
.post-layout .article { max-width: none; margin: 0; }

.toc-wrap {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.toc {
  padding-left: 4px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.toc::-webkit-scrollbar {
  width: 4px;
}
.toc::-webkit-scrollbar-track {
  background: transparent;
}
.toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.toc-title {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item { /* --lvl 由 JS 设置，控制缩进层级 */ }
.toc-link {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 6px 0 6px calc(12px + var(--lvl, 0) * 14px);
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}
.toc-link:hover { 
  color: var(--mint-dark); 
  text-decoration: none; 
}
.toc-link.active {
  color: var(--mint-dark);
  border-left-color: var(--mint);
  font-weight: 600;
}

.toc-toggle { display: none; }

/* TOC responsive */
@media (max-width: 920px) {
  .post-layout { 
    grid-template-columns: 1fr; 
    gap: 24px; 
  }
  .toc-wrap {
    position: static; 
    order: -1;
  }
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  .toc {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .toc-wrap.open .toc { 
    max-height: 60vh; 
    overflow-y: auto; 
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .masthead { padding: 10px 0 6px; }
  .masthead-title { font-size: 24px; }
  .masthead-top { font-size: 9px; }
  .masthead-sub { font-size: 11px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 6px 0; }
  .nav { order: 2; width: 100%; justify-content: center; gap: 14px; }
  .header-actions { order: 3; width: 100%; justify-content: center; }
  .search { width: 140px; }
  .search-mode-btn { padding: 6px 10px; }
  .post-header h1 { font-size: 26px; }
  .article { font-size: 15px; }
  .to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .post-nav { flex-direction: column; gap: 12px; }
  .post-nav .nav-next { text-align: left; }
  
  .front-grid .post-item { padding: 20px; }
}

/* ---------- GitHub Stats Widget ---------- */
.github-stats {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}
.github-stats h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.github-stats h3::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='2' y='1' width='12' height='14' fill='%237FB5B0'/%3E%3Crect x='3' y='2' width='10' height='12' fill='%23A8D5D1'/%3E%3Crect x='4' y='3' width='2' height='2' fill='%237FB5B0'/%3E%3Crect x='7' y='3' width='5' height='1' fill='%237FB5B0'/%3E%3Crect x='4' y='6' width='8' height='1' fill='%237FB5B0'/%3E%3Crect x='4' y='8' width='8' height='1' fill='%237FB5B0'/%3E%3Crect x='4' y='10' width='6' height='1' fill='%237FB5B0'/%3E%3Crect x='4' y='12' width='4' height='1' fill='%237FB5B0'/%3E%3C/svg%3E");
  background-size: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-item {
  text-align: center;
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--mint-dark);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contribution-graph {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 12px;
}
.contribution-graph img {
  width: 100%;
  height: auto;
  display: block;
}
.stats-loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Top Languages */
.top-languages {
  margin-top: 20px;
}
.top-languages h4 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lang-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lang-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lang-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lang-name {
  color: var(--ink);
  font-weight: 500;
}
.lang-pct {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.lang-bar-track {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.lang-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.stats-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.lightbox.active img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Welcome Splash (Watercolor) ---------- */
.welcome-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  background-image: url('../img/welcome-watercolor.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 1.2s ease,
              transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  transform: scale(1);
}
.welcome-splash::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}
.welcome-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.1);
}
/* 博客内容在欢迎页显示时模糊 */
body.splash-active .site-header,
body.splash-active main,
body.splash-active .site-footer {
  filter: blur(8px);
  opacity: 0;
  transition: filter 1.2s ease, opacity 1.2s ease;
}
body:not(.splash-active) .site-header,
body:not(.splash-active) main,
body:not(.splash-active) .site-footer {
  filter: blur(0);
  opacity: 1;
  transition: filter 1.2s ease 0.3s, opacity 1.2s ease 0.3s;
}
.welcome-content {
  text-align: center;
  animation: welcomeFadeIn 1.5s ease;
  position: relative;
  z-index: 10;
  padding: 40px;
}
@keyframes welcomeFadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-title {
  font-family: var(--serif);
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.welcome-title .accent {
  color: var(--mint);
  font-style: italic;
  position: relative;
}
.welcome-title .accent::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--mint), var(--pink));
  border-radius: 2px;
  animation: underlineGrow 1.5s ease 0.5s both;
}
@keyframes underlineGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.welcome-subtitle {
  font-size: clamp(20px, 4vw, 28px);
  color: var(--muted);
  font-style: italic;
  margin-bottom: 60px;
  letter-spacing: 0.05em;
  animation: subtitleFade 1.5s ease 0.3s both;
}
@keyframes subtitleFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.welcome-enter {
  display: inline-block;
  padding: 18px 60px;
  background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 8px 30px rgba(127, 181, 176, 0.4);
  position: relative;
  overflow: hidden;
  animation: buttonFade 1.5s ease 0.6s both;
}
@keyframes buttonFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-enter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.welcome-enter:hover {
  background: linear-gradient(135deg, var(--mint-dark) 0%, var(--mint) 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(127, 181, 176, 0.5);
}
.welcome-enter:hover::before {
  width: 300px;
  height: 300px;
}
.welcome-hint {
  margin-top: 40px;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.08em;
  animation: hintFloat 3s ease-in-out infinite;
}
@keyframes hintFloat {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* 水彩晕染粒子 */
.watercolor-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: dotFloat 8s ease-in-out infinite;
}
@keyframes dotFloat {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
    opacity: 0;
  }
  25% { opacity: 0.3; }
  50% { 
    transform: translate(30px, -30px) scale(1.2); 
    opacity: 0.2;
  }
  75% { opacity: 0.3; }
}

/* ========== 团子宠物 - 单图方案 ==========
   使用完整抠图，不再分层
=============================================== */

/* 宠物容器 - 固定在右下角，可拖拽 */
.tuanzi {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.tuanzi:active,
.tuanzi.dragging {
  cursor: grabbing;
}

/* 团子图片 */
.tuanzi-img {
  width: 180px;
  height: auto;
  display: block;
  animation: tz-float 3s ease-in-out infinite;
  transition: transform 0.15s ease;
}
@keyframes tz-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.tuanzi.dragging .tuanzi-img {
  animation-play-state: paused;
}

/* 戳戳弹跳 */
.tuanzi-img.poke {
  animation: tz-poke 0.45s ease !important;
}
@keyframes tz-poke {
  0%   { transform: scale(1, 1); }
  20%  { transform: scale(1.08, 0.92); }
  40%  { transform: scale(0.94, 1.06); }
  60%  { transform: scale(1.03, 0.97); }
  80%  { transform: scale(0.99, 1.01); }
  100% { transform: scale(1, 1); }
}

/* 拖拽时压扁 */
.tuanzi.dragging .tuanzi-img {
  transform: scale(1.05, 0.95);
}

/* 糯糯气泡 */
.tz-bubble {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: var(--bg-card);
  border: 2px solid var(--mint);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(232,131,155,0.18);
  z-index: 10;
}
.tz-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--mint);
}
.tz-bubble.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* 糯糯飘字粒子 */
.tz-nuo {
  position: absolute;
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  pointer-events: none;
  z-index: 10000;
  animation: tz-nuo-rise 1s ease-out forwards;
}
@keyframes tz-nuo-rise {
  0%   { opacity: 1; transform: translateY(0) scale(0.4); }
  60%  { opacity: 0.8; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.6); }
}

/* 小屏适配 */
@media (max-width: 640px) {
  .tuanzi-img { width: 140px; }
  .tuanzi { right: 12px; bottom: 12px; }
}

/* ---------- Comment System ---------- */
.comment-section {
  max-width: var(--readw);
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.comment-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.comment-count {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.comment-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}
.comment-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.comment-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.comment-input-row input:focus {
  border-color: var(--mint);
}
.comment-content {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.comment-content:focus {
  border-color: var(--mint);
}
.comment-submit {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--mint);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.comment-submit:hover {
  background: var(--mint-dark);
}
.comment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.comment-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--pink));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.comment-body {
  flex: 1;
  min-width: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.comment-nick {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.comment-date {
  font-size: 12px;
  color: var(--muted);
}
.comment-text {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.comment-empty,
.comment-error {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 14px;
}
.comment-error {
  color: var(--pink);
}
@media (max-width: 640px) {
  .comment-input-row {
    flex-direction: column;
  }
}
