:root {
  --bg0: #0b1220;
  --bg1: #121a2b;
  --bg2: #1a2438;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8eef9;
  --muted: #93a4c3;
  --accent: #2dd4bf;
  --accent2: #38bdf8;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(45, 212, 191, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(56, 189, 248, 0.16), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, #0e1626);
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(26, 36, 56, 0.92), rgba(18, 26, 43, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}
.brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { margin: 0 0 28px; color: var(--muted); font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.form-control {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 22, 0.55);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
textarea.form-control { height: auto; padding: 12px 14px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform .15s, opacity .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(90deg, #14b8a6, #0ea5e9);
  color: #042f2e;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-danger { background: rgba(248, 113, 113, 0.18); color: #fecaca; border: 1px solid rgba(248,113,113,.35); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12px; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(248,113,113,.12); color: #fecaca; border: 1px solid rgba(248,113,113,.3); }
.alert-ok { background: rgba(52,211,153,.12); color: #a7f3d0; border: 1px solid rgba(52,211,153,.3); }

/* Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  text-decoration: none;
}
.userbox { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.userbox strong { color: var(--text); }

.page { padding: 28px 0 48px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.panel {
  background: rgba(18, 26, 43, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-body { padding: 18px; }

.filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: rgba(148, 163, 184, 0.05); }

.code-pill {
  display: inline-flex;
  align-items: center;
  min-width: 72px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
  color: #5eead4;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: ui-monospace, Consolas, monospace;
}
.code-pill.empty {
  background: rgba(148,163,184,.1);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.content-cell {
  max-width: 420px;
  color: #d7e2f5;
  line-height: 1.45;
  word-break: break-all;
}
.muted { color: var(--muted); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge-ok { color: #6ee7b7; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.badge-off { color: #fda4af; border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.1); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}
.pager .btns { display: flex; gap: 8px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: rgba(18, 26, 43, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { margin-top: 8px; font-size: 26px; font-weight: 700; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(560px, 100%);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.modal-head, .modal-foot {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-foot { border-bottom: none; border-top: 1px solid var(--line); justify-content: flex-end; gap: 8px; }
.modal-body { padding: 18px; }
.modal h3 { margin: 0; font-size: 16px; }
.detail-row { margin-bottom: 12px; }
.detail-row .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-row .v { font-size: 14px; word-break: break-all; line-height: 1.5; }
.detail-code {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #5eead4;
  font-family: ui-monospace, Consolas, monospace;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}
.tip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.tip code {
  background: rgba(148,163,184,.12);
  padding: 2px 6px;
  border-radius: 6px;
  color: #c7d2fe;
}
