:root {
  color-scheme: dark;
  --bg-1: #0d1024;
  --bg-2: #191c3d;
  --bg-3: #23264d;
  --card: rgba(32, 35, 72, 0.82);
  --card-strong: rgba(36, 41, 83, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #edf2ff;
  --text-soft: rgba(237, 242, 255, 0.7);
  --text-faint: rgba(237, 242, 255, 0.42);
  --primary: #32d6ff;
  --primary-2: #7d47ff;
  --success: #84e950;
  --danger: #ff6b82;
  --shadow: 0 18px 60px rgba(5, 8, 28, 0.5);
  --font-sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Fira Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(50, 214, 255, 0.18), transparent 24%),
    radial-gradient(circle at 88% 20%, rgba(125, 71, 255, 0.18), transparent 22%),
    radial-gradient(circle at 50% 86%, rgba(50, 214, 255, 0.12), transparent 24%),
    linear-gradient(135deg, var(--bg-1) 0%, #17183a 42%, var(--bg-3) 100%);
  font-family: var(--font-sans);
}

body::before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  pointer-events: none;
  opacity: 0.18;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: #a478ff;
}

code,
.mono {
  font-family: var(--font-mono);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.bg-orb {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.24;
  pointer-events: none;
}

.orb-a {
  top: -10rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(50, 214, 255, 0.54) 0%, transparent 68%);
}

.orb-b {
  top: 12rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(125, 71, 255, 0.5) 0%, transparent 70%);
}

.orb-c {
  bottom: -11rem;
  left: 28%;
  background: radial-gradient(circle, rgba(50, 214, 255, 0.34) 0%, transparent 70%);
}

.container {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.docs-container {
  padding-bottom: 72px;
}

.hero {
  margin-bottom: 26px;
  text-align: center;
}

.hero-compact {
  margin-bottom: 18px;
}

.hero-kicker {
  margin: 0 0 8px;
  color: rgba(237, 242, 255, 0.48);
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 50px);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #2fd5ff 0%, #4d98ff 45%, #7d47ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card {
  position: relative;
  margin-bottom: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 34%),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.card:hover {
  border-color: rgba(50, 214, 255, 0.16);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.card-head h2 {
  margin: 0 0 6px;
  color: rgba(237, 242, 255, 0.54);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
}

.section-subtitle {
  margin: 0;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.7;
}

.hero-actions,
.section-actions,
.docs-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.instruction-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.85;
}

.instruction-list code {
  padding: 2px 8px;
  border: 1px solid rgba(50, 214, 255, 0.18);
  border-radius: 999px;
  background: rgba(50, 214, 255, 0.08);
  color: #d7f6ff;
  font-size: 0.95em;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: rgba(237, 242, 255, 0.62);
  font-size: 13px;
  font-weight: 600;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: rgba(237, 242, 255, 0.26);
}

