/*
Theme Name: FlatMod Blog
Theme URI: https://example.com/flatmod-blog
Author: FlatMod Team
Author URI: https://example.com
Description: 一款模块化、现代设计的多功能WordPress博客主题，内置完整会员中心系统。
Version: 2.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flatmod-blog
Tags: blog, news, modern-design, modular, member-center, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ========================================
   FlatMod Blog v2.0 - 现代设计系统
   设计灵感：Linear / Vercel / Notion
   ======================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 主色调 - 现代蓝紫 */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-lighter: #f5f3ff;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --primary-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  /* 辅助色 */
  --accent: #ec4899;
  --accent-light: #fce7f3;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* 中性色 - 更柔和的灰阶 */
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  /* 文本 */
  --text: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --text-inverse: #ffffff;

  /* 背景 */
  --bg: #fafafa;
  --bg-subtle: #f4f4f5;
  --bg-card: #ffffff;
  --bg-hover: #fafafa;

  /* 边框 */
  --border: #e4e4e7;
  --border-light: #f4f4f5;
  --border-focus: var(--primary);

  /* 圆角 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* 阴影 - 更精致的多层阴影 */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  --shadow-primary: 0 4px 14px 0 rgb(99 102 241 / 0.35);
  --shadow-primary-lg: 0 8px 25px -3px rgb(99 102 241 / 0.4);

  /* 动画 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局 */
  --container: 1200px;
  --container-narrow: 800px;
  --header-height: 68px;
  --sidebar-width: 280px;

  /* 字体 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent);
}

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

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.375rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { margin-bottom: 1rem; }

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

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------- 容器 ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 按钮系统 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.5;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn:hover::before { transform: translateX(100%); }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--primary-gradient-hover);
  color: #fff;
  box-shadow: var(--shadow-primary-lg);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--gray-300);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- 卡片系统 ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-body { padding: 24px; }
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- 表单系统 ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition-fast);
  outline: none;
}
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.form-control::placeholder { color: var(--text-tertiary); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-text { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---------- 提示框 ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #065f46; border-color: rgba(16, 185, 129, 0.2); }
.alert-error { background: var(--danger-light); color: #991b1b; border-color: rgba(239, 68, 68, 0.2); }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: rgba(245, 158, 11, 0.2); }
.alert-info { background: var(--info-light); color: #1e40af; border-color: rgba(59, 130, 246, 0.2); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-light); color: #059669; }
.badge-warning { background: var(--warning-light); color: #d97706; }
.badge-danger { background: var(--danger-light); color: #dc2626; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---------- 头部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(228, 228, 231, 0.6);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}
.site-branding { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-logo { max-height: 36px; width: auto; }
.site-title {
  font-size: 20px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.site-title a { color: inherit; }
.site-description { font-size: 13px; color: var(--text-tertiary); }

.main-navigation { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.main-menu { display: flex; align-items: center; gap: 2px; }
.main-menu li { position: relative; }
.main-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.main-menu a:hover,
.main-menu .current-menu-item > a {
  background: var(--primary-lighter);
  color: var(--primary);
}
.main-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: all var(--transition-fast);
}
.main-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.main-menu .sub-menu a { padding: 9px 12px; border-radius: var(--radius-xs); }
.main-menu .sub-menu a:hover { background: var(--bg-subtle); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* 用户下拉 */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.header-user:hover { background: var(--bg-subtle); }
.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
  border: 2px solid var(--primary-light);
}
.header-user-name { font-size: 14px; font-weight: 500; color: var(--text); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: all var(--transition-fast);
}
.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}
.user-dropdown a:hover { background: var(--bg-subtle); color: var(--primary); }
.user-dropdown .dropdown-divider { height: 1px; background: var(--border-light); margin: 6px 0; }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 22px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.mobile-menu-toggle:hover { background: var(--bg-subtle); }

