/* ========== CSS Variables ========== */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --nav-bg: rgba(255,255,255,0.72);
  --text: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --archive-day: #d480a0;
  --pink: #f0a8c0;
  --pink-light: rgba(240,168,192,0.10);
  --pink-dim: rgba(240,168,192,0.15);
  --font-mono: 'Fira Code', Consolas, 'Courier New', monospace;
}

[data-theme='dark'] {
  --bg: #0f1115;
  --surface: #171a21;
  --nav-bg: rgba(23,26,33,0.72);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #2a2f3a;
  --primary: #60a5fa;
  --archive-day: rgba(245,180,200,0.65);
  --pink: #f5b8cc;
  --pink-light: rgba(245,184,204,0.08);
  --pink-dim: rgba(245,184,204,0.15);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('/image/bg.jpg') center/cover fixed no-repeat;
  color: var(--text);
  font-family: Lato, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

mark {
  background: #ffe08a;
  color: inherit;
  padding: 0.08em 0.4em;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.22);
}

[data-theme='dark'] mark {
  background: rgba(250, 204, 21, 0.38);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.45);
}

/* ========== Navigation ========== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 50px;
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s ease;
  white-space: nowrap;
  margin-right: auto;
}

.brand:hover {
  color: var(--pink);
  text-decoration: none;
}

.top-nav-links {
  position: relative;
  display: flex;
  gap: 0;
  font-size: 0.88rem;
  align-items: center;
  height: 100%;
  margin-right: 8px;
}

.nav-pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 30px;
  border-radius: 8px;
  background: var(--pink-dim);
  border: 1px solid rgba(240,168,192,0.15);
  pointer-events: none;
  z-index: 0;
  transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(-50%);
}

.top-nav-links > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
  z-index: 1;
}

.top-nav-links > a:hover {
  color: var(--text);
  text-decoration: none;
}

[data-theme='dark'] .top-nav-links > a:hover {
  color: var(--text);
}

.top-nav-links > a.nav-active {
  color: var(--text);
  font-weight: 600;
}

.top-nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  margin-right: 10px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.nav-toggle .icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ========== Search ========== */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.search-wrap:focus-within {
  border-color: var(--pink);
}

[data-theme='dark'] .search-wrap:focus-within {
  border-color: var(--pink);
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.search-icon:hover {
  color: var(--pink);
}

.search-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
}

.search-input {
  width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 0.88rem;
  cursor: pointer;
  transition: width 0.3s ease, padding 0.3s ease;
  flex-shrink: 0;
}

.search-expanded .search-input {
  width: 180px;
  padding: 6px 12px 6px 4px;
  cursor: text;
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(360px, 84vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  z-index: 40;
}

.search-results.open {
  display: block;
}

.search-item {
  display: block;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.search-item.active {
  background: var(--pink-light);
}

[data-theme='dark'] .search-item.active {
  background: var(--pink-light);
}

.search-item-title mark {
  background: rgba(240,168,192,0.2);
  box-shadow: none;
  padding: 0 2px;
  border-radius: 4px;
}

[data-theme='dark'] .search-item-title mark {
  background: rgba(245,184,204,0.25);
}

.search-tip {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  border-bottom: 1px solid var(--line);
}

.search-item:last-child {
  border-bottom: none;
}

.search-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== Theme Toggle ========== */
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--pink);
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.4s ease;
}

.theme-toggle:hover .icon {
  transform: rotate(90deg);
}

.icon-moon {
  display: none;
}

[data-theme='dark'] .icon-sun {
  display: none;
}

[data-theme='dark'] .icon-moon {
  display: block;
}

/* ========== Layout ========== */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.content {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeSlideUp 0.4s ease;
}

