:root {
  --bg: #0b1020;
  --bg-soft: #111832;
  --card: #151d38;
  --line: #253054;
  --text: #e8edf9;
  --muted: #8f9cc0;
  --accent: #5b8cff;
  --accent-2: #33d6a6;
  --danger: #ff6b81;
  --warn: #ffc857;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(51, 214, 166, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding: 0 16px 64px;
}

.topbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 4px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(91, 140, 255, 0.5));
}

h1 {
  font-size: 21px;
  margin: 0;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.4px;
}

.status {
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  white-space: nowrap;
}

.status[data-state="on"] {
  color: var(--accent-2);
  border-color: rgba(51, 214, 166, 0.45);
  background: rgba(51, 214, 166, 0.1);
}

.status[data-state="err"] {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.45);
  background: rgba(255, 107, 129, 0.1);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.card-head {
  margin-bottom: 14px;
}

.between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  color: #0b1020;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
}

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

.row.wrap {
  flex-wrap: wrap;
}

.row.compact {
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.hint {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--warn);
}

input,
textarea {
  width: 100%;
  background: #0d1430;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  margin: 6px 0 12px;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #7b6bff);
  border-color: transparent;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.35);
}

.btn.danger:hover {
  background: rgba(255, 107, 129, 0.12);
}

.btn.small {
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 8px;
}

.list {
  display: grid;
  gap: 12px;
}

.sub-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.sub-item.active {
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.25) inset;
}

.sub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-name {
  font-weight: 600;
  font-size: 15px;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.16);
  color: #a9c0ff;
  border: 1px solid rgba(91, 140, 255, 0.3);
  margin-left: 6px;
  vertical-align: 1px;
}

.badge.type {
  background: rgba(51, 214, 166, 0.12);
  color: var(--accent-2);
  border-color: rgba(51, 214, 166, 0.3);
}

.sub-url {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.sub-url code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #b9c6ea;
  background: #0d1430;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  overflow-wrap: anywhere;
  flex: 1 1 320px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.issues {
  border: 1px solid rgba(255, 200, 87, 0.35);
  background: rgba(255, 200, 87, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #ffd67d;
}

.issues ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
  border-bottom: none;
}

td.name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  user-select: none;
}

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

.grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.grid label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

select {
  background: #0d1430;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.small-note {
  font-size: 12px;
  margin: 8px 0 0;
}

.url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(51, 214, 166, 0.28);
  background: rgba(51, 214, 166, 0.07);
  border-radius: 10px;
}

.url-label {
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.5px;
}

.url-bar code {
  flex: 1 1 300px;
  background: #0a1027;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #b9c6ea;
  overflow-wrap: anywhere;
}

.paste-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.015);
}

.paste-box textarea {
  margin: 0 0 10px;
  border-radius: 8px;
}

.name-input {
  width: 100%;
  min-width: 140px;
  padding: 5px 8px;
  font-size: 13.5px;
  border-radius: 7px;
  background: transparent;
  border-color: transparent;
}

.name-input:hover {
  border-color: var(--line);
}

.name-input:focus {
  background: #0d1430;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.16);
}

.editor-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.code {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  background: #0a1027;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  max-height: 460px;
  overflow: auto;
  white-space: pre;
  margin: 0;
  color: #c7d3f2;
}

.muted-card {
  background: rgba(255, 255, 255, 0.02);
}

.steps {
  margin: 10px 0;
  padding-left: 22px;
  color: #c3cdea;
}

.steps li {
  margin: 6px 0;
}

code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(91, 140, 255, 0.12);
  border-radius: 5px;
  padding: 1px 6px;
}

a {
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1c2547;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 50;
  max-width: min(90vw, 520px);
}

.toast[data-kind="error"] {
  border-color: rgba(255, 107, 129, 0.5);
  color: #ffc2cb;
}

.toast[data-kind="ok"] {
  border-color: rgba(51, 214, 166, 0.5);
  color: #b8ffe6;
}

@media (max-width: 640px) {
  body {
    padding: 0 10px 48px;
  }
  .card {
    padding: 16px;
  }
  .topbar {
    padding-top: 18px;
  }
}
