/* CFID 管理后台 · 深色高级风（琥珀 + 青色，无紫） */
:root {
  --bg: #060a12;
  --bg-2: #0a1120;
  --panel: rgba(16, 25, 42, 0.86);
  --panel-solid: #0e1727;
  --panel-2: #121d31;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e8effa;
  --muted: #8493ab;
  --amber: #f5a524;
  --amber-2: #ffc857;
  --cyan: #33dfd2;
  --ok: #38d98a;
  --danger: #ff5f6d;
  --warn: #ffb648;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(245, 165, 36, 0.16), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(51, 223, 210, 0.12), transparent 62%),
    radial-gradient(1200px 700px at 50% 110%, rgba(30, 60, 110, 0.28), transparent 60%),
    linear-gradient(180deg, #060a12 0%, #070d18 40%, #05080f 100%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 32px;
}
.login-card {
  width: min(420px, 92vw);
  background: linear-gradient(160deg, rgba(20, 32, 52, 0.95), rgba(10, 17, 30, 0.96));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(245, 165, 36, 0.22), transparent 65%);
}
.brand-mark {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(140deg, var(--amber), #ffce6a);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #17110a; letter-spacing: 0.5px;
  box-shadow: 0 10px 24px rgba(245, 165, 36, 0.32);
}
.login-card h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: 0.4px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.3px; }
input, select, textarea {
  width: 100%; padding: 11px 13px;
  background: rgba(8, 14, 24, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(245, 165, 36, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.12);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  color: #17110a;
  box-shadow: 0 10px 24px rgba(245, 165, 36, 0.24);
}
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-danger { background: rgba(255, 95, 109, 0.14); color: #ffb3ba; border-color: rgba(255, 95, 109, 0.35); }
.btn-ok { background: rgba(56, 217, 138, 0.14); color: #8ef0bd; border-color: rgba(56, 217, 138, 0.35); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 8px; }

.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.login-foot b { color: var(--amber-2); font-weight: 600; }

/* ---------------- 外壳 ---------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px;
  background: linear-gradient(180deg, rgba(13, 21, 36, 0.96), rgba(8, 13, 23, 0.98));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
  overflow: auto;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.side-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
.side-brand h2 { font-size: 14.5px; margin: 0; letter-spacing: 0.6px; }
.side-brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.4px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #b8c5d8; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-item i { font-style: normal; font-size: 15px; opacity: 0.8; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.on {
  background: linear-gradient(100deg, rgba(245, 165, 36, 0.16), rgba(245, 165, 36, 0.04));
  border-color: rgba(245, 165, 36, 0.32);
  color: #ffe0a6;
}
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.9; padding: 0 6px; }
.side-foot b { color: var(--amber-2); }

.main { padding: 26px 30px 60px; max-width: 1320px; }

.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 21px; margin: 0; letter-spacing: 0.5px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 12.5px; color: #c8d4e6;
}
.chip b { color: var(--amber-2); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------------- 卡片 / 表格 ---------------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: linear-gradient(160deg, rgba(18, 29, 48, 0.9), rgba(11, 18, 31, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 auto auto 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 165, 36, 0.55), transparent);
  opacity: 0.7;
}
.card .k { font-size: 12px; color: var(--muted); letter-spacing: 0.4px; }
.card .v { font-size: 27px; font-weight: 700; margin-top: 8px; letter-spacing: 0.5px; }
.card .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.card .h { font-size: 12px; color: var(--muted); margin-top: 6px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(10px);
  margin-top: 16px;
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 15px; letter-spacing: 0.4px; }
.panel-head .sub { color: var(--muted); font-size: 12px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; padding: 8px 12px; }
.toolbar .grow { flex: 1; }

.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; }
th {
  background: rgba(255, 255, 255, 0.04);
  color: #9fb0c8; font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line); letter-spacing: 0.3px;
}
tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(245, 165, 36, 0.05); }
td.mono, th.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
td .muted { color: var(--muted); }
td.wrap { white-space: normal; min-width: 220px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.b-unused { background: rgba(132, 147, 171, 0.16); color: #b7c3d6; border-color: rgba(132, 147, 171, 0.3); }
.b-active { background: rgba(56, 217, 138, 0.14); color: #8ef0bd; border-color: rgba(56, 217, 138, 0.34); }
.b-disabled, .b-banned { background: rgba(255, 95, 109, 0.14); color: #ffb3ba; border-color: rgba(255, 95, 109, 0.34); }
.b-occupied { background: rgba(255, 182, 72, 0.14); color: #ffd39b; border-color: rgba(255, 182, 72, 0.34); }
.b-warn { background: rgba(255, 182, 72, 0.14); color: #ffd39b; border-color: rgba(255, 182, 72, 0.34); }
.b-draft { background: rgba(132, 147, 171, 0.16); color: #b7c3d6; border-color: rgba(132, 147, 171, 0.3); }
.b-published { background: rgba(51, 223, 210, 0.14); color: #96f2ea; border-color: rgba(51, 223, 210, 0.34); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.pager .spacer { flex: 1; }

.empty { padding: 38px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* 图表 */
.chart { display: flex; align-items: flex-end; justify-content: flex-start; gap: 8px; height: 132px; padding: 8px 4px 22px; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1 1 auto; max-width: 46px; background: linear-gradient(180deg, var(--amber), rgba(245, 165, 36, 0.25)); border-radius: 5px 5px 3px 3px; min-height: 3px; position: relative; }
.chart .bar span { position: absolute; bottom: -18px; white-space: nowrap; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }

/* ---------------- 弹窗 / 提示 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 30; padding: 20px;
}
.modal {
  width: min(560px, 94vw); max-height: 86vh; overflow: auto;
  background: linear-gradient(160deg, #131f34, #0a1322);
  border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--shadow); padding: 22px 22px 18px;
}
.modal h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: 0.4px; }
.modal .desc { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; line-height: 1.7; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 40; }
.toast {
  padding: 12px 16px; border-radius: 12px; font-size: 13px;
  background: rgba(18, 29, 48, 0.96); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); min-width: 220px; max-width: 380px;
  animation: slide 0.22s ease-out;
}
.toast.ok { border-color: rgba(56, 217, 138, 0.5); color: #b9ffd8; }
.toast.err { border-color: rgba(255, 95, 109, 0.5); color: #ffc3c8; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hint { color: var(--muted); font-size: 12.5px; line-height: 1.8; margin: 8px 0 0; }
.hint b { color: var(--amber-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.codes { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.9; background: #08101c; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 260px; overflow: auto; white-space: pre; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  .split, .modal .row { grid-template-columns: 1fr; }
  .grid, .grid.four { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 40px; }
}