[data-theme='dark'] .content {
  background: rgba(23,26,33,0.78);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Post List Items ========== */
.post-item {
  position: relative;
  padding: 14px 14px;
  margin: 0 0 2px;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  /* 入场动画：初始隐藏，revealed 时渐入 */
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.2s ease, background 0.2s ease;
}

.post-item.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.post-item:hover {
  border-left-color: var(--pink);
  background: var(--pink-light);
}

[data-theme='dark'] .post-item:hover {
  background: var(--pink-light);
}

.post-item + .post-item {
  border-top: none;
}

.post-item h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.post-item h2 a {
  color: var(--text);
  font-weight: 500;
}

.post-item h2 a:hover {
  text-decoration: none;
  color: var(--pink);
}

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

.post-meta time {
  white-space: nowrap;
}

.post-meta-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid rgba(240,168,192,0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--pink);
  transition: background 0.2s ease;
}

.post-meta-tag:hover {
  background: var(--pink-light);
  text-decoration: none;
}

[data-theme='dark'] .post-meta-tag:hover {
  background: var(--pink-light);
}

.post-meta-time {
  color: var(--muted);
  font-size: 0.84rem;
}

.excerpt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

/* ========== Hero Section (首页全屏，无任何卡片样式) ========== */
.hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 50px);
  padding: 50px 20px 20px;
  text-align: center;
  overflow: hidden;
  animation: fadeSlideUp 0.6s ease;
}

.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  width: 100%;
}

/* ---- 顶部装饰线 + 菱形 ---- */
.hero-deco {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  opacity: 0.5;
}