/* 搜索框 */
.header-search { position: relative; }
.search-form { display: flex; align-items: center; }
.search-field {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  width: 200px;
  outline: none;
  transition: all var(--transition-fast);
  background: var(--bg-subtle);
  font-family: inherit;
}
.search-field:hover { background: var(--bg-card); }
.search-field:focus {
  width: 260px;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.search-submit { display: none; }

/* ---------- 主内容区 ---------- */
.site-content {
  padding: 40px 0 60px;
  min-height: calc(100vh - var(--header-height) - 280px);
}
.content-area {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 36px;
  align-items: start;
}
.content-area.no-sidebar { grid-template-columns: 1fr; max-width: var(--container-narrow); margin: 0 auto; }

/* ---------- Hero 区域 ---------- */
.hero-section {
  position: relative;
  background: var(--gray-900);
  color: #fff;
  padding: 80px 0;
  margin-bottom: 48px;
  border-radius: var(--radius-xl);
  text-align: center;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(99, 102, 241, 0.4), transparent),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(236, 72, 153, 0.3), transparent);
}
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-section > * { position: relative; z-index: 1; }
.hero-section h1 {
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.hero-section p {
  font-size: 18px;
  opacity: 0.8;
  margin-bottom: 32px;
}
.hero-section .btn {
  background: #fff;
  color: var(--gray-900);
  font-weight: 600;
}
.hero-section .btn:hover { background: var(--gray-100); transform: translateY(-2px); }

/* ---------- 文章卡片网格 ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}
.post-card-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-subtle);
}
.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-card:hover .post-card-thumbnail img { transform: scale(1.08); }
.post-card-category {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: var(--primary);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}
.post-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-tertiary);
}
.post-card-meta-left { display: flex; align-items: center; gap: 8px; }
.post-card-author-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.post-card-stats { display: flex; gap: 14px; }
.post-card-stats span { display: flex; align-items: center; gap: 4px; }

/* ---------- 精选文章 ---------- */
.featured-posts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 48px;
}
.featured-post-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
}
.featured-post-main img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.featured-post-main:hover img { transform: scale(1.05); }
.featured-post-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
}
.featured-post-overlay h2 { color: #fff; font-size: 26px; margin-bottom: 8px; font-weight: 700; }
.featured-post-overlay h2 a { color: #fff; }
.featured-post-overlay p { font-size: 14px; opacity: 0.85; margin-bottom: 0; }
.featured-post-side { display: flex; flex-direction: column; gap: 20px; }
.featured-post-small {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  cursor: pointer;
  min-height: 140px;
}
.featured-post-small img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.featured-post-small:hover img { transform: scale(1.05); }
.featured-post-small .featured-post-overlay { padding: 20px; }
.featured-post-small .featured-post-overlay h3 { color: #fff; font-size: 15px; margin-bottom: 0; font-weight: 600; line-height: 1.4; }

/* ---------- 单篇文章 ---------- */
.single-post {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.single-post-header { margin-bottom: 36px; }
.single-post-category { margin-bottom: 16px; }
.single-post-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.single-post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
.single-post-author { display: flex; align-items: center; gap: 12px; }
.single-post-author img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--primary-light); }
.single-post-author-name { font-weight: 600; color: var(--text); }
.single-post-author-meta { font-size: 13px; color: var(--text-tertiary); }

.single-post-featured-image {
  margin-bottom: 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.single-post-featured-image img { width: 100%; }

.single-post-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--gray-700);
}
.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
  margin: 36px 0 18px;
  color: var(--text);
  font-weight: 700;
}
.single-post-content h2 { font-size: 1.6rem; }
.single-post-content h3 { font-size: 1.3rem; }
.single-post-content p { margin-bottom: 1.5rem; }
.single-post-content img { border-radius: var(--radius); margin: 24px 0; box-shadow: var(--shadow); }
.single-post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  background: var(--primary-lighter);
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-700);
  font-style: italic;
}
.single-post-content ul, .single-post-content ol {
  margin: 20px 0;
  padding-left: 28px;
}
.single-post-content ul { list-style: disc; }
.single-post-content ol { list-style: decimal; }
.single-post-content li { margin-bottom: 10px; }
.single-post-content code {
  background: var(--gray-100);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--accent);
}
.single-post-content pre {
  background: var(--gray-900);
  color: #e4e4e7;
  padding: 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 28px 0;
  font-size: 14px;
  line-height: 1.7;
}
.single-post-content pre code { background: none; padding: 0; color: inherit; }
.single-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.single-post-content th, .single-post-content td {
  padding: 14px 18px;
  border: 1px solid var(--border);
  text-align: left;
}
.single-post-content th { background: var(--bg-subtle); font-weight: 600; }
.single-post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(99, 102, 241, 0.3);
}
.single-post-content a:hover { text-decoration-color: var(--primary); }

