/* ═══════════════════════════════════════════════
   Forgiving Blog — Warm Glass Editorial Theme
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --theme: transparent;
  --entry: rgba(255, 255, 255, 0.72);
  --primary: #f97316;
  --primary-rgb: 249, 115, 22;
  --secondary: #78716c;
  --tertiary: #fed7aa;
  --content: #292524;
  --border: rgba(231, 229, 228, 0.6);
  --code-block-bg: #1e1e2e;
  --code-bg: #fffbeb;
  --glass-blur: 16px;
  --glass-saturation: 1.4;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 16px 60px rgba(0, 0, 0, 0.12);
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ── Typography Base ── */
body, html {
  font-family: var(--font-sans) !important;
  background: url('https://pub-4d19ac99c083403ebd4ce5378906a944.r2.dev/mingchao/BHIBGHEEJDEEJ-PavQeEqEwm.png') no-repeat center center fixed !important;
  background-size: cover !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Background Layers ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg,
    rgba(255, 247, 237, 0.85) 0%,
    rgba(253, 242, 248, 0.82) 50%,
    rgba(254, 243, 235, 0.85) 100%
  );
  z-index: -2;
  pointer-events: none;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  animation: grainShift 8s steps(10) infinite;
}

/* ── Main Content Container ── */
.main {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2rem auto;
  max-width: 920px;
  box-shadow: var(--shadow-medium);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  animation: fadeScaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Header / Nav ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(231, 229, 228, 0.4);
  transition: all 0.3s ease;
}

header nav {
  max-width: 920px;
  margin: 0 auto;
}

header nav a {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), #fb923c);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header nav a:hover::after {
  width: 100%;
}

header nav a:hover {
  color: var(--primary) !important;
}

/* ═══════════════════════════════════════════════
   HOMEPAGE
   ═══════════════════════════════════════════════ */

/* ── Hero Section ── */
.home-hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  background: linear-gradient(135deg,
    rgba(249, 115, 22, 0.06) 0%,
    rgba(251, 146, 60, 0.04) 50%,
    rgba(244, 114, 182, 0.06) 100%
  );
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(249, 115, 22, 0.08);
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Animated gradient orbs */
.home-hero::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat1 12s ease-in-out infinite;
  filter: blur(40px);
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -15%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat2 15s ease-in-out infinite;
  filter: blur(40px);
}

/* ── Avatar ── */
.hero-avatar {
  display: block;
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 3px solid transparent;
  background-image: linear-gradient(white, white), linear-gradient(135deg, #f97316, #f472b6);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 4px 20px rgba(249, 115, 22, 0.2),
    0 0 0 0 rgba(249, 115, 22, 0);
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeScaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  padding: 0;
  cursor: pointer;
}

.hero-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hero-avatar:focus-visible,
.gallery-card:focus-visible,
.share-buttons button:focus-visible,
.gallery-lightbox button:focus-visible,
.avatar-modal button:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 4px;
}

.hero-avatar:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow:
    0 8px 40px rgba(249, 115, 22, 0.35),
    0 0 0 6px rgba(249, 115, 22, 0.1);
}

/* Avatar Modal */
.avatar-modal {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; visibility: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.avatar-modal.active { opacity: 1; visibility: visible; }
.avatar-modal-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.avatar-modal.active .avatar-modal-img { transform: scale(1); }
.avatar-modal-close {
  position: absolute; top: 20px; right: 30px;
  font-size: 3rem; color: #fff;
  cursor: pointer; transition: color 0.2s; line-height: 1;
  width: 52px; height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
}
.avatar-modal-close:hover { color: var(--primary); }

/* ── Hero Typography ── */
.home-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 40%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.8rem;
  position: relative; z-index: 1;
  letter-spacing: -0.02em;
  line-height: 1.3;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.home-hero p {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--secondary);
  max-width: 500px;
  margin: 0 auto;
  position: relative; z-index: 1;
  line-height: 1.7;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

/* ── Skill Tags ── */
.skill-tags {
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  position: relative; z-index: 1;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.skill-tag {
  display: inline-flex; align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(249, 115, 22, 0.15);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  color: var(--content);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-tag:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.18);
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary);
}