.hero-deco-line {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.hero-deco-diamond {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  animation: spin 6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- 问候语（淡入上移） ---- */
.hero-greeting {
  margin: 0 0 10px;
  font-size: 1rem;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  letter-spacing: 0.35em;
  animation: greetingFade 0.8s ease 0.2s both;
}

@keyframes greetingFade {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- 站点标题（艺术衬线字体 + 暖金光影 + 三重动画） ---- */
.hero-title {
  margin: 0 0 6px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 4.2rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.15;
  letter-spacing: 0.06em;
  color: #f5d0d8;
  /* 粉色渐变 */
  background: linear-gradient(135deg, #f5b0c0 0%, #f8c8d8 40%, #f5d0e0 70%, #f0b8cc 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* 三重动画 */
  animation:
    titleFloat 5s ease-in-out infinite 0.6s,
    glowPulse 4.5s ease-in-out infinite alternate 1s,
    gradientShift 8s ease-in-out infinite alternate 0.3s;
}

/* ① 浮动 — 缓慢呼吸般的上下微动 */
@keyframes titleFloat {
  0%, 100% { transform: perspective(600px) rotateX(2deg) translateY(0); }
  50% { transform: perspective(600px) rotateX(2deg) translateY(-6px); }
}

/* ② 光晕脉动 — 烛光般明暗呼吸 */
@keyframes glowPulse {
  0% { filter: drop-shadow(0 2px 20px rgba(240, 168, 192, 0.12)) drop-shadow(0 0 50px rgba(200, 130, 160, 0.06)); }
  100% { filter: drop-shadow(0 2px 30px rgba(240, 168, 192, 0.30)) drop-shadow(0 0 90px rgba(200, 130, 160, 0.20)); }
}

/* ③ 渐变流动 — 暖金色泽缓缓漂移 */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero-title:hover {
  animation-duration: 2.5s, 2s, 4s; /* hover 时加快节奏 */
}

/* 装饰下划线 — 从中心渐显 */
.hero-title::after {
  content: '';
  display: block;
  margin: 10px auto 0;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 168, 192, 0.35), transparent);
  animation: decoLineReveal 1s ease 0.4s both;
}

@keyframes decoLineReveal {
  0% { width: 0%; opacity: 0; }
  100% { width: 60%; opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 540px) {
  .hero-title {
    font-size: 2.5rem;
    letter-spacing: 0.04em;
  }
}

/* ---- 打字区域 ---- */
.hero-typing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.typing-text {
  font-size: 1.25rem;
  color: rgba(245, 230, 208, 0.55);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.typing-cursor {
  display: inline-block;
  margin-left: 4px;
  font-size: 1.25rem;
  color: #93c5fd;
  font-weight: 200;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========== 浮动粒子装饰 ========== */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.particle-1 {
  width: 4px; height: 4px;
  top: 12%; left: 10%;
  background: rgba(147,197,253,0.5);
  animation: floatUp 8s ease-in-out infinite 0s;
}

.particle-2 {
  width: 6px; height: 6px;
  top: 28%; right: 15%;
  background: rgba(196,181,253,0.4);
  animation: floatUp 10s ease-in-out infinite 2s;
}

.particle-3 {
  width: 3px; height: 3px;
  top: 50%; left: 8%;
  background: rgba(240,171,252,0.5);
  animation: floatUp 7s ease-in-out infinite 4s;
}

.particle-4 {
  width: 5px; height: 5px;
  top: 70%; right: 10%;
  background: rgba(147,197,253,0.35);
  animation: floatUp 9s ease-in-out infinite 1s;
}

.particle-5 {
  width: 4px; height: 4px;
  top: 85%; left: 20%;
  background: rgba(196,181,253,0.4);
  animation: floatUp 11s ease-in-out infinite 3s;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  20% { opacity: 0.6; }
  80% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-60px) scale(1.2); }
}

/* ========== Scroll-down Arrow (固定在 Hero 底部) ========== */
.scroll-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 20px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: opacity 0.6s ease, transform 0.6s ease;
  opacity: 0;        /* 默认隐藏 */
  transform: translateY(6px);
  pointer-events: none;
}

.scroll-arrow.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: arrowBounce 2.2s ease-in-out infinite 1s;
}

.scroll-arrow.hide {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.scroll-arrow svg {
  transition: transform 0.3s ease;
}

.scroll-arrow.show:hover svg {
  transform: translateY(4px);
}

.scroll-arrow-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  opacity: 0.5;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

/* ========== 移动端适配 ========== */
@media (max-width: 540px) {
  .hero-section {
    min-height: calc(100vh - 50px);
    padding: 40px 16px 16px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .typing-text,
  .typing-cursor {
    font-size: 1rem;
  }
  .hero-deco-line {
    width: 28px;
  }
  .hero-divider-line {
    width: 20px;
  }
}

/* ========== Post List Section (首页文章列表) ========== */
.post-list-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  animation: none; /* 覆盖 .content 的 fadeSlideUp，避免闪烁 */
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.post-list-section.reveal {
  opacity: 1;
  transform: translateY(0);
}

[data-theme='dark'] .post-list-section {
  background: rgba(23,26,33,0.78);
}

/* ========== Post Page ========== */
.post-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.post-content {
  margin-top: 16px;
}

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

blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  color: var(--text);
}

blockquote p {
  margin: 0.4em 0;
}

[data-theme='dark'] blockquote {
  background: rgba(96, 165, 250, 0.12);
}

/* ========== Tables ========== */
.post-content table,
.content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.post-content thead,
.content thead {
  background: rgba(99, 110, 123, 0.06);
}

[data-theme='dark'] .post-content thead,
[data-theme='dark'] .content thead {
  background: rgba(255, 255, 255, 0.04);
}

.post-content th,
.content th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.post-content td,
.content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.post-content tr:last-child td,
.content tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr,
.content tbody tr {
  transition: background 0.15s ease;
}

.post-content tbody tr:hover,
.content tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

[data-theme='dark'] .post-content tbody tr:hover,
[data-theme='dark'] .content tbody tr:hover {
  background: rgba(96, 165, 250, 0.06);
}

/* ========== Category Page ========== */
.category-header {
  margin-bottom: 20px;
}

.category-back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.category-back:hover {
  color: var(--pink);
}

.category-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  border-color: var(--pink);
  box-shadow: 0 2px 12px rgba(240,168,192,0.15);
  text-decoration: none;
}

[data-theme='dark'] .category-card:hover {
  box-shadow: 0 2px 12px rgba(245,184,204,0.2);
}

.category-card-name {
  font-weight: 600;
  color: var(--text);
}

.category-card-count {
  font-size: 0.84rem;
  color: var(--muted);
}

/* ========== Tag Cloud ========== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tag-pill:hover {
  border-color: var(--pink);
  background: var(--pink-light);
  text-decoration: none;
}

[data-theme='dark'] .tag-pill:hover {
  background: var(--pink-light);
}

.tag-pill-count {
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: 2px;
}

/* ========== Category Page (Enhanced) ========== */
.cat-header {
  text-align: center;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.cat-header--single {
  text-align: left;
  padding-bottom: 20px;
}

.cat-header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.cat-header--single .cat-header-deco {
  justify-content: center;
}

.cat-header-line {
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}

.cat-header-diamond {
  font-size: 0.65rem;
  color: var(--muted);
  animation: archiveSpin 6s linear infinite;
}

.cat-title {
  margin: 0 0 6px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--text);
  background: linear-gradient(135deg, #f5b0c0, #f8c8d8, #f0b8cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: catTitleFade 0.8s ease;
}

.cat-header--single .cat-title {
  text-align: center;
}

@keyframes catTitleFade {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.cat-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  font-weight: 300;
}

.cat-header--single .cat-subtitle {
  text-align: center;
}

.cat-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
  text-decoration: none;
}

.cat-back:hover {
  color: var(--pink);
  text-decoration: none;
}

.cat-back-arrow {
  transition: transform 0.2s ease;
}

.cat-back:hover .cat-back-arrow {
  transform: translateX(-3px);
}

.cat-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 0.95rem;
}

