/* ============================================================
   多游戏账号管理后台 · 深色布局
   结构：左侧导航 + 顶部栏 + 内容区卡片；表格为 12/13px 紧凑行
   ============================================================ */

:root {
  --bg: #0b0d10;
  --side: #0e1116;
  --panel: #14181d;
  --panel-2: #171c23;
  --hover: #1b212a;
  --line: #222932;
  --line-2: #2c3540;
  --text: #e7eaee;
  --text-2: #b9c1cb;
  --muted: #7f8a97;
  --accent: #3b7ef0;
  --accent-soft: #16233c;
  --ok: #34c27e;
  --ok-soft: #12291f;
  --warn: #d6a03c;
  --warn-soft: #2a2113;
  --bad: #e0675c;
  --bad-soft: #2b1615;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
::selection { background: #2b4a80; color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a323c; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #354050; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 骨架 ---------- */
.app {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 16px 14px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.brand .dot {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: linear-gradient(140deg, #4c8bf5, #7b5cf0);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700;
}

.nav { padding: 4px 8px 10px; flex: 1; overflow: auto; }
.nav-group { margin-bottom: 14px; }
.nav-title {
  font-size: 11px;
  color: #616c79;
  padding: 6px 8px 6px;
  letter-spacing: .4px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  margin-bottom: 1px;
  white-space: nowrap;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: #1c232c; color: #fff; }
.nav a .ico {
  width: 15px; height: 15px;
  flex: 0 0 15px;
  opacity: .8;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.nav a.on .ico { opacity: 1; }
.nav a .cnt {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.side-foot {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #5c6673;
  line-height: 1.7;
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #0c0f13;
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 12.5px; color: var(--text-2); }
.crumb b { color: var(--text); font-weight: 500; }
.spacer { flex: 1; }

.content { padding: 18px 18px 60px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card > h3 {
  margin: 0;
  padding: 13px 16px 11px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}
.card > h3 .sub { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.card > .body { padding: 0 16px 16px; }
.card > .body.flush { padding: 0; overflow-x: auto; }

/* ---------- 统计卡 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px 12px;
  background: #12161b;
}
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .big { font-size: 22px; font-weight: 600; letter-spacing: .3px; margin-top: 5px; line-height: 1.2; }
.stat .sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat.accent .big { color: #9dc0ff; }

/* ---------- 表格 ---------- */
table.dt { width: 100%; border-collapse: collapse; }
table.dt th {
  text-align: left;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #12161b;
}
table.dt td {
  padding: 9px 12px;
  border-bottom: 1px solid #1a1f26;
  font-size: 12.5px;
  color: var(--text-2);
  vertical-align: middle;
}
table.dt tbody tr:hover > td { background: #161b22; }
table.dt tbody tr:last-child > td { border-bottom: 0; }
table.dt td .name { color: var(--text); font-size: 13px; }
table.dt td .appid { font-family: var(--mono); font-size: 11.5px; color: #93a1b1; }
table.dt .num { font-variant-numeric: tabular-nums; }
table.dt .empty { color: var(--muted); text-align: center; padding: 24px; }

/* ---------- 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--text-2);
  background: #1a2029;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: #1c4433; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: #4a3a1d; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: #4a2523; }
.pill.blue { color: #9dc0ff; background: var(--accent-soft); border-color: #26406b; }
.pill.ghost { background: transparent; }
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; color: #9aa6b4; background: #1b212a; border: 1px solid var(--line);
}

/* ---------- 按钮 ---------- */
button {
  font: inherit;
  color: var(--text-2);
  background: #1a2029;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
button:hover { background: #212936; color: var(--text); border-color: #39434f; }
button:active { transform: translateY(.5px); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); border-color: #2f6ed8; color: #fff; }
button.primary:hover { background: #4a8bf7; border-color: #4a8bf7; }
button.sm { padding: 4px 9px; font-size: 12px; }
button.link {
  background: transparent; border: 0; color: #8fb4ff; padding: 4px 6px;
}
button.link:hover { background: transparent; text-decoration: underline; color: #b6cdff; }

.ops { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 工具条 ---------- */
.bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #12161b;
}
.hint { color: var(--muted); font-size: 11.5px; }
.hint code { color: #9fb3c9; }

/* ---------- 表单 ---------- */
label.f { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #0f1318;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 126, 240, .16); }
input::placeholder, textarea::placeholder { color: #55606d; }
input[type="checkbox"] { accent-color: var(--accent); }

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.grid2 .full { grid-column: 1 / -1; }

/* 展开的配置面板 */
tr.exp > td { background: #10141a; padding: 0; border-bottom: 1px solid var(--line); }
.editor { padding: 16px; }

/* ---------- 顺序列表 ---------- */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sec {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  margin: 0 0 9px; padding: 0;
}
.orderlist { list-style: none; margin: 0; padding: 0; }
.orderlist li {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 5px;
  background: #12161b;
  cursor: grab;
  font-size: 12.5px;
}
.orderlist li:hover { background: #171d25; border-color: var(--line-2); }
.orderlist li.dragging { opacity: .4; }
.orderlist li.over { border-color: var(--accent); background: #16203a; }
.orderlist .idx {
  width: 20px; flex: 0 0 20px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.orderlist .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orderlist .g {
  font-size: 10.5px; color: #93a1b1; background: #1b212a;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px;
}
.orderlist .mv { display: flex; gap: 3px; }
.orderlist .mv button { padding: 1px 6px; font-size: 11px; line-height: 1.5; }

/* ---------- 弹窗 ---------- */
dialog {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  width: min(680px, calc(100vw - 40px));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(4, 6, 9, .72); }
.dh {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.db { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.db .hint { line-height: 1.7; }
.df {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #12161b;
  border-radius: 0 0 12px 12px;
}
.out {
  margin: 0; padding: 11px 13px;
  background: #0b0e12;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #a9b6c4;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  padding: 9px 16px;
  border-radius: 8px;
  background: #1d2530;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s;
  max-width: min(560px, calc(100vw - 32px));
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: #5a2b28; background: #2a1615; color: #ffb3ac; }

.empty { color: var(--muted); font-size: 12.5px; padding: 26px 4px; text-align: center; }

/* ---------- 概览里的说明块 ---------- */
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text-2); word-break: break-all; }

.tipbox {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: #101820;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #9dabb9;
  line-height: 1.75;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 60px minmax(0, 1fr); }
  .brand span.tx, .nav a span.tx, .nav-title, .side-foot { display: none; }
  .nav a { justify-content: center; padding: 9px 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
