:root {
  --bg: #0b1020;
  --panel: #131a2e;
  --panel-2: #1b2440;
  --text: #e5e9f0;
  --muted: #8b95ad;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --line: #243049;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2b4a 0%, transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 26, 46, 0.6);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.title h1 { margin: 0; font-size: 18px; font-weight: 700; }
.updated { color: var(--muted); font-size: 12px; }

.actions { display: flex; gap: 10px; align-items: center; }
.actions .auto { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
button:hover { border-color: #36507f; }
button.primary { background: #2563eb; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }

.alerts { padding: 16px 24px 0; display: flex; flex-direction: column; gap: 10px; }
.banner {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.banner.danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.banner.success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.4); color: #86efac; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  padding: 20px 24px 40px;
}

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.card.blocked { border-color: rgba(239, 68, 68, 0.5); }
.card.exhausted { border-color: rgba(245, 158, 11, 0.5); }
.card.err { border-color: rgba(239, 68, 68, 0.6); }

.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { margin: 0; font-size: 16px; }
.domain { color: var(--muted); font-size: 12px; margin-top: 2px; }

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.b-ok { color: var(--ok); border-color: rgba(34,197,94,0.4); }
.b-warn { color: var(--warn); border-color: rgba(245,158,11,0.4); }
.b-block { color: var(--danger); border-color: rgba(239,68,68,0.5); }
.b-err { color: #fca5a5; border-color: rgba(239,68,68,0.5); }

.donut { position: relative; width: 150px; height: 150px; margin: 14px auto 6px; }
.donut svg { width: 100%; height: 100%; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-center .pct { font-size: 22px; font-weight: 700; }
.donut-center .rem { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bar { height: 8px; background: #0f1626; border-radius: 999px; overflow: hidden; margin: 6px 0 14px; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }

.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 8px; }
.stats > div { display: flex; flex-direction: column; }
.stats span { color: var(--muted); font-size: 11px; }
.stats b { font-size: 14px; font-weight: 600; }

.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(15, 22, 38, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.note.err { color: #fca5a5; }

.breakdown {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 0 24px 30px; }