input[type="text"]:focus,
textarea:focus {
  border-color: rgba(50, 214, 255, 0.42);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 4px rgba(50, 214, 255, 0.12);
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.75;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.inline-form input {
  flex: 1;
}

.hint {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(50, 214, 255, 0.24);
}

.btn-success {
  color: white;
  background: linear-gradient(135deg, #00b89c, #97d935);
  box-shadow: 0 12px 28px rgba(0, 184, 156, 0.22);
}

.btn-ghost {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: rgba(50, 214, 255, 0.32);
}

.alert {
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  line-height: 1.6;
  font-size: 13px;
  white-space: pre-wrap;
}

.alert-success {
  color: #a7ff6a;
  border-color: rgba(132, 233, 80, 0.25);
  background: rgba(132, 233, 80, 0.12);
}

.alert-error {
  color: #ff8b9d;
  border-color: rgba(255, 107, 130, 0.22);
  background: rgba(255, 107, 130, 0.12);
}

.alert-info {
  color: #8fd9ff;
  border-color: rgba(50, 214, 255, 0.18);
  background: rgba(50, 214, 255, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 26px 20px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.stat-number {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  background: linear-gradient(135deg, #37d4ff 0%, #5887ff 48%, #7d47ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  margin-top: 6px;
  color: rgba(237, 242, 255, 0.45);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
}

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

.task-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

.task-table th {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(237, 242, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.task-table td {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  vertical-align: top;
}

.task-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.status-pending {
  color: rgba(237, 242, 255, 0.8);
  background: rgba(255, 255, 255, 0.09);
}

.status-pending::before {
  background: rgba(237, 242, 255, 0.5);
}

.status-running {
  color: #7ee8ff;
  background: rgba(50, 214, 255, 0.16);
}

.status-running::before {
  background: var(--primary);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.status-success,
.status-completed {
  color: #a7ff6a;
  background: rgba(132, 233, 80, 0.16);
}

.status-success::before,
.status-completed::before {
  background: var(--success);
}

.status-failed,
.status-cancelled {
  color: #ff8b9d;
  background: rgba(255, 107, 130, 0.18);
}

.status-failed::before,
.status-cancelled::before {
  background: var(--danger);
}

.status-neutral {
  color: rgba(237, 242, 255, 0.84);
  background: rgba(255, 255, 255, 0.1);
}

.status-neutral::before {
  background: rgba(237, 242, 255, 0.5);
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

.queue-hint {
  margin-left: 8px;
  color: var(--text-faint);
  font-size: 12px;
}

.text-success {
  color: #9cfb66;
}

.text-danger {
  color: #ff8b9d;
}

.task-id-short {
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.empty-state {
  padding: 32px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--text-faint);
  line-height: 1.7;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
}

.page-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: rgba(50, 214, 255, 0.3);
}

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

.page-info {
  color: var(--text-soft);
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 24, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(1000px, 100%);
  max-height: min(88vh, 920px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: var(--card-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-kicker {
  margin: 0 0 4px;
  color: var(--text-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
}

.modal-title {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: #ff8b9d;
  background: rgba(255, 107, 130, 0.14);
}

.modal-body {
  padding: 24px;
  overflow: auto;
}

.task-id-box,
.code-banner {
  padding: 12px 16px;
  border: 1px solid rgba(50, 214, 255, 0.22);
  border-radius: 12px;
  background: rgba(50, 214, 255, 0.1);
  color: #c9f4ff;
  font-size: 13px;
  word-break: break-all;
}

.progress-wrap {
  margin: 18px 0 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7d47ff 0%, #3fd8ff 50%, #7d47ff 100%);
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
  transition: width 0.4s ease;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 13px;
}

.task-placeholder td {
  color: var(--text-faint);
}

.task-link {
  color: #7fe3ff;
  word-break: break-all;
}

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

.doc-note {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.doc-note h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.doc-bullets {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.75;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn {
  flex: 1;
  padding: 14px 12px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(50, 214, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.api-section {
  display: grid;
  gap: 16px;
}

.api-section h3 {
  margin: 0;
  color: #7fe3ff;
  font-size: 24px;
}

.api-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.api-method {
  padding: 6px 12px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.api-method.post {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.api-method.get {
  background: linear-gradient(135deg, #00b89c, #97d935);
}

.api-endpoint {
  color: var(--text);
  font-size: 15px;
}

.api-limit {
  color: var(--text-faint);
  font-size: 13px;
}

.code-block {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(6, 10, 28, 0.52);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-faint);
  font-size: 12px;
}

.copy-btn {
  padding: 6px 10px;
  border: 1px solid rgba(50, 214, 255, 0.28);
  border-radius: 8px;
  background: rgba(50, 214, 255, 0.14);
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: rgba(237, 242, 255, 0.92);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 380px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(18, 24, 52, 0.96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
  color: var(--text);
  line-height: 1.5;
  font-size: 13px;
}

.toast-success {
  border-color: rgba(132, 233, 80, 0.2);
}

.toast-error {
  border-color: rgba(255, 107, 130, 0.2);
}

.toast-info {
  border-color: rgba(50, 214, 255, 0.2);
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 860px) {
  .container {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .card {
    padding: 20px;
    border-radius: 18px;
  }

  .card-head,
  .progress-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions,
  .docs-meta {
    width: 100%;
  }

  .hero-actions .btn,
  .docs-meta .code-banner {
    width: 100%;
  }

  .inline-form {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
    max-height: 92vh;
  }
}
