@charset "UTF-8";
/* Google Fonts Outfit (Outfit font - replaced with system fonts fallback due to CDN timeout in China) */
/* Outfit font can be loaded via: https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap */
/* Using system-ui fallback for Chinese environments */
/**
 * YCat Editor — 统一布局系统 v3.0
 * 所有页面共享的 Header + 侧边栏 + 主题变量
 * 
 * 使用方式：在每个HTML的 <head> 中引入此文件
 * 所有颜色通过 CSS 变量定义，支持 [data-theme="dark"] 切换
 */

/* ===== 1. 主题变量 ===== */
:root {
  /* 主品牌色（去 AI 紫，改用沉稳青绿 teal 作为单一强调色 — taste/impeccable 规则） */
  --brand: #0d9488;
  --brand-hover: #0f766e;
  --brand-dim: rgba(13, 148, 136, 0.12);
  --brand-glow: rgba(13, 148, 136, 0.30);

  /* 语义色 */
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --orange: #fb923c;
  --blue: #60a5fa;
  --purple: #a78bfa;

  /* 浅色主题（默认 - 温暖现代风格） */
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-hover: #f4f5fa;
  --surface-2: #eef0f5;
  --border: #e2e5ea;
  --border-strong: #c9cdd5;
  --text: #1a1d2e;
  --text-2: #3d4166;
  --text-muted: #6e7290;
  --text-faint: #a0a3b8;
  
  /* Header - 浅色 */
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-border: #e8eaf0;

  /* 阴影系统 - 浅色（更柔和自然） */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  /* 渐变和玻璃态 - 浅色 */
  --gradient-primary: linear-gradient(135deg, var(--brand), var(--brand-hover));
  --gradient-subtle: linear-gradient(135deg, rgba(13,148,136,0.08), rgba(13,148,136,0.03));
  --gradient-warm: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);

  /* 圆角 */
  --radius-xs: 4px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 过渡 */
  --t: 0.2s ease;

  /* 导航 */
  --nav-width: 220px;
  --header-height: 64px;

  /* ===== 统一设计令牌（合并双方案，保证所有页面颜色一致，消除乱码式断色） ===== */
  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --primary-light: #ccfbf1;
  --primary-dark: var(--brand-hover);
  --primary-active: var(--brand-hover);
  --primary-rgb: 13, 148, 136;
  --brand-rgb: 13, 148, 136;
  --brand-dim: rgba(13, 148, 136, 0.12);
  --secondary: #60a5fa;
  --accent: var(--brand);
  --accent-light: #ccfbf1;
  --accent-dim: var(--brand-dim);
  --accent2: #60a5fa;
  --info: #60a5fa;
  --error: var(--danger);
  --bg-body: var(--bg);
  --bg-card: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-hover: var(--surface-hover);
  --bg-secondary: var(--surface);
  --bg-active: var(--brand-dim);
  --bg-primary: var(--bg);
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-tertiary: var(--text-muted);
  --text-dim: var(--text-muted);
  --text-inverse: #ffffff;
  --border-color: var(--border);
  --border-light: #f3f4f6;
  --border-subtle: var(--surface-2);
  --card: var(--surface);
  --card-hover: var(--surface-hover);
  --green: var(--success);
  --red: var(--danger);
  --yellow: var(--warning);
  --shadow: var(--shadow-md);
  --gradient: var(--gradient-primary);
  --radius-sm: 6px;
  --danger-rgb: 248, 113, 113;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* 暗色主题 */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #1f2333;
  --surface-2: #22263a;
  --border: #2a2d3e;
  --border-strong: #353850;
  --text: #e0e3f0;
  --text-2: #a0a5be;
  --text-muted: #6b7090;
  --text-faint: #454860;
  --header-bg: rgba(26, 29, 39, 0.96);
  --header-border: #222538;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --glass-bg: rgba(26, 29, 39, 0.7);
  --glass-border: rgba(42, 45, 62, 0.9);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --gradient-warm: linear-gradient(135deg, #1a1d27 0%, #2a2d3e 100%);
  /* ===== 统一设计令牌（暗色，合并双方案） ===== */
  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --primary-light: #134e4a;
  --primary-dark: var(--brand-hover);
  --primary-active: var(--brand-hover);
  --secondary: #60a5fa;
  --accent: var(--brand);
  --accent-light: #134e4a;
  --accent-dim: var(--brand-dim);
  --accent2: #60a5fa;
  --info: #60a5fa;
  --error: var(--danger);
  --bg-body: var(--bg);
  --bg-card: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-hover: var(--surface-hover);
  --bg-secondary: var(--surface);
  --bg-active: var(--brand-dim);
  --bg-primary: var(--bg);
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-tertiary: var(--text-muted);
  --text-dim: var(--text-muted);
  --text-inverse: #0f1117;
  --border-color: var(--border);
  --border-light: #22263a;
  --border-subtle: var(--surface-2);
  --card: var(--surface);
  --card-hover: var(--surface-hover);
  --green: var(--success);
  --red: var(--danger);
  --yellow: var(--warning);
  --shadow: var(--shadow-md);
  --gradient: var(--gradient-primary);
  --radius-sm: 6px;
  --gray-50: #111827;
  --gray-100: #1a1d27;
  --gray-200: #22263a;
  --gray-300: #2a2d3e;
  --gray-400: #353850;
  --gray-500: #454860;
  --gray-600: #6b7090;
  --gray-700: #a0a5be;
  --gray-800: #e0e3f0;
  --gray-900: #ffffff;
}

