:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #12151c;
  --surface-2: #171b24;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f6fb;
  --muted: #a4acba;
  --muted-2: #6f7889;
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, 0.14);
  --ok: #37d67a;
  --warn: #ffb020;
  --bad: #ff5a5f;
  --radius: 12px;
  font-family:
    'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system,
    'Segoe UI', sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(229, 9, 20, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

a {
  color: inherit;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: inherit;
  font-size: 12px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--bad);
  font-size: 12.5px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}
.brand.big {
  font-size: 22px;
  justify-content: center;
}
.brand.big .mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
}

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 21, 28, 0.9);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}
.login-card p {
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.7;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.9);
  backdrop-filter: blur(18px);
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tab {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.tab.active {
  background: var(--accent);
  color: #fff;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hub-url {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-2);
  font-size: 12px;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 80px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 0;
}
h2 {
  margin: 0;
  font-size: 16px;
}
h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

/* ---------- 卡片 ---------- */
.card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 27, 36, 0.8), rgba(18, 21, 28, 0.9));
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card.split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
}
.steps {
  margin: 10px 0 14px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13px;
}
.tips {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.tips p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

/* ---------- 表单 ---------- */
.input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.input {
  resize: vertical;
  line-height: 1.6;
}
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.input.compact {
  width: auto;
  min-width: 130px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.form-grid label.wide {
  grid-column: 1 / -1;
}
.form-grid label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.form-grid input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.form-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.bulk {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.bulk label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
}
.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: #f0121e;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn.sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}
.btn.danger {
  border-color: rgba(255, 90, 95, 0.4);
  background: rgba(255, 90, 95, 0.08);
  color: #ff9b9e;
}

/* ---------- 统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.stat b {
  display: block;
  margin-bottom: 4px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.stat b.small-stat {
  font-size: 15px;
  line-height: 1.5;
  padding: 5px 0;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
}
.stat.hot b {
  color: var(--warn);
}

/* ---------- 列表 ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.row-main {
  min-width: 0;
}
.row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 650;
}
.row-sub {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12px;
  word-break: break-all;
}
.row-side {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted-2);
  text-align: center;
  font-size: 13px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tag.ok {
  border-color: rgba(55, 214, 122, 0.35);
  background: rgba(55, 214, 122, 0.1);
  color: var(--ok);
}
.tag.bad {
  border-color: rgba(255, 90, 95, 0.35);
  background: rgba(255, 90, 95, 0.1);
  color: #ff9b9e;
}
.tag.warn {
  border-color: rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.1);
  color: var(--warn);
}
.tag.accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: #ff9b9e;
}
.tag.off {
  opacity: 0.6;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.switch input {
  accent-color: var(--accent);
}

.code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(18, 21, 28, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.bad {
  border-color: rgba(255, 90, 95, 0.5);
  color: #ffb3b6;
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .top-actions {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .tabs {
    order: 4;
    width: 100%;
  }
  main {
    padding: 18px 12px 60px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card.split {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid label.wide {
    grid-column: auto;
  }
  .bulk {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .row-side {
    justify-content: flex-start;
  }
  .hub-url {
    max-width: 160px;
  }
  h1 {
    font-size: 23px;
  }
}
