/* ============================================================
   电竞护航俱乐部接单系统 · 管理后台主题
   深色电竞风 · 全端颜色/圆角/密度由 CSS 变量驱动（契合主题引擎设计）
   ============================================================ */

:root {
  /* ---- 品牌色 ---- */
  --brand-primary: #534ab7;        /* 品牌主色（紫） */
  --brand-primary-strong: #6c63d6; /* 主色高亮（hover/激活） */
  --brand-accent: #d85a30;         /* 强调色（橙） */
  --brand-gradient: linear-gradient(135deg, #534ab7 0%, #7b5fd9 55%, #d85a30 120%);

  /* ---- 语义色 ---- */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* ---- 深色背景层级 ---- */
  --bg-base: #0f1117;              /* 页面底色 */
  --bg-elevated: #171a23;          /* 卡片/面板 */
  --bg-hover: #1f2430;             /* hover 背景 */
  --bg-input: #10131b;             /* 输入框底色 */

  /* ---- 边框 / 分割线 ---- */
  --border-color: #262b38;
  --border-color-strong: #343b4d;

  /* ---- 文本 ---- */
  --text-primary: #e8eaf2;
  --text-secondary: #9aa1b5;
  --text-muted: #6b7280;

  /* ---- 圆角 / 密度 ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.35);

  /* ---- 布局 ---- */
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

/* ============ 基础 ============ */
html, body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--brand-primary-strong);
  text-decoration: none;
}
a:hover {
  color: var(--brand-accent);
}

/* 数字等宽（金额/单号） */
.mono {
  font-family: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(83, 74, 183, 0.25), transparent 60%),
    radial-gradient(800px 400px at 0% 110%, rgba(216, 90, 48, 0.12), transparent 60%),
    var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 2rem;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 0.75rem;
}

.login-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
}

/* ============ 后台主布局 ============ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* 侧边导航 */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand .logo-mini {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.6rem;
}

.sidebar-nav .nav-group-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem 0.3rem;
  letter-spacing: 1px;
}

.sidebar-nav .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
  background: rgba(83, 74, 183, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-primary-strong);
}

.sidebar-nav .nav-link .bi {
  font-size: 1rem;
}

/* 主内容区 */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 顶栏 */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar .page-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.topbar .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 内容区 */
.content {
  padding: 1.5rem;
}

/* ============ 卡片 ============ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.9rem 1.25rem;
}

.card .card-body {
  padding: 1.25rem;
}

/* ============ 数据看板统计卡 ============ */
.stat-card {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(83, 74, 183, 0.18);
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.35rem 0 0.25rem;
}

.stat-card .stat-trend {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

/* ============ 表单（深色适配）============ */
.form-control,
.form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-input);
  border-color: var(--brand-primary-strong);
  color: var(--text-primary);
  box-shadow: 0 0 0 0.2rem rgba(83, 74, 183, 0.25);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============ 按钮 ============ */
.btn-brand {
  background: var(--brand-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn-brand:hover {
  color: #fff;
  filter: brightness(1.1);
}

.btn-outline-dark {
  border-color: var(--border-color-strong);
  color: var(--text-primary);
}
.btn-outline-dark:hover {
  background: var(--bg-hover);
  color: #fff;
  border-color: var(--border-color-strong);
}

/* ============ 表格 ============ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border-color);
  --bs-table-hover-bg: var(--bg-hover);
  --bs-table-hover-color: #fff;
}

/* ============ 徽章 ============ */
.badge-module {
  background: rgba(83, 74, 183, 0.2);
  color: #b9b2f2;
  border: 1px solid rgba(83, 74, 183, 0.5);
  font-weight: 500;
}

/* ============ 占位内容 ============ */
.placeholder-panel {
  border: 1.5px dashed var(--border-color-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3242; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a4258; }

/* ============================================================
   M3 管理后台扩展组件样式
   ============================================================ */

/* 工具条 / 筛选栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.filter-bar .filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.filter-bar .filter-item label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.filter-bar .form-control,
.filter-bar .form-select {
  min-width: 140px;
  font-size: 0.875rem;
}

/* 空态 */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-color-strong);
  border-radius: var(--radius-lg);
}
.empty-state .bi { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.5; }

/* 分页 */
.pagination {
  --bs-pagination-bg: var(--bg-input);
  --bs-pagination-border-color: var(--border-color);
  --bs-pagination-color: var(--text-secondary);
  --bs-pagination-hover-bg: var(--bg-hover);
  --bs-pagination-hover-color: #fff;
  --bs-pagination-hover-border-color: var(--border-color-strong);
  --bs-pagination-active-bg: var(--brand-primary-strong);
  --bs-pagination-active-border-color: var(--brand-primary-strong);
  --bs-pagination-disabled-bg: var(--bg-input);
  --bs-pagination-disabled-color: var(--text-muted);
}

/* 模态框（深色） */
.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
}
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-footer { border-top: 1px solid var(--border-color); }
.modal .form-control, .modal .form-select { font-size: 0.9rem; }

/* 表单开关（switch）深色适配 */
.form-switch .form-check-input {
  background-color: var(--bg-input);
  border-color: var(--border-color-strong);
}
.form-switch .form-check-input:checked {
  background-color: var(--brand-primary-strong);
  border-color: var(--brand-primary-strong);
}

/* 软徽章（状态） */
.badge-soft-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.35); font-weight: 500; }
.badge-soft-danger  { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.35); font-weight: 500; }
.badge-soft-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); font-weight: 500; }
.badge-soft-info    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.35); font-weight: 500; }
.badge-soft-muted   { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.35); font-weight: 500; }
.badge-soft-primary { background: rgba(83,74,183,0.22); color: #b9b2f2; border: 1px solid rgba(83,74,183,0.5); font-weight: 500; }

/* 配置卡片（支付/余额/提现） */
.config-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.config-card .config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.config-card .config-title { font-weight: 600; }
.config-card .config-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-right: 0.5rem;
  background: rgba(83,74,183,0.2); color: #b9b2f2;
}

/* 主题预览块 */
.preview-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  transition: background 0.2s, border-color 0.2s;
}
.preview-card .preview-logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.1rem;
}
.preview-card .preview-title { font-weight: 700; font-size: 1.05rem; }
.preview-card .preview-btn { border: none; color: #fff; font-weight: 600; border-radius: 8px; padding: 0.35rem 0.9rem; }

/* 布局编辑器组件行 */
.component-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}
.component-row .drag-handle { color: var(--text-muted); cursor: move; }
.component-row .component-name { flex: 1; font-weight: 500; }

/* 授权模块清单 */
.license-module {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--bg-input);
}
.license-module .bi-check-circle-fill { color: var(--success); }

/* 文本工具 */
.text-monospace { font-family: "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.line-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cursor-pointer { cursor: pointer; }