/* Category Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px 18px;
  border: 1px solid rgba(240,168,192,0.15);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.cat-card:hover {
  border-color: var(--pink);
  box-shadow: 0 6px 20px rgba(240,168,192,0.15);
  transform: translateY(-4px);
  text-decoration: none;
}

[data-theme='dark'] .cat-card:hover {
  box-shadow: 0 6px 20px rgba(245,184,204,0.2);
}

.cat-card-icon {
  font-size: 0.8rem;
  color: rgba(240,168,192,0.3);
  margin-bottom: 2px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.cat-card:hover .cat-card-icon {
  color: var(--pink);
  transform: rotate(180deg);
}

.cat-card-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  transition: color 0.3s ease;
}

.cat-card:hover .cat-card-name {
  color: var(--pink);
}

.cat-card-count {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Single category: post list wrapper */
.cat-post-list {
  margin-top: 16px;
}

.cat-post-item .post-item {
  opacity: 1;
  transform: none;
}

/* ========== Tag Page (Enhanced) ========== */
.taglist-header {
  text-align: center;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.taglist-header--single {
  text-align: left;
  padding-bottom: 20px;
}

.taglist-header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.taglist-header--single .taglist-header-deco {
  justify-content: center;
}

.taglist-header-line {
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}

.taglist-header-diamond {
  font-size: 0.65rem;
  color: var(--muted);
  animation: archiveSpin 6s linear infinite;
}

.taglist-title {
  margin: 0 0 6px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--text);
  background: linear-gradient(135deg, #f5b0c0, #f8c8d8, #f0b8cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: taglistTitleFade 0.8s ease;
}

.taglist-header--single .taglist-title {
  text-align: center;
}

@keyframes taglistTitleFade {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.taglist-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  font-weight: 300;
}

.taglist-header--single .taglist-subtitle {
  text-align: center;
}

.taglist-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
  text-decoration: none;
}

.taglist-back:hover {
  color: var(--pink);
  text-decoration: none;
}

.taglist-back-arrow {
  transition: transform 0.2s ease;
}

.taglist-back:hover .taglist-back-arrow {
  transform: translateX(-3px);
}

.taglist-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 0.95rem;
}

/* Tag Cloud */
.taglist-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.taglist-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border: 1px solid rgba(240,168,192,0.2);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.taglist-pill:hover {
  border-color: var(--pink);
  background: rgba(240,168,192,0.06);
  color: var(--pink);
  box-shadow: 0 3px 12px rgba(240,168,192,0.12);
  transform: translateY(-2px);
  text-decoration: none;
}