/* ── Stats Section ── */
.stats-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.stat-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c, #f472b6);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-item:hover {
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.1);
}

.stat-item:hover::before { opacity: 1; }

.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--secondary);
  margin-top: 0.4rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Section Titles ── */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--content);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: linear-gradient(180deg, #f97316, #f472b6);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ── Posts Grid ── */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Post Card — Glass Style */
.post-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }

/* Gradient top border on hover */
.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c, #f472b6);
  opacity: 0;
  transition: opacity 0.35s;
}

/* Subtle glow on hover */
.post-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(249, 115, 22, 0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(249, 115, 22, 0.1), 0 4px 16px rgba(0, 0, 0, 0.04);
  border-color: rgba(249, 115, 22, 0.25);
  background: rgba(255, 255, 255, 0.78);
}

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

.post-card .card-meta {
  display: flex; align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  font-size: 0.78rem;
  color: var(--secondary);
  font-family: var(--font-sans);
}

.post-card .card-category {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary);
  text-transform: uppercase;
}

.post-card h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.post-card h2 a {
  color: var(--content);
  text-decoration: none;
  transition: color 0.25s;
}

.post-card h2 a:hover { color: var(--primary); }

.post-card .card-desc {
  font-size: 0.88rem;
  color: var(--secondary);
  margin-bottom: 1rem;
  flex: 1;
  line-height: 1.7;
  font-family: var(--font-sans);
}

.post-card .card-tags {
  display: flex; flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.post-card .card-tag {
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(254, 215, 170, 0.4);
  color: var(--content);
  text-decoration: none;
  transition: all 0.25s;
  border: 1px solid rgba(249, 115, 22, 0.08);
}

.post-card .card-tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.post-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card .card-link:hover {
  gap: 0.8rem;
  letter-spacing: 0.02em;
}

/* ── View More Button ── */
.view-more {
  text-align: center;
  margin-top: 2.5rem;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.view-more a {
  display: inline-flex; align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  text-decoration: none;
  padding: 0.7rem 1.8rem;
  border: 2px solid var(--primary);
  border-radius: 30px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.view-more a::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.1), transparent);
  transition: left 0.5s;
}

.view-more a:hover::before { left: 100%; }

.view-more a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.25);
}

/* ── Tags Cloud ── */
.tags-cloud {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.tags-cloud a {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  color: var(--content);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tags-cloud a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.2);
}

/* ── Footer Links ── */
.footer-links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.footer-link-item {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--content);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.footer-link-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c, #f472b6);
  opacity: 0;
  transition: opacity 0.3s;
}

.footer-link-item:hover {
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.footer-link-item:hover::before { opacity: 1; }

.footer-link-item .link-icon {
  font-size: 1.8rem;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-link-item:hover .link-icon {
  transform: scale(1.2) translateY(-3px);
}

/* ═══════════════════════════════════════════════
   POST / ARTICLE PAGES
   ═══════════════════════════════════════════════ */

.post-entry, .single-content, .page-content {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #1a1a1a !important;
  border-radius: var(--radius-md);
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.post-entry p, .single-content p, .page-content p,
.post-entry li, .single-content li, .page-content li {
  color: #1a1a1a;
  line-height: 1.9;
  font-family: var(--font-sans);
  font-size: 1.02rem;
}

.post-entry h1, .post-entry h2, .post-entry h3,
.single-content h1, .single-content h2, .single-content h3 {
  font-family: var(--font-serif);
  color: #0f0f0f;
  letter-spacing: -0.02em;
}

/* ── Post Title ── */
.post-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 40%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* ── Post Meta ── */
.post-meta {
  color: var(--secondary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Post Content ── */
.post-content { color: #1a1a1a; }

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f0f0f;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  letter-spacing: -0.01em;
  position: relative;
}

.post-content h2::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, #f472b6, transparent);
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 1.8rem 0 0.8rem;
}

.post-content p {
  margin-bottom: 1.3rem;
  text-align: justify;
  color: #1a1a1a;
}

.post-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(249, 115, 22, 0.4);
  transition: all 0.25s;
  font-weight: 500;
}

.post-content a:hover {
  color: #ea580c;
  border-bottom-style: solid;
  border-bottom-color: #ea580c;
}

/* ── Blockquote ── */
.post-content blockquote {
  margin: 1.8rem 0;
  padding: 1.2rem 1.8rem;
  background: linear-gradient(135deg,
    rgba(249, 115, 22, 0.04) 0%,
    rgba(244, 114, 182, 0.04) 100%
  );
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: #2d2d2d;
  font-style: italic;
  font-family: var(--font-serif);
  position: relative;
}

.post-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -10px; left: 12px;
  font-size: 3rem;
  color: rgba(249, 115, 22, 0.15);
  font-family: var(--font-serif);
  line-height: 1;
}

/* ── Lists ── */
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.9;
  color: #1a1a1a;
}

.post-content ul li::marker { color: var(--primary); }
.post-content ol li::marker { color: var(--primary); font-weight: 700; }

/* ── Images ── */
.post-content img {
  border-radius: var(--radius-md);
  margin: 1.8rem 0;
  box-shadow: var(--shadow-medium);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-strong);
}