/* ===== 2. 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}

/* ===== 3. Header ===== */
.site-header, .header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  transition: background var(--t), border-color var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .header {
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-icon {
  width: 34px; height: 34px;
  background: var(--brand);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.header-logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.header-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }

.header-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--t);
}
.header-nav a .nav-icon { font-size: 15px; }
.header-nav a:hover {
  color: var(--brand);
  background: var(--brand-dim);
}
.header-nav a.active {
  color: var(--brand);
  background: var(--brand-dim);
}

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

/* 用户信息 */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
[data-theme="dark"] .user-avatar {
  background: var(--brand);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-plan {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--brand-glow);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ===== 4. 主题切换按钮 ===== */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
  font-size: 16px;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--brand);
}

/* ===== 5. 页面主体 ===== */
/* 编辑器 .main 由 editor.html 内联样式左对齐控制，
   故此处只对 .page-body 内的 .main 生效（编辑器 <main> 不在 .page-body 内） */
.page-body,
.page-body .main {
  margin-top: var(--header-height);
  padding-top: 0;
  padding: 32px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== 6. 统计卡片行 ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-change {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-muted);
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== 7. 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: all var(--t);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 20px; }

/* ===== 8. 表格 ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead { background: var(--surface-2); }
th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
tr:hover td { background: var(--surface-hover); }

/* ===== 9. 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: all var(--t);
  outline: none;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.form-input::placeholder { color: var(--text-faint); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

/* ===== 10. 徽章 / Tag ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.badge-brand { background: var(--brand-dim); color: var(--brand); }
.badge-success { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-blue { background: rgba(96, 165, 250, 0.15); color: var(--blue); }

/* ===== 11. 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all var(--t);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== 12. Toast 通知 ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 240px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }

/* ===== 13. 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-desc { font-size: 13px; }

/* ===== 14. 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all var(--t);
}
.pagination a:hover { background: var(--brand-dim); color: var(--brand); border-color: var(--brand); }
.pagination .active { background: var(--brand); color: white; font-weight: 600; }

/* ===== 15. 工具栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  flex: 1;
  min-width: 200px;
}
.toolbar-search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
}
.toolbar-search input::placeholder { color: var(--text-faint); }

/* ===== 16. 工具提示 ===== */
[title] { cursor: pointer; }

/* ===== 17. 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ===== 18. 响应式 ===== */