[data-theme='dark'] .taglist-pill:hover {
  background: rgba(245,184,204,0.08);
  box-shadow: 0 3px 12px rgba(245,184,204,0.15);
}

.taglist-pill-hash {
  opacity: 0.4;
  font-weight: 300;
  margin-right: 1px;
}

.taglist-pill-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  transition: color 0.3s ease;
}

.taglist-pill:hover .taglist-pill-count {
  color: var(--pink);
}

/* Single tag: post list wrapper */
.taglist-post-list {
  margin-top: 16px;
}

.taglist-post-item .post-item {
  opacity: 1;
  transform: none;
}

/* Responsive for enhanced category/tag pages */
@media (max-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .cat-title,
  .taglist-title {
    font-size: 2rem;
  }
}

@media (max-width: 540px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .cat-title,
  .taglist-title {
    font-size: 1.6rem;
  }
  .cat-card {
    padding: 18px 14px 16px;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }
  .cat-card-icon {
    margin-bottom: 0;
  }
  .cat-card-name {
    font-size: 1rem;
  }
  .taglist-cloud {
    gap: 8px;
  }
  .taglist-pill {
    padding: 6px 14px;
    font-size: 0.88rem;
  }
  .cat-back,
  .taglist-back {
    font-size: 0.82rem;
  }
}

/* ========== Archive Page ========== */
.archive-header {
  text-align: center;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.archive-header-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.archive-header-line {
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}

.archive-header-diamond {
  font-size: 0.65rem;
  color: var(--muted);
  animation: archiveSpin 6s linear infinite;
}

@keyframes archiveSpin {
  to { transform: rotate(360deg); }
}

.archive-title {
  margin: 0 0 6px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--text);
  background: linear-gradient(135deg, #f5b0c0, #f8c8d8, #f0b8cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: archiveTitleFade 0.8s ease;
}

@keyframes archiveTitleFade {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.archive-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  font-weight: 300;
}

.archive-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 0.95rem;
}

/* Timeline */
.archive-timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 10px;
}


/* Year badge */
.archive-year {
  text-align: center;
  margin: 24px 0 10px -24px;
  padding: 0;
}

.archive-year-badge {
  display: inline-block;
  padding: 4px 20px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--pink);
  border: 1px solid rgba(240,168,192,0.25);
  border-radius: 999px;
  background: rgba(240,168,192,0.06);
  backdrop-filter: blur(4px);
}

/* Month divider */
.archive-month {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  padding-left: 0;
}

.archive-month-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(240,168,192,0.18), rgba(240,168,192,0.04));
}

.archive-month-label {
  font-size: 0.78rem;
  color: rgba(240,168,192,0.45);
  letter-spacing: 0.12em;
  white-space: nowrap;
  font-weight: 400;
}

/* Post item */
.archive-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px 10px 0;
  margin-bottom: 2px;
  border-radius: 8px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.archive-item:hover {
  background: var(--pink-dim);
  transform: translateX(4px);
}

.archive-item-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  flex-shrink: 0;
  padding-top: 2px;
}

.archive-item-day {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--archive-day);
}

.archive-item-month {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.archive-item-dot {
  position: relative;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  border: 2px solid rgba(240,168,192,0.25);
  background: var(--surface);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
}

.archive-item:hover .archive-item-dot {
  border-color: rgba(240,168,192,0.6);
  background: rgba(240,168,192,0.15);
  box-shadow: 0 0 12px rgba(240,168,192,0.2);
}

.archive-item-body {
  flex: 1;
  min-width: 0;
}

.archive-item-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.25s ease;
  display: block;
  line-height: 1.5;
}

.archive-item-title:hover {
  color: var(--pink);
  text-decoration: none;
}

.archive-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.archive-item-weekday {
  opacity: 0.6;
}

.archive-item-cat {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid rgba(240,168,192,0.18);
  border-radius: 999px;
  font-size: 0.7rem;
  color: rgba(240,168,192,0.55);
  transition: background 0.2s ease;
}