/* ── Tables ── */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-sans);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.post-content th {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: white;
  padding: 0.9rem 1.2rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.post-content td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.post-content tr:hover td {
  background: rgba(249, 115, 22, 0.03);
}

/* ── Code Blocks ── */
pre, .highlight, .highlight pre, .post-content .highlight, .chroma {
  background: #1e1e2e !important;
  border-radius: var(--radius-md);
  padding: 1.3rem !important;
  margin: 1.8rem 0;
  overflow-x: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
  position: relative;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

.post-content code {
  background: rgba(249, 115, 22, 0.08);
  color: #c2410c;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid rgba(249, 115, 22, 0.1);
}

pre code, .highlight code, .chroma code, .highlight pre code {
  background: transparent !important;
  color: #e2e8f0 !important;
  padding: 0;
  border-radius: 0;
  border: none;
  font-weight: 400;
}

/* ── Table of Contents ── */
.details .toc {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.8rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-soft);
}

.details .toc summary {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--primary);
  padding: 0.5rem 0;
  font-size: 1rem;
  cursor: pointer;
}

.details .toc ul {
  list-style: none;
  padding-left: 0;
}

.details .toc li {
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  transition: all 0.25s;
  padding-left: 1rem;
  font-size: 0.92rem;
}

.details .toc li:hover {
  border-left-color: var(--primary);
  color: var(--primary);
  padding-left: 1.2rem;
}

/* ── Post Footer & Tags ── */
.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-tags a {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  margin: 0.2rem;
  transition: all 0.25s;
  border: 1px solid rgba(249, 115, 22, 0.1);
}

.post-tags a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

/* ── Horizontal Rule ── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  margin: 2.5rem 0;
  opacity: 0.4;
}

/* ── Scroll to Top ── */
.top-link {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  opacity: 0; visibility: hidden;
  transform: translateY(20px);
}

.top-link:not(.hidden) {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}

.top-link:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.4);
}

.top-link svg { width: 22px; height: 22px; }

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c, #f472b6);
  z-index: 9999;
  transition: width 0.1s;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* ── Search ── */
.search-toggle {
  color: var(--content) !important;
  transition: color 0.25s;
}
.search-toggle:hover { color: var(--primary) !important; }

/* ── Misc ── */
details[open] summary { color: var(--primary); }

.post-entry a:hover,
.single-content a:hover,
.page-content a:hover { color: #ea580c; }

/* ── Share Buttons ── */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  padding: 1.2rem 0;
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--border);
}

.share-buttons li {
  list-style: none;
  margin: 0;
}

.share-buttons li a,
.share-buttons li button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--content);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  cursor: pointer;
}

.share-buttons li a:hover,
.share-buttons li button:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.2);
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(249, 115, 22, 0.06);
}

.share-buttons li a svg,
.share-buttons li button svg {
  transition: transform 0.3s;
}

.share-buttons li a:hover svg,
.share-buttons li button:hover svg {
  transform: scale(1.1);
}

.share-wechat {
  position: relative;
  display: inline-block;
}

