/* ============================================
   琉光 Liuguang - Glassmorphism Theme for Halo 2
   ============================================ */

/* === CSS Variables === */
:root {
  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --glass-blur: blur(20px);

  /* Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #f472b6;
  --accent-light: #f9a8d4;
  --gradient-1: #667eea;
  --gradient-2: #764ba2;
  --gradient-3: #f093fb;

  /* Background */
  --bg-base: #0a0a1a;
  --bg-surface: #12122a;
  --bg-elevated: #1a1a3e;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-hover: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --bg-base: #eef2ff;
  --bg-surface: #f8fafc;
  --bg-elevated: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

img { max-width: 100%; height: auto; display: block; }

/* === Background Orbs === */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--gradient-1), transparent 70%);
  top: -10%; left: -5%;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--gradient-2), transparent 70%);
  top: 50%; right: -10%;
  animation-delay: -5s;
}

.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--gradient-3), transparent 70%);
  bottom: -5%; left: 30%;
  animation-delay: -10s;
}

.orb-4 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: 30%; left: 60%;
  animation-delay: -15s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

[data-theme="light"] .orb { opacity: 0.25; }

/* === Glass Card === */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: all var(--transition);
}

.site-header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-img { height: 32px; width: auto; border-radius: 8px; }

.header-nav .nav-list {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-item a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-item a:hover, .nav-item a.active {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.nav-item a.active { color: var(--primary-light); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Theme toggle icons */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-toggle { display: none; }

/* === Main Content === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px 24px 48px;
  min-height: 70vh;
}

/* === Hero Section === */
.hero-section { margin-bottom: 48px; text-align: center; }

.hero-content {
  padding: 56px 40px;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-3), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--gradient-2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
  color: var(--text-primary);
}

/* === Home Layout === */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  margin-bottom: 56px;
}

.home-layout.no-sidebar { grid-template-columns: 1fr; }

/* === Section Headers === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title svg { color: var(--primary-light); }

.section-more {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.section-more:hover { color: var(--primary-light); }

/* === Moment Cards === */
.moments-list { display: flex; flex-direction: column; gap: 20px; }

.moment-card { padding: 24px; }

.moment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.moment-avatar img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
}

.moment-meta { display: flex; flex-direction: column; }

.moment-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.moment-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.moment-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 14px;
  word-break: break-word;
}

.moment-content p { margin-bottom: 8px; }
.moment-content p:last-child { margin-bottom: 0; }

/* Media Grid */
.media-grid {
  display: grid;
  gap: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.media-count-1 { grid-template-columns: 1fr; }
.media-count-2 { grid-template-columns: 1fr 1fr; }
.media-count-3 { grid-template-columns: 1fr 1fr 1fr; }

.media-item { margin: 0; }

.moment-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}

.moment-img:hover { transform: scale(1.02); filter: brightness(1.1); }

.media-count-1 .moment-img { height: 280px; }

/* Moment Tags */
.moment-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.moment-tag {
  font-size: 0.78rem;
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
}

.moment-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all var(--transition);
}

.moment-like-btn:hover { color: var(--accent); background: rgba(244, 114, 182, 0.1); }
.moment-like-btn.liked { color: var(--accent); }

.moment-permalink a { color: var(--text-muted); }
.moment-permalink a:hover { color: var(--primary-light); }

/* === Sidebar === */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-card { padding: 24px; }
.sidebar-card:hover { transform: none; }

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

/* Author Card */
.author-card { text-align: center; }

.author-avatar img {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--glass-border);
  object-fit: cover;
}

.author-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.author-bio { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; }

.author-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 1.2rem; font-weight: 700; color: var(--primary-light); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* Latest Posts */
.latest-posts { list-style: none; }

.latest-posts li { margin-bottom: 12px; }
.latest-posts li:last-child { margin-bottom: 0; }

.latest-posts a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.latest-posts a:hover { color: var(--primary-light); }

.latest-post-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.latest-posts time { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-item {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.tag-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Quick Links */
.quick-links { display: flex; flex-direction: column; gap: 10px; }

.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.quick-link:hover { background: var(--glass-bg); color: var(--primary-light); }

/* === Posts Grid === */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card { overflow: hidden; }
.post-card:hover { transform: translateY(-4px); }

.post-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-cover img { transform: scale(1.05); }

.post-card-body { padding: 20px; }

.post-categories { display: flex; gap: 8px; margin-bottom: 10px; }

.post-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.post-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--primary-light); }

.post-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Latest Posts Section === */
.latest-posts-section { margin-top: 16px; }

/* === Page Hero === */
.page-hero {
  text-align: center;
  margin-bottom: 48px;
  padding: 40px 0;
}

.page-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gradient-1), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.page-desc { color: var(--text-secondary); font-size: 0.95rem; }

/* Moments Hero */
.moments-hero { padding: 56px 0 32px; }