/* 大平板/小笔记本 */
@media (max-width: 1024px) {
  .page-body { padding: 24px; max-width: 100%; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .header-nav a { padding: 6px 10px; font-size: 13px; }
}

/* 平板 */
@media (max-width: 768px) {
  .site-header, .header { padding: 0 16px; gap: 12px; }
  .header-nav { display: none; }
  .header-nav.mobile-open { 
    display: flex; 
    position: fixed; 
    top: var(--header-height); 
    left: 0; 
    right: 0; 
    background: var(--header-bg); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column; 
    padding: 16px; 
    gap: 4px;
    border-bottom: 1px solid var(--border);
    z-index: 190;
  }
  .header-nav.mobile-open a { 
    padding: 12px 16px; 
    font-size: 14px; 
    border-radius: var(--radius);
  }
  .mobile-menu-btn { display: flex !important; }
  .page-body { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-title { font-size: 20px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .card-header { flex-direction: column; align-items: flex-start; }
  table { font-size: 12px; }
  th, td { padding: 8px 12px; }
}

/* 大手机 */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 24px; }
  .page-body { padding: 12px; }
  .btn { padding: 6px 12px; font-size: 12px; }
  .btn-sm { padding: 4px 10px; font-size: 11px; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); margin: 8px; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 12px 16px; }
  .user-name, .user-plan { display: none; }
  .header-logo-text { font-size: 15px; }
  
  /* 移动端表格水平滚动 */
  .table-wrapper, .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  
  /* 移动端表单：所有输入元素占满宽度 */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="url"], input[type="number"],
  textarea, select, .form-input, .form-control {
    width: 100%; max-width: 100%; box-sizing: border-box;
  }
  
  /* 移动端过滤/搜索栏 */
  .filters-row, .search-bar, .action-bar {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .filters-row select, .filters-row input, .filters-row .btn {
    width: 100%;
  }
  
  /* 移动端卡片网格 */
  .card-grid, .articles-grid, .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
  }
  
  /* 移动端工具条 */
  .toolbar, .btn-group { flex-wrap: wrap; gap: 6px; }
  
  /* 移动端分页 */
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pagination .btn { padding: 6px 10px; font-size: 12px; }
  
  /* 移动端底部安全区域 */
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .page-body { padding-bottom: 80px; }
  
  /* 移动端Toast位置调整 */
  .toast-container { bottom: 80px; left: 12px; right: 12px; }
  .toast { width: 100%; max-width: 100%; }
  
  /* 移动端侧边栏抽屉 */
  .sidebar { 
    position: fixed; top: var(--header-height); left: -280px; bottom: 0;
    width: 280px; max-width: 85vw; z-index: 199;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 198;
    background: rgba(0,0,0,0.4);
  }
  .sidebar-overlay.show { display: block; }
}

/* 移动端侧边栏覆盖层JS钩子 */
.sidebar-overlay { display: none; }

/* 小手机 */
@media (max-width: 360px) {
  .page-title { font-size: 18px; }
  .stat-value { font-size: 20px; }
  .header-logo-text { display: none; }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--t);
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--brand);
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; } /* 防止iOS缩放 */
  .header-nav a { min-height: 44px; }
  .theme-toggle { min-width: 44px; min-height: 44px; }
  .mobile-menu-btn { min-width: 44px; min-height: 44px; }
  
  /* 触摸设备间距优化 */
  .stat-card { padding: 16px; }
  .card { padding: 16px; }
  th, td { padding: 10px 12px; }
  
  /* 防止双击缩放 */
  * { touch-action: manipulation; }
  
  /* 滚动条优化 */
  ::-webkit-scrollbar { width: 4px; height: 4px; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
}

/* ===== 全局页脚 Footer ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a:hover { color: var(--accent, #0066ff); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--text-primary); }
.footer-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-links .sep { color: var(--border); }
.footer-social { display: flex; align-items: center; gap: 0.75rem; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-secondary);
  transition: background 0.2s, transform 0.2s;
}
.footer-social a:hover { background: var(--accent, #0066ff); transform: translateY(-2px); }
.footer-right { color: var(--text-muted); font-size: 0.8rem; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-links { gap: 1rem; }
}

/* ===== 侧边栏标准组件 ===== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1rem 0;
}
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section {
  margin-bottom: 1rem;
}
.sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  margin: 0;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.sidebar-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.sidebar-item.active,
.sidebar-item[aria-current="page"] {
  background: var(--brand-dim, rgba(124, 106, 247, 0.1));
  color: var(--brand, #7c6af7);
  font-weight: 600;
}
.sidebar-item .sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-item.active .sidebar-icon,
.sidebar-item:hover .sidebar-icon { opacity: 1; }
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.75rem;
}
.sidebar-badge {
  margin-left: auto;
  background: var(--brand, #7c6af7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.sidebar-item.active .sidebar-badge {
  background: var(--brand, #7c6af7);
}

/* Desktop sidebar layout */
.main-with-sidebar {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}
.main-with-sidebar .main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
}