.wechat-qr {
  position: absolute;
  bottom: 50px;
  left: 50%;
  z-index: 100;
  min-width: 180px;
  padding: 12px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.wechat-qr[hidden] { display: none; }
.wechat-qr-label { margin-bottom: 8px; color: #666; font-size: 12px; font-weight: 500; }
.wechat-qr img { display: block; width: 150px; height: 150px; border-radius: 6px; }

/* ── Selection Color ── */
::selection {
  background: rgba(249, 115, 22, 0.2);
  color: #0f0f0f;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(249, 115, 22, 0.4); }

/* ═══════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════ */

html[data-theme="dark"] :root {
  --theme: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  --entry: rgba(46, 46, 51, 0.75);
  --primary: #fb923c;
  --secondary: #a8a29e;
  --tertiary: #78716c;
  --content: #e7e5e4;
  --border: rgba(68, 64, 60, 0.6);
}

html[data-theme="dark"] body {
  background: transparent !important;
}

html[data-theme="dark"] body::before {
  background: linear-gradient(135deg,
    rgba(28, 25, 23, 0.95) 0%,
    rgba(41, 37, 36, 0.92) 50%,
    rgba(28, 25, 23, 0.95) 100%
  ) !important;
}

html[data-theme="dark"] body::after {
  opacity: 0.15;
}

html[data-theme="dark"] .main {
  background: rgba(41, 37, 36, 0.8);
  border-color: rgba(68, 64, 60, 0.4);
}

html[data-theme="dark"] header {
  background: rgba(28, 25, 23, 0.85);
  border-bottom-color: rgba(68, 64, 60, 0.4);
}

html[data-theme="dark"] .home-hero {
  background: linear-gradient(135deg,
    rgba(249, 115, 22, 0.08) 0%,
    rgba(251, 146, 60, 0.06) 50%,
    rgba(244, 114, 182, 0.05) 100%
  );
  border-color: rgba(249, 115, 22, 0.1);
}

html[data-theme="dark"] .post-card,
html[data-theme="dark"] .stat-item,
html[data-theme="dark"] .footer-link-item {
  background: rgba(46, 46, 51, 0.6);
  border-color: rgba(68, 64, 60, 0.4);
}

html[data-theme="dark"] .post-card:hover {
  background: rgba(46, 46, 51, 0.8);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .skill-tag,
html[data-theme="dark"] .tags-cloud a {
  background: rgba(46, 46, 51, 0.6);
  border-color: rgba(68, 64, 60, 0.5);
}

html[data-theme="dark"] .post-entry,
html[data-theme="dark"] .single-content,
html[data-theme="dark"] .page-content {
  background: rgba(41, 37, 36, 0.9) !important;
  color: #e7e5e4 !important;
}

html[data-theme="dark"] .post-entry p,
html[data-theme="dark"] .single-content p,
html[data-theme="dark"] .page-content p,
html[data-theme="dark"] .post-content p,
html[data-theme="dark"] .post-entry li,
html[data-theme="dark"] .single-content li,
html[data-theme="dark"] .page-content li,
html[data-theme="dark"] .post-content li {
  color: #d6d3d1;
}

html[data-theme="dark"] .post-entry h1,
html[data-theme="dark"] .post-entry h2,
html[data-theme="dark"] .post-entry h3,
html[data-theme="dark"] .single-content h1,
html[data-theme="dark"] .single-content h2,
html[data-theme="dark"] .single-content h3,
html[data-theme="dark"] .post-content h1,
html[data-theme="dark"] .post-content h2,
html[data-theme="dark"] .post-content h3 {
  color: #fafaf9;
}

html[data-theme="dark"] .post-content code {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.15);
}

html[data-theme="dark"] .details .toc {
  background: rgba(46, 46, 51, 0.7);
  border-color: rgba(68, 64, 60, 0.4);
}

html[data-theme="dark"] .hero-avatar {
  background-image: linear-gradient(#292524, #292524), linear-gradient(135deg, #f97316, #f472b6);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .main {
    width: calc(100% - 2rem);
    padding: 1.5rem;
    margin: 1rem;
    border-radius: var(--radius-md);
  }

  body, html { background-attachment: scroll !important; }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .home-hero { padding: 2.5rem 1rem 2rem; }
  .home-hero h1 { font-size: 1.8rem; }
  .stat-number { font-size: 1.5rem; }
  .post-card { padding: 1.3rem; }
  .post-title { font-size: 1.8rem; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════
   IMAGE GALLERY
   ═══════════════════════════════════════════════ */

/* ── Gallery Header ── */
.gallery-header {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.gallery-subtitle {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--secondary);
  letter-spacing: 0.02em;
}

/* ── Rainbow Text ── */
.rainbow-text {
  background: linear-gradient(
    90deg,
    #f97316, #ef4444, #ec4899, #a855f7,
    #6366f1, #3b82f6, #06b6d4, #10b981,
    #f97316
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ── Gallery Grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0.5rem;
}

/* ── Gallery Card ── */
.gallery-card {
  position: relative;
  border-radius: var(--radius-lg);
  cursor: pointer;
  animation: fadeScaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-style: preserve-3d;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
}

.card-border-flow {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 4px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    #f97316, #ef4444, #ec4899, #a855f7,
    #6366f1, #3b82f6, #06b6d4, #10b981,
    #f97316
  );
  background-size: 100% 100%;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: borderRotate 4s linear infinite paused;
  transform-style: preserve-3d;
  will-change: transform;
}

.gallery-card:hover .card-border-flow {
  animation-play-state: running;
  box-shadow:
    0 0 30px rgba(249, 115, 22, 0.3),
    0 0 60px rgba(239, 68, 68, 0.15),
    0 0 100px rgba(168, 85, 247, 0.1);
}

.card-inner {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: calc(var(--radius-lg) - 3px);
  overflow: hidden;
  transition: background 0.3s;
}

/* ── Card Image ── */
.card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #1a1a1a;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.4s;
  display: block;
}

.gallery-card:hover .card-image {
  transform: scale(1.08);
  filter: brightness(1.05) saturate(1.1);
}

/* Glow overlay */
.card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(249, 115, 22, 0.15) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.gallery-card:hover .card-glow {
  opacity: 1;
}

/* ── Card Info ── */
.card-info {
  padding: 1.2rem 1.4rem;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.card-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--secondary);
  margin: 0;
  line-height: 1.6;
}

/* ── Gallery Empty ── */
.gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--secondary);
  font-family: var(--font-sans);
}

.gallery-empty code {
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   GALLERY LIGHTBOX
   ═══════════════════════════════════════════════ */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox.active .lightbox-content {
  transform: scale(1) translateY(0);
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  border: 3px solid transparent;
  background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
                    linear-gradient(135deg, #f97316, #ec4899, #6366f1, #06b6d4);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.lightbox-caption {
  text-align: center;
  padding: 1.2rem 1rem;
  color: #fff;
  font-family: var(--font-sans);
}

.lightbox-caption h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  background: linear-gradient(90deg, #f97316, #ec4899, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lightbox-caption p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  z-index: 2;
  width: 48px; height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(249, 115, 22, 0.6);
  transform: rotate(90deg) scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 52px; height: 52px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(249, 115, 22, 0.5);
  transform: translateY(-50%) scale(1.1);
}

/* ═══════════════════════════════════════════════
   GALLERY DARK MODE
   ═══════════════════════════════════════════════ */

html[data-theme="dark"] .card-inner {
  background: rgba(41, 37, 36, 0.92);
}

html[data-theme="dark"] .card-info {
  background: rgba(41, 37, 36, 0.95);
  border-top-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .card-desc {
  color: #a8a29e;
}

html[data-theme="dark"] .gallery-card:hover .card-border-flow {
  box-shadow:
    0 0 40px rgba(249, 115, 22, 0.25),
    0 0 80px rgba(239, 68, 68, 0.12),
    0 0 120px rgba(168, 85, 247, 0.08);
}

/* ═══════════════════════════════════════════════
   GALLERY RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .gallery-title { font-size: 2rem; }

  .lightbox-prev, .lightbox-next {
    width: 40px; height: 40px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .gallery-title { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
