:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2d3a4d;
  --text: #e7edf5;
  --muted: #8b9cb3;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
  background: radial-gradient(ellipse at top, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.search-card {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.input {
  flex: 1;
  height: 44px;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111827;
  color: var(--text);
  font-size: 0.9rem;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
  height: 44px;
  padding: 0 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  min-width: 44px;
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.mode-text {
  color: var(--muted);
  font-size: 0.85rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.quota-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.quota-card .label-sm {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.quota-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quota-card .sub {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.progress {
  height: 6px;
  background: #111827;
  border-radius: 999px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 999px;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.stat-item {
  background: #111827;
  border-radius: 10px;
  padding: 0.75rem;
}

.stat-item .k {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat-item .v {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer code {
  background: #111827;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 560px) {
  .input-row {
    flex-wrap: wrap;
  }

  .input-row .input {
    width: 100%;
    flex: none;
  }

  .btn-primary {
    flex: 1;
  }
}
