/* ============================================================
   Moe Minimal · Design: Minimalist + Subtle Anime Accent
   参考风格：靛蓝主色 #6366f1 + 粉色点缀 #f472b6
   - 主题主色 --primary 由后台设置注入（见模板 head 内联 style）
   - 暗色模式由 html[data-theme="dark"] 切换
   ============================================================ */

/* ===== Design Tokens ===== */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #f472b6;
  --accent-light: #f9a8d4;

  --bg: #fafafa;
  --bg-alt: #f5f5f7;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;

  --text: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;

  --transition-fast: 150ms ease;
  --transition: 250ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1200px;
  --content-width: 800px;
  --nav-height: 64px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --accent: #f472b6;
  --accent-light: #f9a8d4;

  --bg: #15151f;
  --bg-alt: #1c1c2a;
  --bg-card: #1e1e2e;
  --bg-elevated: #26263a;

  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #2d2d40;
  --border-light: #26263a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(129, 140, 248, 0.2);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
  color: var(--primary-dark);
}

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

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

.main-content {
  flex: 1;
}

::selection {
  background: var(--primary);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-slow);
}

html[data-theme="dark"] .navbar {
  background: rgba(21, 21, 31, 0.85);
}

.navbar.navbar-transparent {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.navbar.navbar-transparent .nav-logo,
.navbar.navbar-transparent .nav-links a {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar.navbar-transparent .nav-toggle span {
  background: white;
}

.navbar.navbar-transparent .nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar.navbar-transparent .user-dropdown .dropdown-item {
  color: var(--text-secondary);
  text-shadow: none;
}

.navbar.navbar-transparent .user-dropdown .dropdown-item.logout {
  color: #ef4444;
}

.navbar.navbar-transparent .user-avatar-btn {
  border-color: rgba(255, 255, 255, 0.6);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .navbar.scrolled {
  background: rgba(21, 21, 31, 0.95);
}

.navbar.scrolled .nav-logo,
.navbar.scrolled .nav-links a {
  color: var(--text);
  text-shadow: none;
}

.navbar.scrolled .nav-toggle span {
  background: var(--text);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.logo-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.logo-avatar-empty {
  border: 2px solid rgba(0, 0, 0, 0.2);
  background: transparent;
}

.navbar.navbar-transparent .logo-avatar-empty {
  border-color: rgba(255, 255, 255, 0.4);
}

.logo-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-avatar-fallback {
  font-size: 1.1rem;
  color: var(--primary);
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.nav-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  color: white !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

.nav-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark)) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.nav-color-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: inherit;
  transition: all var(--transition-fast);
}

.nav-color-btn:hover {
  background: rgba(99, 102, 241, 0.08);
}

.nav-color-btn .nav-color-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.nav-color-btn .nav-color-icon svg {
  transition: opacity 0.3s ease;
}

.nav-color-btn .icon-moon {
  display: none;
}

[data-theme="dark"] .nav-color-btn .icon-sun {
  display: none;
}

[data-theme="dark"] .nav-color-btn .icon-moon {
  display: block;
}

.nav-color-btn:hover .nav-color-icon {
  transform: rotate(15deg);
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.user-avatar-btn:hover {
  border-color: var(--primary);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  padding: 6px;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-shadow: none;
  transition: all var(--transition-fast);
}

.user-dropdown .dropdown-item:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.user-dropdown .dropdown-item.logout {
  color: #ef4444;
}

.user-dropdown .dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.navbar.navbar-transparent .nav-color-btn {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* 移动端菜单面板 */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 12px 24px 20px;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
}

.mobile-menu a:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  padding: 0 24px;
  animation: fadeIn 1s ease 0.3s forwards;
  opacity: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-title a {
  color: inherit;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.9;
  margin-bottom: 24px;
  font-weight: 300;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-kaomoji {
  font-size: 1.4rem;
  opacity: 0.85;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.95rem;
  opacity: 0.8;
}

.stat-divider {
  opacity: 0.5;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: white;
  opacity: 0.7;
  transition: opacity var(--transition);
  animation: scrollDown 2s ease infinite;
}

.scroll-indicator:hover {
  opacity: 1;
}

.scroll-arrow {
  display: block;
  width: 30px;
  height: 30px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
}

/* ===== Section & Pages ===== */
.posts-section {
  padding: 80px 0;
}

.page-section {
  padding: calc(var(--nav-height) + 60px) 0 80px;
  min-height: 60vh;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.page-header {
  text-align: center;
  margin-bottom: 48px;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.page-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ===== Featured Post ===== */
.post-featured {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 48px;
  transition: all var(--transition-slow);
  border: 1px solid var(--border);
}

.post-featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-featured-cover {
  display: block;
  overflow: hidden;
}

.post-featured-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-featured:hover .post-featured-cover img {
  transform: scale(1.02);
}

.post-featured-content {
  padding: 48px;
}

.post-featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

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

.post-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.post-featured-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.post-featured-title a {
  color: var(--text);
  transition: color var(--transition);
}

.post-featured-title a:hover {
  color: var(--primary);
}

.post-featured-summary {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
}

.read-more:hover {
  gap: 12px;
  color: var(--primary-dark);
}

/* ===== Posts Grid & Cards ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

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

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

@media (max-width: 640px) {
  .posts-grid-3 {
    grid-template-columns: 1fr;
  }
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.post-card-cover {
  display: block;
  margin: -32px -32px 24px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.post-card-cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-cover img {
  transform: scale(1.04);
}

.post-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-card-header time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--text);
  transition: color var(--transition);
}

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

.post-card-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-link {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.post-card-link:hover {
  color: var(--primary-dark);
  padding-left: 4px;
}

.post-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* 列表模式（单列） */
.post-list.post-list-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-list-column .post-card {
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
}

.post-list-column .post-card-cover {
  margin: 0;
  width: 260px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
}

.post-list-column .post-card-cover img {
  height: 100%;
  min-height: 180px;
}

@media (max-width: 768px) {
  .post-list-column .post-card {
    flex-direction: column;
  }

  .post-list-column .post-card-cover {
    width: 100%;
  }
}

/* ===== Tags ===== */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-alt);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}

.tag-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tag-chip sup {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== Archive ===== */
.archive {
  max-width: 800px;
  margin: 0 auto;
}

.archive-year {
  margin-bottom: 48px;
}

.year-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.year-label {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.year-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.archive-list {
  list-style: none;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.archive-item:hover {
  padding-left: 8px;
}

.archive-item time {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 100px;
  font-family: var(--font-mono);
}

.archive-item a {
  color: var(--text);
  font-weight: 500;
  flex: 1;
  transition: color var(--transition);
}

.archive-item a:hover {
  color: var(--primary);
}

/* ===== Categories ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

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

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

/* ===== Author ===== */
.author-card {
  max-width: 800px;
  margin: 0 auto 48px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.author-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  margin-top: 20px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  color: white;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 60px;
  padding: 20px 0;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.page-link.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.page-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.page-num:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.page-num.active {
  background: var(--primary);
  color: white;
}

/* ===== Post Page ===== */
.post-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 40px) 24px 60px;
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: stretch;
}

.post-detail {
  max-width: var(--content-width);
  min-width: 0;
  flex: 1;
}

.post-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: none;
}

.post-sidebar-inner {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
  max-height: calc(100vh - var(--nav-height) - 60px);
  overflow-y: auto;
}

/* TOC */
.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.toc-chevron {
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
}

.toc-header.collapsed .toc-chevron {
  transform: rotate(-90deg);
}

.toc-body {
  padding: 12px 0;
  transition: max-height var(--transition);
  overflow: hidden;
}

.toc-body.collapsed {
  max-height: 0 !important;
  padding: 0;
}

.toc-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-body li {
  margin: 0;
}

.toc-body a {
  display: block;
  padding: 6px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-body a:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.toc-body a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.toc-body ul ul a {
  padding-left: 32px;
  font-size: 0.8rem;
}

/* Info sidebar */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.info-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.info-section:last-child {
  border-bottom: none;
}

.info-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.author-card-sm {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.author-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name-sm {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 0.85rem;
}

.info-list dt {
  color: var(--text-muted);
  font-weight: 400;
}

.info-list dd {
  color: var(--text);
}

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-sm {
  font-size: 0.75rem;
  padding: 2px 8px;
}

@media (min-width: 1200px) {
  .post-sidebar {
    display: block;
  }
}

/* Post header */
.post-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text);
}

.post-excerpt {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.post-cover {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-top: 24px;
}

/* ===== Post Content (Markdown) ===== */
.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.post-content h2 {
  font-size: 1.75rem;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.post-content h3 {
  font-size: 1.4rem;
}

.post-content h4 {
  font-size: 1.15rem;
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 2em auto;
  display: block;
  box-shadow: var(--shadow);
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 2em 0;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content li > ul,
.post-content li > ol {
  margin: 0.5em 0;
}

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(99, 102, 241, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.post-content a:hover {
  text-decoration-color: var(--primary);
}

.post-content code {
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
  color: var(--primary-dark);
}

html[data-theme="dark"] .post-content code {
  color: var(--primary-light);
}

.post-content pre {
  background: #1e1e2e;
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  margin: 2em 0;
  box-shadow: var(--shadow);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: #cdd6f4;
  font-size: 0.9rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-content th,
.post-content td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-alt);
  font-weight: 600;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-content .contains-task-list {
  list-style: none;
  padding-left: 0;
}

.post-content input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary);
}

/* Prev / Next */
.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.pager-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.pager-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pager-item.next {
  text-align: right;
}

.pager-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pager-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

/* CC License */
.cc-license-box {
  display: flex;
  gap: 20px;
  margin-top: 48px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.cc-license-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-license-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cc-license-content {
  flex: 1;
  min-width: 0;
}

.cc-license-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.cc-license-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cc-license-desc a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.cc-license-desc a:hover {
  border-bottom-color: var(--primary);
}

/* Comments */
.comments-section {
  max-width: var(--content-width);
  margin: 60px auto 0;
  padding: 0 24px 60px;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.comments-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== About (Single Page) ===== */
.about-page {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== Error ===== */
.error-page {
  text-align: center;
  padding: calc(var(--nav-height) + 80px) 0 80px;
}

.error-code {
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-title {
  font-size: 1.3rem;
  color: var(--text);
  margin-top: 12px;
}

.error-detail {
  color: var(--text-secondary);
  margin-top: 8px;
}

.error-kaomoji {
  margin-top: 16px;
  font-size: 1.4rem;
  color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-tip {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 48px 0 24px;
}

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

.footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  flex: 2 1 260px;
  min-width: 260px;
}

.footer-brand .footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: inline-block;
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.footer-social a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-social a:hover {
  color: var(--primary);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 150px;
  min-width: 150px;
}

.footer-nav h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-bottom a:hover {
  color: var(--primary);
}

.footer-beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .footer-main {
    gap: 24px 32px;
  }

  .footer-brand {
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .footer-nav {
    flex-basis: 40%;
  }
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 60;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

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

  .posts-grid-3 {
    grid-template-columns: 1fr;
  }

  .post-featured-content {
    padding: 28px;
  }

  .post-layout {
    padding: calc(var(--nav-height) + 20px) 16px 40px;
  }

  .post-pager {
    grid-template-columns: 1fr;
  }

  .post-header-meta {
    gap: 8px;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== Guestbook Section ===== */
.guestbook-section {
  padding: 60px 0;
  background: var(--bg-alt);
}

.guestbook-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.guestbook-tip {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.guestbook-tip p {
  margin: 0;
  font-size: 15px;
}