.single-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}
.single-post-tags a {
  padding: 6px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.single-post-tags a:hover { background: var(--primary-light); color: var(--primary); }

/* 文章操作栏 */
.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding: 20px 24px;
  background: var(--bg-subtle);
  border-radius: var(--radius);
}
.post-actions-left, .post-actions-right { display: flex; gap: 10px; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.action-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.action-btn.liked { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* 作者信息卡 */
.author-box {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(135deg, var(--primary-lighter), var(--accent-light));
  border-radius: var(--radius-lg);
  margin-top: 36px;
  align-items: center;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}
.author-info h4 { margin-bottom: 6px; font-size: 17px; }
.author-info p { font-size: 14px; color: var(--text-secondary); margin-bottom: 0; }

/* ---------- 侧边栏 ---------- */
.widget-area { display: flex; flex-direction: column; gap: 24px; position: sticky; top: calc(var(--header-height) + 24px); }
.widget {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.widget:hover { box-shadow: var(--shadow-sm); }
.widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  letter-spacing: -0.01em;
}
.widget ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-secondary); display: flex; justify-content: space-between; transition: all var(--transition-fast); }
.widget ul li a:hover { color: var(--primary); padding-left: 4px; }

/* 热门文章小工具 */
.widget-popular-posts li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  align-items: center;
}
.widget-popular-posts .popular-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.widget-popular-posts .popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-popular-posts .popular-info { flex: 1; min-width: 0; }
.widget-popular-posts .popular-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-popular-posts .popular-title a { color: var(--text); }
.widget-popular-posts .popular-title a:hover { color: var(--primary); }
.widget-popular-posts .popular-date { font-size: 12px; color: var(--text-tertiary); }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 6px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.tag-cloud a:hover { background: var(--primary-light); color: var(--primary); transform: translateY(-1px); }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}
.pagination .page-numbers:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.pagination .current {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-primary);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 64px 0 28px;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
.footer-widget h4 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 600;
}
.footer-widget p, .footer-widget li { font-size: 14px; line-height: 1.9; }
.footer-widget a { color: var(--gray-400); transition: color var(--transition-fast); }
.footer-widget a:hover { color: #fff; }
.footer-widget ul li { padding: 5px 0; }
.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-800);
  border-radius: var(--radius-full);
  color: var(--gray-400);
  transition: all var(--transition-fast);
  font-size: 14px;
}
.footer-social a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 会员中心 ---------- */
.member-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
.member-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-height) + 24px);
}
.member-user-card {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.member-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 14px;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}
.member-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.member-role {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.member-stats {
  display: flex;
  justify-content: space-around;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.member-stat-item { text-align: center; }
.member-stat-num {
  font-size: 22px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.member-stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.member-nav { display: flex; flex-direction: column; gap: 2px; }
.member-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.member-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.member-nav a.active {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 600;
}
.member-nav a.active .nav-icon { transform: scale(1.1); }
.member-nav a .nav-icon { width: 20px; text-align: center; font-size: 16px; transition: transform var(--transition-fast); }

.member-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  min-height: 500px;
}
.member-page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.02em;
}

/* 仪表盘卡片 */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.dashboard-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.dashboard-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dashboard-card:hover::before { transform: scaleX(1); }
.dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.dashboard-card-num { font-size: 26px; font-weight: 800; margin-bottom: 2px; letter-spacing: -0.02em; }
.dashboard-card-label { font-size: 13px; color: var(--text-tertiary); }

/* 会员中心文章列表 */
.member-post-list { display: flex; flex-direction: column; gap: 14px; }
.member-post-item {
  display: flex;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  align-items: center;
}
.member-post-item:hover { border-color: var(--primary-light); background: var(--bg-subtle); }
.member-post-thumb {
  width: 110px;
  height: 74px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}
.member-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.member-post-info { flex: 1; min-width: 0; }
.member-post-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 10px;
}
.member-post-title a { color: var(--text); }
.member-post-title a:hover { color: var(--primary); }
.member-post-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.member-post-actions { display: flex; gap: 6px; }
.member-post-actions a {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.member-post-actions a:hover { background: var(--primary-light); color: var(--primary); }
.member-post-actions a.delete:hover { background: var(--danger-light); color: var(--danger); }

.post-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  flex-shrink: 0;
}
.post-status.publish { background: var(--success-light); color: #059669; }
.post-status.pending { background: var(--warning-light); color: #d97706; }
.post-status.draft { background: var(--gray-100); color: var(--gray-600); }

/* 收藏列表 */
.favorite-list { display: flex; flex-direction: column; gap: 12px; }
.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}
.favorite-item:hover { border-color: var(--primary-light); background: var(--bg-subtle); }
.favorite-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.favorite-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.favorite-thumb img { width: 100%; height: 100%; object-fit: cover; }
.favorite-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.favorite-title a { color: var(--text); }
.favorite-title a:hover { color: var(--primary); }
.favorite-time { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.favorite-remove {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-family: inherit;
}
.favorite-remove:hover { background: var(--danger); color: #fff; }

/* 评论列表 */
.comment-list-member { display: flex; flex-direction: column; gap: 14px; }
.comment-item-member {
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}
.comment-item-member:hover { border-color: var(--primary-light); }
.comment-header-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.comment-post-title { font-size: 13px; color: var(--text-tertiary); }
.comment-post-title a { color: var(--primary); font-weight: 500; }
.comment-content-member { font-size: 14px; color: var(--text); margin-bottom: 10px; line-height: 1.7; }
.comment-footer-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
}
.comment-actions-member { display: flex; gap: 12px; }
.comment-actions-member a { font-size: 13px; color: var(--text-secondary); }
.comment-actions-member a:hover { color: var(--primary); }
.comment-actions-member a.delete:hover { color: var(--danger); }

/* 资料设置 */
.profile-section { margin-bottom: 36px; }
.profile-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-section h3::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-subtle);
  flex-shrink: 0;
  border: 3px solid var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 登录注册页面 ---------- */
.auth-page {
  max-width: 460px;
  margin: 40px auto;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 44px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h2 { font-size: 26px; margin-bottom: 8px; font-weight: 800; letter-spacing: -0.02em; }
.auth-header p { color: var(--text-secondary); font-size: 14px; }
.auth-tabs {
  display: flex;
  margin-bottom: 28px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 5px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.auth-form { display: none; animation: fadeIn 0.3s ease; }
.auth-form.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.auth-social {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.auth-social-title {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}
.auth-social-buttons { display: flex; gap: 14px; justify-content: center; }
.auth-social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  font-size: 18px;
  font-weight: 600;
}
.auth-social-btn:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- 评论区 ---------- */
.comments-area { margin-top: 56px; }
.comments-title {
  font-size: 22px;
  margin-bottom: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment-body {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}
.comment-body:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.comment-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--primary-light); }
.comment-content-area { flex: 1; }
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.comment-author { font-weight: 600; font-size: 14px; }
.comment-date { font-size: 12px; color: var(--text-tertiary); }
.comment-text { font-size: 14px; color: var(--gray-700); line-height: 1.75; }
.comment-actions { display: flex; gap: 14px; margin-top: 10px; }
.comment-actions a { font-size: 13px; color: var(--text-tertiary); }
.comment-actions a:hover { color: var(--primary); }
.children { margin-left: 62px; margin-top: 16px; }
.children .comment-body { padding: 16px; }

.comment-respond { margin-top: 40px; }
.comment-reply-title { font-size: 18px; margin-bottom: 20px; font-weight: 700; }

/* ---------- 404页面 ---------- */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 .error-code {
  font-size: 140px;
  font-weight: 900;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.05em;
}
.error-404 h1 { font-size: 28px; margin-bottom: 12px; }
.error-404 p { color: var(--text-secondary); margin-bottom: 36px; font-size: 16px; }
.error-404 .search-form { max-width: 420px; margin: 0 auto 28px; }
.error-404 .search-field { width: 100%; }

/* ---------- 搜索/归档 ---------- */
.search-header { margin-bottom: 28px; }
.search-header h1 { font-size: 26px; letter-spacing: -0.02em; }
.search-header p { color: var(--text-secondary); }
.archive-header {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.archive-title { font-size: 24px; margin-bottom: 8px; letter-spacing: -0.02em; }
.archive-description { color: var(--text-secondary); font-size: 14px; }

/* 页面内容 */
.page-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 44px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.page-title {
  font-size: 28px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.02em;
}

/* 首页区块标题 */
.home-section { margin-bottom: 52px; }
.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.home-section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 14px;
}
.home-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 24px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}
.home-section-more {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.home-section-more:hover { padding-right: 4px; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-secondary);
}
.empty-state-icon {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.6;
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 22px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info { background: linear-gradient(135deg, #6366f1, #4f46e5); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- 加载动画 ---------- */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 46px;
  height: 46px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary-lg);
  z-index: 99;
  transition: all var(--transition-fast);
}
.back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }

/* ---------- 图片灯箱 ---------- */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}
.image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
}