.archive-item-cat:hover {
  background: rgba(240,168,192,0.08);
}

/* Timeline mobile */
@media (max-width: 540px) {
  .archive-title {
    font-size: 2rem;
  }
  .archive-timeline {
    padding-left: 18px;
  }
  .archive-year {
    margin-left: -18px;
  }
  .archive-year-badge {
    font-size: 1.3rem;
    padding: 3px 16px;
  }
  .archive-item-day {
    font-size: 1.1rem;
  }
  .archive-item-date {
    min-width: 34px;
  }
  .archive-item {
    gap: 10px;
  }
}

/* ========== Prev/Next Navigation ========== */
.post-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.post-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-nav a:hover {
  border-color: var(--pink);
  box-shadow: 0 4px 14px rgba(240,168,192,0.15);
  transform: translateY(-2px);
  text-decoration: none;
}

[data-theme='dark'] .post-nav a:hover {
  box-shadow: 0 4px 14px rgba(245,184,204,0.2);
}

.post-nav .nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ========== Paginator ========== */
.pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination .page-number,
.pagination .extend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.pagination .page-number:hover,
.pagination .extend:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: var(--pink-light);
  box-shadow: 0 2px 8px rgba(240,168,192,0.12);
  text-decoration: none;
}

[data-theme='dark'] .pagination .page-number:hover,
[data-theme='dark'] .pagination .extend:hover {
  background: var(--pink-light);
  box-shadow: 0 2px 8px rgba(245,184,204,0.15);
}

.pagination .current {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(240,168,192,0.3);
}

[data-theme='dark'] .pagination .current {
  background: rgba(245,184,204,0.35);
  color: #e5e7eb;
  border-color: rgba(245,184,204,0.5);
  box-shadow: 0 2px 10px rgba(245,184,204,0.25);
}

/* ========== Footer ========== */
.site-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ========== Code Blocks ========== */
code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(99, 110, 123, 0.15);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

pre {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f3f4f6;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
}

pre code {
  padding: 0;
  background: transparent;
}

[data-theme='dark'] pre {
  background: #111827;
}

