:root {
  --bg: #0b1020;
  --panel: #131a2e;
  --panel-2: #182140;
  --line: #253054;
  --text: #e8ecf8;
  --muted: #93a0c4;
  --brand: #4f7cff;
  --brand-2: #7c5cff;
  --ok: #2ecc71;
  --warn: #f5a623;
  --err: #ff5d5d;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(1200px 700px at 15% -10%, #1b2b52 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.error { color: var(--err); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 20px; }
.brand p { margin: 2px 0 0; }
.brand.small strong { font-size: 15px; }
.logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 20px;
}

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #101731, #0c1226);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}
#nav { display: flex; flex-direction: column; gap: 4px; }
#nav button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
#nav button:hover { background: #1a2444; color: var(--text); }
#nav button.active {
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.22), rgba(124, 92, 255, 0.18));
  border-color: #35509c;
  color: #fff;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page { padding: 22px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- 通用组件 ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -0.5px; }
.kpi .label { color: var(--muted); font-size: 12.5px; }

button, .btn {
  font: inherit;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #1a2340;
  color: var(--text);
  padding: 8px 13px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
button:hover { filter: brightness(1.15); }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; font-weight: 600; }
button.ghost { background: transparent; }
button.danger { background: #3a1a24; border-color: #6b2b3a; color: #ffb4b4; }
button.tiny { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
button.small-btn { padding: 6px 11px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0e142b;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(79, 124, 255, 0.45); outline-offset: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 550; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.3px; }
tbody tr:hover { background: rgba(79, 124, 255, 0.06); }
.table-wrap { overflow-x: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #101832;
}
.pill.ok { color: #b7f5cf; border-color: #235c3c; background: #0f2a1c; }
.pill.err { color: #ffc4c4; border-color: #6b2b3a; background: #2a1119; }
.pill.warn { color: #ffe0ac; border-color: #6a4d1c; background: #2a2110; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #0a0f1f;
  border: 1px solid var(--line);
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
}
code { font-family: var(--mono); background: #0a0f1f; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }

.bar-track { height: 8px; border-radius: 999px; background: #0d142b; border: 1px solid var(--line); overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, 0.66);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.modal {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
}
.modal h3 { margin-top: 0; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  padding: 11px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #16203c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-width: 420px;
}
.toast.ok { border-color: #235c3c; }
.toast.err { border-color: #6b2b3a; }

/* ---------- 调试台 ---------- */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 标签（审核类别、状态等） ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: #1a2444;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  .play-grid { grid-template-columns: 1fr; }
}