/* ============================================
   速创智算后台管理 v3 — 清新主题
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef2f8;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #4f8ff7;
  --accent-hover: #3b7de6;
  --accent-light: #eef3ff;
  --accent-gradient: linear-gradient(135deg, #4f8ff7, #7c5cfc);
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-glow: 0 4px 20px rgba(79,143,247,0.2);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --nav-height: 64px;
  --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
}

/* ===== 全局链接 ===== */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  overflow-y: auto;
  z-index: 10;
  display: block !important;
}
.sidebar h2 {
  font-size: 16px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  padding-left: 8px;
}
.sidebar .nav-group {
  display: block !important;
  margin-bottom: 16px;
}
.sidebar a {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.sidebar a:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateX(3px);
}
.sidebar a.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,143,247,0.3);
}
.main {
  margin-left: 220px !important;
  flex: 1;
  padding: 28px;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ===== 导航栏 ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
}
.nav-logo {
  font-size: 19px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links { display: flex; gap: 6px; margin-left: 40px; }
.nav-links a {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav-links a:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.nav-links a.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

/* ===== 容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 28px) 28px 40px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(79,143,247,0.1);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
}
.btn-ghost:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.btn-success {
  background: var(--success-light);
  color: #059669;
  border: 1px solid #a7f3d0;
}
.btn-success:hover {
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--danger-light);
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-danger:hover {
  box-shadow: 0 2px 8px rgba(239,68,68,0.15);
  transform: translateY(-1px);
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-primary);
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--accent-light); }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-green { background: var(--success-light); color: #059669; }
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-orange { background: var(--warning-light); color: #d97706; }

/* ===== 输入框 ===== */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--font);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,143,247,0.10);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ===== 网格 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-state .icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(8px);
  z-index: 200;
  justify-content: center;
  align-items: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* ===== 工具条 ===== */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .btn { white-space: nowrap; }

/* ===== 搜索框 ===== */
.search-input {
  max-width: 360px;
  padding: 10px 16px 10px 40px;
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 12px center no-repeat;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,143,247,0.10);
  width: 400px;
  background-color: #fff;
}

/* ===== 标签页 ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border: none;
  background: none;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab:hover { color: var(--accent); background: var(--accent-light); }
.tab.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,143,247,0.3);
}

/* ===== 统计卡片 ===== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
}
.stat-card .num {
  font-size: 28px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.stat-card .label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.stat-card .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 进度条 ===== */
progress {
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-primary);
  border: none;
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--bg-primary); border-radius: 999px; }
progress::-webkit-progress-value {
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d5e0; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a0a5b0; background-clip: content-box; }

/* ===== 分割线 ===== */
.sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ===== 侧栏分组标题 ===== */
.sidebar .nav-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 8px;
  margin-bottom: 8px;
}
.sidebar .sep { border-top: 1px solid var(--border); margin: 12px 0; }

/* ===== 圆角表格 ===== */
.rounded-table table {
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ===== 列表组 ===== */
.list-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.list-group-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background: var(--accent-light); }
