:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d22;
  --panel-strong: #1f272d;
  --text: #f5f2eb;
  --muted: #b8c0bc;
  --line: rgba(245, 242, 235, 0.14);
  --accent: #d7ff5f;
  --accent-strong: #7fd1c5;
  --danger: #ff7a7a;
  --ink: #101418;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.9), var(--bg) 520px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: start;
  padding: 32px 0 22px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span,
.label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: rgba(245, 242, 235, 0.06);
  color: var(--text);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(245, 242, 235, 0.06);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.button.primary,
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.button.danger,
button.danger {
  border-color: rgba(255, 122, 122, 0.45);
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.quota {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-height: 90px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 242, 235, 0.045);
}

.stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: var(--accent-strong);
}

.ticket {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(127, 209, 197, 0.28);
  border-radius: 8px;
  background: rgba(127, 209, 197, 0.07);
}

.code {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--accent);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.9rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.ok {
  border-color: rgba(127, 209, 197, 0.45);
  color: var(--accent-strong);
}

.badge.danger {
  border-color: rgba(255, 122, 122, 0.45);
  color: var(--danger);
}

.small-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.small-form input {
  min-width: 80px;
}

@media (max-width: 860px) {
  .hero,
  .grid.two,
  .grid.three,
  .quota {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 32px, 1120px);
  }
}