.moments-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(244, 114, 182, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-light);
  margin-bottom: 16px;
  animation: heroFloat 3s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* === Timeline (Premium Time Flow) === */
.moments-timeline {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.timeline-container {
  position: relative;
  padding-left: 60px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--primary) 5%,
    var(--accent) 50%,
    var(--primary) 95%,
    transparent 100%);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3), 0 0 4px rgba(244, 114, 182, 0.2);
}

/* Month separator */
.timeline-month {
  margin: 48px 0 28px;
  position: relative;
}

.timeline-month::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
  border: 3px solid var(--bg-base);
}

.month-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(244, 114, 182, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

.month-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-light);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* Timeline item */
.timeline-item {
  position: relative;
  margin-bottom: 32px;
  animation: timelineSlideIn 0.5s ease both;
}

@keyframes timelineSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.timeline-dot {
  position: absolute;
  left: -42px;
  top: 32px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 3px solid var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4), inset 0 0 4px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
  z-index: 2;
}

.timeline-item:hover .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.7), 0 0 40px rgba(99, 102, 241, 0.3);
  transform: scale(1.3);
}

/* Connector line from dot to card */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 38px;
  width: 28px;
  height: 2px;
  background: linear-gradient(to right, var(--primary), transparent);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.timeline-item:hover::before {
  opacity: 0.8;
}

.timeline-item .moment-card {
  margin-left: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .moment-card {
  transform: translateX(4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.12), var(--glass-shadow);
}

/* Time indicator on card */
.timeline-item .moment-time {
  font-size: 0.72rem;
  color: var(--primary-light);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* === Post Detail === */
.post-detail { max-width: 900px; margin: 0 auto; }

.post-header { margin-bottom: 32px; }

.post-header-inner { padding: 40px; text-align: center; }

.post-detail-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.3;
  margin: 12px 0 16px;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.meta-dot { color: var(--text-muted); }

.post-detail-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.post-cover-full {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover-full img { width: 100%; max-height: 400px; object-fit: cover; }

.post-body-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.post-content {
  padding: 40px;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  margin: 1.5em 0 0.8em;
  font-weight: 700;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.5rem; padding-bottom: 8px; border-bottom: 1px solid var(--glass-border); }
.post-content h3 { font-size: 1.25rem; }

.post-content p { margin-bottom: 1.2em; }

.post-content img { border-radius: var(--radius-sm); margin: 1.5em 0; }

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--glass-bg);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary);
}

.post-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.88rem;
}

.post-content code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.88em;
}

.post-content :not(pre) > code {
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-light);
}

.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.post-content li { margin-bottom: 0.5em; }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.post-content th, .post-content td {
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  text-align: left;
}

.post-content th { background: var(--glass-bg); font-weight: 600; }

/* TOC */
.post-toc {
  position: sticky;
  top: 88px;
  padding: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }

.toc-content a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all var(--transition);
}

.toc-content a:hover, .toc-content a.active {
  color: var(--primary-light);
  border-left-color: var(--primary);
}

/* Post Navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.post-nav-item {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-nav-item.next { text-align: right; }

.nav-label { font-size: 0.78rem; color: var(--text-muted); }
.nav-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.post-nav-item:hover .nav-title { color: var(--primary-light); }

/* Comments */
.post-comments { margin-top: 40px; }
.comments-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

/* === Archives === */
.archives-container { max-width: 700px; margin: 0 auto; }

.archive-year { margin-bottom: 12px; }

.year-title {
  display: inline-block;
  padding: 8px 24px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-light);
}

.archive-month-group { margin-bottom: 24px; padding-left: 16px; }

.month-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.archive-list { list-style: none; }

.archive-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}

.archive-item:hover { background: var(--glass-bg); }

.archive-date { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; font-family: monospace; }
.archive-title { font-size: 0.9rem; color: var(--text-primary); }
.archive-item:hover .archive-title { color: var(--primary-light); }

/* === Tags Page === */
.tags-container { padding: 32px; max-width: 800px; margin: 0 auto; }

.tags-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.tag-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.tag-card:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.tag-name { font-size: 0.88rem; color: var(--text-primary); font-weight: 500; }
.tag-count { font-size: 0.75rem; color: var(--text-muted); }

