/* 醒狮陪玩 · 管理后台 */
:root {
  --side-w: 224px;
}
body.admin-body { background: #F4F5F7; }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: var(--side-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.side-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.side-brand img { width: 38px; height: 38px; border-radius: 12px; }
.side-brand b { font-size: 16px; font-weight: 800; display: block; line-height: 1.2; }
.side-brand span { font-size: 10.5px; color: var(--ink-3); letter-spacing: 1px; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.side-group-title {
  font-size: 10.5px; color: var(--ink-4); font-weight: 700; letter-spacing: 1px;
  padding: 14px 10px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 2px;
  transition: background .15s, color .15s; position: relative;
}
.side-item:hover { background: #F7F7F9; color: var(--ink); }
.side-item.active { background: var(--red-50); color: var(--red); }
.side-item svg { flex: none; }
.side-item .count {
  margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; padding: 1px 6px;
}
.side-foot { padding: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-4); }

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 15;
}
.topbar h1 { font-size: 17px; font-weight: 800; }
.topbar .sub { font-size: 12px; color: var(--ink-3); margin-left: 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar .who { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.content { padding: 20px 22px 40px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------------- 统计卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat-card {
  background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--red-50); opacity: .8;
}
.stat-card .label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat-card .value small { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat-card .foot { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; position: relative; z-index: 1; }
.stat-card.red { background: var(--grad-red); color: #fff; }
.stat-card.red .label, .stat-card.red .foot { color: rgba(255, 255, 255, .82); }
.stat-card.red::after { background: rgba(255, 255, 255, .12); }
.stat-card.gold { background: linear-gradient(135deg, #FFE3A3, #F2B544); color: #5A3B00; }
.stat-card.gold .label, .stat-card.gold .foot { color: rgba(90, 59, 0, .7); }
.stat-card.gold::after { background: rgba(255, 255, 255, .25); }

/* ---------------- 卡片 / 面板 ---------------- */
.panel { background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); margin-top: 16px; overflow: hidden; }
.panel-head {
  padding: 16px 18px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 15px; font-weight: 800; }
.panel-head .hint { font-size: 12px; color: var(--ink-3); }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

/* ---------------- 图表 ---------------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 8px 4px 0; }
.chart-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar .bar-wrap { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; gap: 3px; }
.chart-bar .bar { flex: 1; border-radius: 5px 5px 0 0; background: var(--grad-red); min-height: 2px; transition: height .4s; opacity: .92; }
.chart-bar .bar.alt { background: linear-gradient(180deg, #FFD98A, #F2B544); }
.chart-bar .x { font-size: 10.5px; color: var(--ink-3); }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-3); padding: 10px 4px 0; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ---------------- 表格 ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  text-align: left; font-weight: 700; color: var(--ink-3); font-size: 11.5px;
  padding: 10px 14px; background: #FAFAFB; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid #F3F3F5; vertical-align: middle; }
table.table tr:hover td { background: #FCFCFD; }
table.table tr:last-child td { border-bottom: 0; }
.cell-user { display: flex; align-items: center; gap: 9px; }
.cell-user b { font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------------- 表单 / 控件 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 38px; padding: 0 12px; border-radius: 10px; }
.toolbar .grow { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.form-grid .field { margin-bottom: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge.green { background: #EAFBF2; color: #0B8A57; }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.gold { background: var(--gold-soft); color: #A16A0E; }
.badge.blue { background: #EFF4FF; color: #2457D6; }
.badge.gray { background: #F3F4F6; color: var(--ink-2); }
.badge.dark { background: #1F2328; color: #fff; }

/* ---------------- 登录页 ---------------- */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #FF6A55 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 100%, #C8161D 0%, transparent 60%),
              linear-gradient(135deg, #2A0A0C, #7A1116 55%, #C8161D);
  padding: 24px;
}
.login-card {
  width: 380px; background: #fff; border-radius: 22px; padding: 30px 26px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head img { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 12px; }
.login-head h2 { font-size: 20px; font-weight: 800; }
.login-head p { font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: 1px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 0 4px; }
.pager button {
  min-width: 32px; height: 32px; border-radius: 9px; background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); padding: 0 8px;
}
.pager button.active { background: var(--red); color: #fff; border-color: var(--red); }
.pager .total { font-size: 12px; color: var(--ink-3); margin-right: auto; }

/* ---------------- 空态 / 加载 ---------------- */
.admin-empty { padding: 46px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.admin-loading { padding: 40px; display: flex; justify-content: center; }

/* 表格内操作 */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.link-btn { color: var(--red); font-size: 12.5px; font-weight: 600; cursor: pointer; background: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--ink-3); }
.link-btn.danger { color: #B42318; }

/* 紧凑表单弹窗 */
.modal-form .field { margin-bottom: 14px; }
.modal-form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }

/* 双栏 */
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }

@media (max-width: 1100px) {
  :root { --side-w: 72px; }
  .side-brand span, .side-brand b, .side-item span, .side-group-title, .side-foot { display: none; }
  .side-item { justify-content: center; }
  .side-item .count { position: absolute; top: 4px; right: 6px; margin: 0; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  .side-nav { display: flex; padding: 8px; gap: 4px; }
  .side-brand { display: none; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
}

/* v2 admin polish */
body.admin-body { background: #F5F5F8; }
.panel { border-radius: 20px; box-shadow: 0 6px 22px rgba(23, 24, 28, .05); }
.stat-card { border-radius: 20px; }
.btn { border-radius: 999px; }
.btn-primary { background: var(--red); box-shadow: 0 8px 20px rgba(225, 37, 27, .18); }
.btn-primary:hover { background: #CF1F16; }
.side-item.active { background: var(--red-soft); color: var(--red); font-weight: 700; }
table.table th { background: #FAFAFB; color: var(--ink-3); letter-spacing: .3px; }
.topbar h1 { font-size: 18px; letter-spacing: .2px; }
.panel-head h3 { font-size: 15px; letter-spacing: .2px; }
.badge { border-radius: 999px; }
