/* 群组游戏中心 · 管理后台 —— 浅色清爽风格，纯手绘 CSS */
:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --border: #e5e9f0;
  --text: #1f2a3d;
  --text-2: #67718a;
  --accent: #3b82f6;
  --accent-soft: #e8f0fe;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --gray-soft: #eef1f6;
  --shadow: 0 1px 3px rgba(31, 42, 61, .06), 0 6px 18px rgba(31, 42, 61, .05);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, .35);
  vertical-align: middle;
}
.brand .name { display: inline-block; margin-left: 10px; vertical-align: middle; }
.brand .name b { display: block; font-size: 15px; letter-spacing: .5px; }
.brand .name span { font-size: 12px; color: var(--text-2); }
.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 4px;
  border-radius: 10px; border: 0; background: transparent;
  color: var(--text-2); font-size: 14px; width: 100%; text-align: left;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--gray-soft); color: var(--text); }
.nav-item:active { transform: scale(.98); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .foot {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar .foot .who { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { font-size: 20px; letter-spacing: .5px; }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.live .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
  animation: fadeUp .35s ease both;
}
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .sub { font-size: 12px; color: var(--text-2); font-weight: 400; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: fadeUp .35s ease both;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(31,42,61,.07), 0 10px 24px rgba(31,42,61,.08); }
.stat-card .label { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.stat-card .extra { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.stat-card.accent .value { color: var(--accent); }
.stat-card.green .value { color: var(--green); }
.stat-card.amber .value { color: var(--amber); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--text-2); font-weight: 500; font-size: 12.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
.tbl tbody tr { transition: background .15s ease; }
.tbl tbody tr:hover { background: #f8fafd; }
.tbl .num { font-variant-numeric: tabular-nums; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.gray { background: var(--gray-soft); color: var(--text-2); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 7px 14px; font-size: 13px;
  transition: all .16s ease;
}
.btn:hover { border-color: #cdd6e4; background: #f8fafd; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2f74e8; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #c61f1f; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #128a3e; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

input.inp, select.inp, textarea.inp {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 12px; font-size: 13.5px; font-family: inherit; color: var(--text);
  background: #fbfcfe; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input.inp:focus, select.inp:focus, textarea.inp:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
  background: #fff;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-item { flex: 1; min-width: 150px; }
.form-item label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .inp { width: auto; min-width: 200px; }
.toolbar select.inp { min-width: 130px; }
.tabs { display: inline-flex; background: var(--gray-soft); border-radius: 11px; padding: 4px; gap: 2px; }
.tabs button {
  border: 0; background: transparent; padding: 7px 18px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-2); transition: all .16s ease;
}
.tabs button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(31,42,61,.1); }

.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }

/* 开关 */
.switch { position: relative; width: 40px; height: 22px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px; background: #d3dae6;
  transition: background .2s ease; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 柱状图 */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 10px 2px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar {
  width: 70%; border-radius: 4px 4px 2px 2px; background: var(--accent);
  min-height: 2px; opacity: .85;
  transition: height .5s ease, opacity .2s ease;
}
.chart .col:hover .bar { opacity: 1; }
.chart .h { font-size: 10px; color: var(--text-2); margin-top: 5px; }
.chart-note { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-2); margin-top: 4px; }

/* 群卡片 */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.group-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; animation: fadeUp .35s ease both;
  transition: transform .18s ease;
}
.group-card:hover { transform: translateY(-2px); }
.group-card .ghead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.group-card .gtitle { font-size: 15px; font-weight: 600; }
.group-card .gid { font-size: 11.5px; color: var(--text-2); }
.group-card .grow { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 7px; }
.chip { background: var(--gray-soft); border-radius: 7px; padding: 3px 9px; font-size: 12px; }
.gstats { display: flex; gap: 0; margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.gstats .gs { flex: 1; text-align: center; }
.gstats .gs b { display: block; font-size: 16px; }
.gstats .gs span { font-size: 11.5px; color: var(--text-2); }

/* 订单卡片 */
.order-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 14px;
  animation: fadeUp .35s ease both;
}
.order-card.mismatch { border-color: #f3c1c1; background: #fffafa; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.order-head .oid { font-weight: 700; font-size: 15px; }
.order-head .amount { font-size: 16px; font-weight: 700; }
.order-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 20px; font-size: 13px; }
.order-body .k { color: var(--text-2); font-size: 12px; }
.order-actions { display: flex; gap: 10px; margin-top: 13px; }
.order-history { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.order-history summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); user-select: none; }
.order-history summary:hover { color: var(--accent); }

/* 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(24, 32, 48, .42);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: min(460px, 92vw);
  padding: 22px 24px; box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
  animation: zoomIn .22s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes zoomIn { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal .desc { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.modal .form-item { margin-bottom: 12px; }
.modal .form-actions { justify-content: flex-end; margin-top: 18px; }

/* Toast */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #1f2a3d; color: #fff; border-radius: 10px; padding: 11px 18px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(15, 23, 42, .3);
  animation: slideIn .25s ease both; max-width: 360px;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.out { transition: all .3s ease; opacity: 0; transform: translateY(8px); }

.empty { text-align: center; color: var(--text-2); padding: 36px 0; font-size: 13.5px; }
.loading { text-align: center; color: var(--text-2); padding: 30px 0; font-size: 13px; }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 12px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 14px; font-size: 13px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.detail-head .uid { font-size: 12px; color: var(--text-2); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mut { color: var(--text-2); font-size: 12px; }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eef3fb 0%, #f7f9fc 60%, #eef6f1 100%);
}
.login-card {
  background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(31, 42, 61, .12);
  padding: 44px 48px; text-align: center; width: min(420px, 92vw);
  animation: fadeUp .45s ease both;
}
.login-card .logo {
  width: 60px; height: 60px; border-radius: 17px; margin: 0 auto 18px;
  background: var(--accent); color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .35);
}
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-card .widget-box { min-height: 46px; display: flex; align-items: center; justify-content: center; }
.login-card .tip { margin-top: 22px; font-size: 12px; color: var(--text-2); line-height: 1.7; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand .name, .sidebar .nav-item span, .sidebar .foot .who { display: none; }
  .sidebar .brand { padding: 18px 0; text-align: center; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .main { padding: 18px 14px 50px; }
}
