/* 题小典 · 管理后台样式 */

:root {
  --sidebar-width: 260px;
  --header-height: 60px;
  --primary: #4A90D9;
  --primary-dark: #357ABD;
  --success: #27AE60;
  --danger: #E74C3C;
  --warning: #F39C12;
  --info: #3498DB;
  --bg: #F4F6F9;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-muted: #888888;
  --border: #E5E7EB;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

/* ─── 侧边栏 ─── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1E2A3A 0%, #152233 100%);
  color: #ccc;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s;
}
.sidebar-brand {
  display: flex; align-items: center;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo { font-size: 28px; margin-right: 10px; }
.sidebar-brand .title { font-size: 18px; font-weight: 600; color: #fff; }
.sidebar-nav { padding: 12px 0; }
.sidebar-section { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; color: #666; letter-spacing: 1px; }
.sidebar-link {
  display: flex; align-items: center;
  padding: 11px 20px;
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: #fff; background: rgba(74,144,217,0.15); border-left-color: var(--primary); }
.sidebar-link i { font-size: 18px; margin-right: 10px; width: 22px; text-align: center; }
.sidebar-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 2px 8px; min-width: 20px; text-align: center; }

/* ─── 主内容区 ─── */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 999;
}
.topbar .breadcrumb { margin: 0; font-size: 13px; }
.topbar .user-menu { display: flex; align-items: center; gap: 12px; }
.topbar .user-menu .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.content { padding: 24px; }

/* ─── 卡片 ─── */
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  display: flex; align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid var(--primary);
}
.stat-card .stat-icon { font-size: 36px; margin-right: 16px; width: 48px; text-align: center; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }
.stat-card.accent-success { border-left-color: var(--success); }
.stat-card.accent-warning { border-left-color: var(--warning); }
.stat-card.accent-danger { border-left-color: var(--danger); }
.stat-card.accent-info { border-left-color: var(--info); }

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}
.card-body { padding: 20px; }

/* ─── 表格 ─── */
.table { margin: 0; font-size: 13px; }
.table th { font-weight: 600; color: #555; background: #FAFBFC; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table .empty-row td { text-align: center; color: #aaa; padding: 40px; }

/* ─── 表单 ─── */
.form-label { font-weight: 500; font-size: 13px; color: #555; }
.form-text-hint { font-size: 12px; color: #999; margin-top: 4px; }
.json-editor { font-family: "SF Mono", "Monaco", "Menlo", monospace; font-size: 12px; min-height: 120px; }

/* ─── 标签 ─── */
.badge-vip { background: linear-gradient(135deg, #F39C12, #E67E22); color: #fff; }
.status-pending { color: #F39C12; }
.status-processing { color: #3498DB; }
.status-completed { color: #27AE60; }
.status-failed { color: #E74C3C; }

/* ─── 模态框覆盖 ─── */
.modal-backdrop { z-index: 1040; }
.modal { z-index: 1050; }

/* ─── 登录页 ─── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-card .logo-area { text-align: center; margin-bottom: 30px; }
.login-card .logo-area .app-icon { font-size: 48px; }
.login-card .logo-area h3 { margin-top: 8px; font-weight: 600; color: #333; }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .content { padding: 12px; }
}

/* ─── 分页 ─── */
.pagination { margin: 0; }
.pagination .page-link { font-size: 13px; }

/* ─── Chart容器 ─── */
.chart-container { position: relative; width: 100%; min-height: 280px; }

/* 模板槽位可视化 */
.slot-highlight { background: #FFF3CD; color: #856404; padding: 1px 5px; border-radius: 3px; font-family: monospace; font-weight: 600; }

/* 模板预览 */
.preview-card { background: #FAFBFC; border: 1px dashed #ccc; border-radius: 6px; padding: 16px; }
.preview-card .problem { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.preview-card .problem:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.preview-card .problem-num { color: var(--primary); font-weight: 600; }