figure.highlight {
  position: relative;
  margin: 14px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.code-block-head {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.code-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.code-dot:hover {
  filter: brightness(0.8);
  transform: scale(1.15);
}

.code-dot-red { background: #ff5f57; }
.code-dot-yellow { background: #febc2e; }
.code-dot-green { background: #28c840; }

/* Collapsed state: hide code table */
figure.highlight.collapsed table {
  display: none;
}

figure.highlight.collapsed .code-copy-btn {
  display: none;
}

figure.highlight table {
  width: 100%;
  border-spacing: 0;
  margin: 0;
}

figure.highlight .gutter {
  width: 44px;
  color: var(--muted);
  background: rgba(99, 110, 123, 0.12);
  text-align: right;
  user-select: none;
}

figure.highlight .gutter pre,
figure.highlight .code pre {
  margin: 0;
  padding: 4px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

figure.highlight .code {
  background: #f3f4f6;
}

[data-theme='dark'] figure.highlight .code {
  background: #111827;
}

.code-copy-btn {
  position: absolute;
  top: 5px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.code-copy-btn svg {
  display: block;
}

figure.highlight:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
}

.code-copy-btn.is-done {
  color: #16a34a;
  opacity: 1;
}

[data-theme='dark'] .code-copy-btn:hover {
  background: rgba(148, 163, 184, 0.1);
}

[data-theme='dark'] .code-copy-btn.is-done {
  color: #4ade80;
}

/* ========== Syntax Highlight Tokens (Light) ========== */
.comment, .quote, .prolog, .doctype, .cdata {
  color: #6b7280;
}

.keyword, .selector-tag, .built_in, .builtin, .tag {
  color: #7c3aed;
}

.string, .attr-value, .symbol, .bullet {
  color: #16a34a;
}

.number, .literal {
  color: #d97706;
}

.title, .section, .function, .function .title, .title.function_ {
  color: #2563eb;
}

.variable, .template-variable, .attr-name, .property {
  color: #dc2626;
}

/* ========== Syntax Highlight Tokens (Dark) ========== */
[data-theme='dark'] .comment,
[data-theme='dark'] .quote,
[data-theme='dark'] .prolog,
[data-theme='dark'] .doctype,
[data-theme='dark'] .cdata {
  color: #9ca3af;
}

[data-theme='dark'] .keyword,
[data-theme='dark'] .selector-tag,
[data-theme='dark'] .built_in,
[data-theme='dark'] .builtin,
[data-theme='dark'] .tag {
  color: #a78bfa;
}

[data-theme='dark'] .string,
[data-theme='dark'] .attr-value,
[data-theme='dark'] .symbol,
[data-theme='dark'] .bullet {
  color: #4ade80;
}

[data-theme='dark'] .number,
[data-theme='dark'] .literal {
  color: #fbbf24;
}

[data-theme='dark'] .title,
[data-theme='dark'] .section,
[data-theme='dark'] .function,
[data-theme='dark'] .function .title,
[data-theme='dark'] .title.function_ {
  color: #60a5fa;
}

[data-theme='dark'] .variable,
[data-theme='dark'] .template-variable,
[data-theme='dark'] .attr-name,
[data-theme='dark'] .property {
  color: #f87171;
}

/* ========== Vue Code Switch Card ========== */
.md-code-switch-card {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.02);
  transition: box-shadow 0.3s ease;
}

.md-code-switch-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.09);
}

[data-theme='dark'] .md-code-switch-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

[data-theme='dark'] .md-code-switch-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

.md-code-switch-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 62px;
  height: 36px;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  background-image:
    radial-gradient(circle at 14px center, #ff5f57 5.5px, transparent 6px),
    radial-gradient(circle at 30px center, #febc2e 5.5px, transparent 6px),
    radial-gradient(circle at 46px center, #28c840 5.5px, transparent 6px);
  background-repeat: no-repeat;
}

[data-theme='dark'] .md-code-switch-header {
  background-color: rgba(17, 24, 39, 0.92);
  background-image:
    radial-gradient(circle at 14px center, #ff5f57 5.5px, transparent 6px),
    radial-gradient(circle at 30px center, #febc2e 5.5px, transparent 6px),
    radial-gradient(circle at 46px center, #28c840 5.5px, transparent 6px);
  background-repeat: no-repeat;
}

.md-code-switch-title {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.md-code-switch-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.md-code-switch-copy svg {
  display: block;
}

.md-code-switch-copy:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
}

[data-theme='dark'] .md-code-switch-copy:hover {
  background: rgba(148, 163, 184, 0.1);
}

.md-code-switch-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.md-code-switch-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.md-code-switch-tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme='dark'] .md-code-switch-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.md-code-switch-tab.active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

[data-theme='dark'] .md-code-switch-tab.active {
  background: rgba(255, 255, 255, 0.1);
}

.md-code-switch-pre {
  flex: 1;
  margin: 0;
  border: none;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

.md-code-switch-code {
  display: block;
  white-space: pre;
}

.md-code-switch-body {
  display: flex;
  align-items: stretch;
  background: #f8f9fa;
  transition: opacity 0.15s ease;
}

.md-code-switch-body.is-fading {
  opacity: 0;
}

[data-theme='dark'] .md-code-switch-body {
  background: #0d1117;
}

.md-code-switch-gutter {
  display: flex;
  flex-direction: column;
  min-width: 48px;
  padding: 12px 8px;
  text-align: right;
  user-select: none;
  color: var(--muted);
  border-right: 1px solid rgba(99, 110, 123, 0.08);
  background: rgba(99, 110, 123, 0.06);
}

[data-theme='dark'] .md-code-switch-gutter {
  background: rgba(255, 255, 255, 0.03);
  border-right-color: rgba(255, 255, 255, 0.06);
}

.md-code-switch-line-no {
  display: block;
  line-height: 1.7;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-feature-settings: 'liga' 1, 'calt' 1;
}

/* ========== Todo List ========== */
.todo-list-card {
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: box-shadow 0.2s ease;
}

.todo-list-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

[data-theme='dark'] .todo-list-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.todo-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.todo-list-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.todo-list-count {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--pink-light);
  padding: 1px 10px;
  border-radius: 999px;
}

.todo-list-badge {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 500;
  margin-left: auto;
}

.todo-list-progress-wrap {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.todo-list-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.3s ease;
}

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

.todo-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.todo-list-item:hover {
  background: var(--pink-light);
}

.todo-list-item + .todo-list-item {
  border-top: 1px solid var(--line);
}

.todo-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.todo-check svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  display: block;
}

.todo-check.checked {
  background: #16a34a;
  border-color: #16a34a;
}

.todo-text {
  font-size: 0.92rem;
  color: var(--text);
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.todo-list-item.done .todo-text {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-empty {
  text-align: center;
  color: var(--muted);
  padding: 20px 0;
  font-size: 0.9rem;
}

/* ========== Markdown Dividers ========== */
.md-divider-wrap {
  margin: 24px 0;
}

.md-divider__track {
  display: block;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  border-radius: 1px;
}

.md-divider--line .md-divider__track {
  background: var(--line);
}

.md-divider--dotted .md-divider__track {
  height: 0;
  background: none;
  border-top: 3px dotted var(--line);
}

.md-divider--fade .md-divider__track {
  background: linear-gradient(to right, var(--line), transparent);
}

.md-divider--ornate {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md-divider__ornate-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.md-divider__gem {
  color: var(--primary);
  font-size: 0.9rem;
}

.md-divider--labeled {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md-divider__arm {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.md-divider__label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ========== Image Card ========== */
.post-image {
  margin: 16px 0;
  text-align: center;
}

.post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.post-image img:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

[data-theme='dark'] .post-image img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .post-image img:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.post-image-caption {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ========== TOC Sidebar ========== */
.toc-sidebar {
  position: fixed;
  left: 20px;
  top: 80px;
  width: 220px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.84rem;
  z-index: 10;
}

.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.toc-sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.toc-sidebar ol,
.toc-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-sidebar ul ul,
.toc-sidebar ol ol {
  padding-left: 12px;
  margin-top: 2px;
}

.toc-sidebar li {
  margin: 3px 0;
  line-height: 1.5;
}

.toc-sidebar a {
  color: var(--muted);
  display: block;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toc-sidebar a:hover {
  color: var(--text);
  background: var(--pink-light);
  text-decoration: none;
}

.toc-sidebar a.active {
  color: var(--pink);
  font-weight: 500;
  text-decoration: none;
}

/* ========== Responsive: Tablet ========== */
@media (max-width: 768px) {
  .toc-sidebar {
    display: none;
  }

  .wrap {
    padding: 16px 12px 36px;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .post-content table,
  .content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .post-content th,
  .post-content td,
  .content th,
  .content td {
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ========== Responsive: Mobile ========== */
@media (max-width: 540px) {
  .top-nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
  }

  .brand {
    margin-right: 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .top-nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0 0;
    gap: 4px;
    height: auto;
    margin-right: 0;
  }

  .top-nav-links.open {
    display: flex;
  }

  .nav-pill {
    display: none;
  }

  .top-nav-links > a {
    width: 100%;
    justify-content: center;
    height: 40px;
  }

  .top-nav-group {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-left: 0;
    overflow: visible;
  }

  .top-nav-group.open {
    display: flex;
  }

  .search-wrap {
    width: 100%;
    direction: ltr;
  }

  .search-input {
    width: 100%;
    max-width: 100%;
    padding: 7px 34px 7px 12px;
    border-color: var(--line);
    cursor: text;
  }

  .search-icon {
    display: none;
  }

  .search-results {
    width: 100%;
  }

  #theme-toggle {
    margin-left: 0;
    align-self: flex-end;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav .nav-next {
    text-align: left;
  }

  .archive-timeline {
    padding-left: 18px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}