/* ---------- 辅助类 ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
  .widget-area { order: 2; position: static; }
  .footer-widgets { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .member-page { grid-template-columns: 1fr; }
  .member-sidebar { position: static; }
  .featured-posts { grid-template-columns: 1fr; }
  .hero-section { padding: 60px 24px; }
  .hero-section h1 { font-size: 32px; }
}

@media (max-width: 768px) {
  :root { --header-height: 60px; }
  .container { padding: 0 16px; }

  .main-navigation {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    z-index: 99;
    border-bottom: 1px solid var(--border);
  }
  .main-navigation.active { display: flex; }
  .main-menu { flex-direction: column; gap: 0; }
  .main-menu a { padding: 12px 14px; }
  .main-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    background: var(--bg-subtle);
    margin-top: 4px;
    border-radius: var(--radius-sm);
  }
  .mobile-menu-toggle { display: block; }
  .header-search { display: none; }
  .header-user-name { display: none; }

  .posts-grid { grid-template-columns: 1fr; }
  .single-post { padding: 28px 20px; }
  .single-post-title { font-size: 1.75rem; }
  .page-content { padding: 28px 20px; }
  .footer-widgets { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 14px; text-align: center; }
  .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .member-post-item { flex-direction: column; align-items: flex-start; }
  .member-post-thumb { width: 100%; height: 180px; }
  .member-content { padding: 24px 20px; }
  .hero-section { padding: 48px 20px; border-radius: var(--radius-lg); }
  .hero-section h1 { font-size: 26px; }
  .hero-section p { font-size: 15px; }
  .post-actions { flex-direction: column; gap: 12px; align-items: stretch; }
  .post-actions-left, .post-actions-right { justify-content: center; }
  .author-box { flex-direction: column; text-align: center; }
  .children { margin-left: 20px; }
  .auth-card { padding: 32px 24px; }
  .error-404 .error-code { font-size: 100px; }
  .site-content { padding: 24px 0 40px; }
}

@media (max-width: 480px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .single-post-title { font-size: 1.5rem; }
  .member-stats { flex-direction: column; gap: 12px; }
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, .site-footer, .widget-area, .post-actions, .comments-area, .back-to-top { display: none !important; }
  .content-area { grid-template-columns: 1fr; }
  .single-post, .page-content { box-shadow: none; border: none; padding: 0; }
}