/* === Categories Page === */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.category-card {
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.category-icon { color: var(--primary-light); margin-bottom: 4px; }
.category-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.category-count { font-size: 0.8rem; color: var(--text-muted); }

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.page-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.page-info { font-size: 0.85rem; color: var(--text-muted); }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 48px 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.footer-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.footer-social a:hover {
  color: var(--primary-light);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-meta a { color: var(--text-secondary); }
.footer-meta a:hover { color: var(--primary-light); }
.footer-sep { opacity: 0.5; }

/* Beian (备案) */
.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.beian-link:hover {
  color: var(--text-secondary);
  border-color: var(--glass-border);
  background: var(--glass-bg);
}

.beian-link svg { flex-shrink: 0; opacity: 0.7; }

.beian-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

/* === Search Overlay === */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.search-dialog {
  position: relative;
  width: 90%;
  max-width: 560px;
  padding: 8px;
  border-radius: 20px;
  transform: translateY(-20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.search-overlay.open .search-dialog {
  transform: translateY(0) scale(1);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}

.search-hint {
  padding: 10px 16px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.lightbox.active { display: flex; opacity: 1; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover { opacity: 1; }

/* === Error Page === */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.error-content { padding: 60px 40px; text-align: center; }

.error-code {
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gradient-1), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-title { font-size: 1.5rem; margin: 12px 0 8px; }
.error-desc { color: var(--text-secondary); margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* === Skeleton Loading === */
.skeleton-card { padding: 24px; margin-bottom: 20px; }

.skeleton-header { display: flex; gap: 12px; margin-bottom: 16px; }

.skeleton-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--glass-bg-hover);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--glass-bg-hover);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-body { display: flex; flex-direction: column; gap: 10px; }

.w-100 { width: 100%; } .w-80 { width: 80%; } .w-60 { width: 60%; }
.w-40 { width: 40%; } .w-25 { width: 25%; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* === Animations === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Empty State === */
.empty-state {
  padding: 60px 40px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg { margin: 0 auto 16px; opacity: 0.5; }

/* === Load More === */
.load-more-wrap { text-align: center; margin-top: 24px; }

/* === Responsive === */
@media (max-width: 1024px) {
  .home-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .post-body-layout { grid-template-columns: 1fr; }
  .post-toc { display: none; }
}

@media (max-width: 768px) {
  .main-content { padding: 76px 16px 32px; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .hero-content { padding: 36px 24px; }
  .post-content { padding: 24px; }
  .post-header-inner { padding: 28px 20px; }

  .header-nav { 
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px;
  }

  .header-nav.open { display: block; }

  .nav-list { flex-direction: column; }
  .nav-item a { padding: 12px 16px; }

  .menu-toggle { display: flex; }

  .timeline-container { padding-left: 36px; }
  .timeline-container::before { left: 12px; width: 2px; }
  .timeline-dot { left: -30px; width: 11px; height: 11px; }
  .timeline-item::before { left: -19px; width: 19px; top: 36px; }
  .timeline-month::before { left: -24px; width: 14px; height: 14px; }

  .moment-img { height: 160px; }
  .media-count-1 .moment-img { height: 200px; }
  .media-count-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .categories-grid { grid-template-columns: 1fr; }
  .media-count-2, .media-count-3 { grid-template-columns: 1fr; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* === Selection === */
::selection { background: rgba(99, 102, 241, 0.3); color: var(--text-primary); }

/* === Moment Comment System === */
.moment-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  margin-top: 14px;
}

.moment-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.moment-comment-btn:hover,
.moment-comment-btn.active {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

.moment-comment-btn .comment-count:not(:empty) {
  font-size: 0.72rem;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.moment-comments {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
  padding: 0 4px;
}

.moment-comments.open {
  max-height: 600px;
  opacity: 1;
  padding: 16px 4px 4px;
}

.comment-list {
  margin-bottom: 14px;
}

.comment-loading,
.comment-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: commentFadeIn 0.3s ease;
}

.comment-item:last-child { border-bottom: none; }

@keyframes commentFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar span {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-meta time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

/* Comment Form */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-inputs {
  display: flex;
  gap: 10px;
}

.comment-inputs input {
  flex: 1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comment-inputs input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.comment-textarea {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  resize: vertical;
  min-height: 60px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comment-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.comment-submit {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.comment-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.comment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* === Ripple Effect === */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: translate(-50%, -50%) scale(12); opacity: 0; }
}

.moment-like-btn {
  position: relative;
  overflow: hidden;
}

/* === Shake Animation === */
.shake {
  animation: shakeAnim 0.5s ease;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* === Card Tilt & Hover Enhancement === */
.moment-card {
  transition: transform 0.15s ease, box-shadow var(--transition);
  will-change: transform;
}

.moment-card:hover {
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15), var(--glass-shadow);
}

/* === Particle Canvas === */
#liuguang-particles {
  z-index: 0 !important;
}

.main-content,
.site-footer {
  position: relative;
  z-index: 1;
}

/* === Like Button Enhanced === */
.moment-like-btn.liked svg {
  fill: var(--accent);
  stroke: var(--accent);
  animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* === Loading Skeleton for Timeline === */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skeleton-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-hover) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-lines { flex: 1; }

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-hover) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

.skeleton-line.w-100 { width: 100%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-25 { width: 25%; }

.skeleton-body { margin-top: 8px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Responsive: Comments === */
@media (max-width: 640px) {
  .comment-inputs { flex-direction: column; }
  .moment-comments.open { max-height: 800px; }
}
