:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --primary: #3b82f6;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }

header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 14px; color: #cbd3e1; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.statusbar { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: #cbd3e1; }
.field .hint { font-size: 12px; color: var(--muted); }

input[type="text"], input[type="password"], input[type="number"], select {
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  width: 100%;
}

input:focus, select:focus { outline: 2px solid #2b3b5c; border-color: var(--primary); }

.switch { display: flex; align-items: center; gap: 8px; }
.switch input { width: 16px; height: 16px; accent-color: var(--primary); }

button {
  border: 1px solid var(--line);
  background: #1d2230;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}
button:hover { border-color: #3a4256; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.ghost { background: transparent; }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.sticky { position: sticky; bottom: 0; background: rgba(15, 17, 21, .92); padding: 12px 0; backdrop-filter: blur(4px); }

.muted { color: var(--muted); font-size: 13px; }
.num { width: 110px; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin: 0; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.login-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-card h2 { margin: 0; }
.login-card p { margin: 0; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td.reason { white-space: normal; max-width: 340px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid;
}
.badge.success { color: var(--ok); border-color: #1d4d33; background: #12261b; }
.badge.failed { color: var(--bad); border-color: #5a2222; background: #261414; }
.badge.expired { color: var(--warn); border-color: #5a4418; background: #241b0d; }
.badge.source { color: var(--muted); border-color: var(--line); background: #12151c; }
