:root {
  --bg: #0f1419;
  --bg-soft: #171e26;
  --panel: #1c2530;
  --line: #2a3542;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3dd6c6;
  --accent-2: #f0b429;
  --danger: #ff6b6b;
  --ok: #62d26f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(240, 180, 41, 0.1), transparent 50%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
}

.brand {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
}

.sub, .gate-desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.gate-panel {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(28,37,48,0.96), rgba(23,30,38,0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.gate-panel label {
  display: block;
  margin: 22px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.gate-panel input,
.top-actions input,
.api-url {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: 500 14px/1.4 var(--mono);
  outline: none;
}

.gate-panel input:focus,
.top-actions input:focus {
  border-color: rgba(61, 214, 198, 0.7);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.15);
}

.gate-panel button,
button.copy,
button.ghost,
.tabs button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
}

.gate-panel button {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3dd6c6, #2bb3a8);
  color: #06231f;
  font-weight: 700;
  font-size: 15px;
}

.gate-panel button:hover { filter: brightness(1.05); }
.error { margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.app {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.top {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 28px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: min(420px, 100%);
}

.top-actions input { flex: 1; }

button.ghost {
  white-space: nowrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

button.ghost:hover {
  color: var(--text);
  border-color: #445366;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tabs button {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.tabs button.active,
.tabs button:hover {
  color: #06231f;
  background: var(--accent);
  border-color: transparent;
}

.section {
  margin-bottom: 28px;
  scroll-margin-top: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.api-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(28, 37, 48, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.api-name {
  font-weight: 600;
  font-size: 14px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
}

.tag.warn {
  background: rgba(240, 180, 41, 0.14);
  color: var(--accent-2);
}

.tag.parser {
  background: rgba(120, 170, 255, 0.14);
  color: #8eb7ff;
}

.api-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b7c7d8;
  background: rgba(15, 20, 25, 0.7);
}

button.copy {
  padding: 10px 14px;
  border-radius: 10px;
  background: #243140;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}

button.copy:hover { border-color: var(--accent); color: var(--accent); }
button.copy.done {
  background: rgba(98, 210, 111, 0.15);
  border-color: rgba(98, 210, 111, 0.4);
  color: var(--ok);
}

footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #12352f;
  color: #9ff0e4;
  border: 1px solid rgba(61, 214, 198, 0.35);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 20;
  box-shadow: var(--shadow);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 820px) {
  .top { flex-direction: column; align-items: stretch; }
  .top-actions { min-width: 0; }
  .api-card {
    grid-template-columns: 1fr;
  }
  button.copy { width: 100%; }
  footer { flex-direction: column; }
}
