:root {
  --bg: #f4f6fb;
  --bg-soft: #eceff6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3e8f0;
  --line-strong: #cdd5e3;
  --text: #1c2434;
  --text-soft: #5a6678;
  --text-faint: #8a94a6;
  --accent: #c98a16;
  --accent-2: #e0792b;
  --accent-ink: #ffffff;
  --accent-soft: #fbf1dd;
  --danger: #d6452f;
  --success: #1f9d5b;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, p {
  margin: 0;
}

code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.4em;
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(140deg, #f1c06a, var(--accent) 55%, var(--accent-2));
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

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

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

.badge {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
  align-items: start;
}

.config-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 26px 26px;
  box-shadow: var(--shadow);
}

.section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: none;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.step {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.section-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.section-head p {
  font-size: 13px;
  color: var(--text-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.field-label em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

input[type="text"], textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

input[type="text"]::placeholder, textarea::placeholder {
  color: var(--text-faint);
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 138, 22, 0.14);
  background: var(--surface);
}

.field.invalid input[type="text"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 69, 47, 0.12);
}

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

.field.invalid .hint {
  color: var(--danger);
}

.toggle-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.toggle-row:hover {
  border-color: var(--line-strong);
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 6px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.toggle-row input:checked + .checkbox {
  background: linear-gradient(140deg, #f1c06a, var(--accent) 55%, var(--accent-2));
  border-color: var(--accent);
}

.toggle-row input:checked + .checkbox::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toggle-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.toggle-text small {
  font-size: 12px;
  color: var(--text-faint);
}

.toggle-row input:focus-visible + .checkbox {
  box-shadow: 0 0 0 3px rgba(201, 138, 22, 0.18);
}

.sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary-card, .build-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.project-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.summary-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.summary-head p {
  font-size: 12px;
  color: var(--text-soft);
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.summary-meta span {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

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

.last-build {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.last-build .lb-label {
  color: var(--text-soft);
}

.last-build a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.last-build a:hover {
  text-decoration: underline;
}

.last-build .lb-meta {
  color: var(--text-faint);
}

.build-card .build-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.build-card h3 {
  font-size: 15px;
  font-weight: 700;
}

.build-card p {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}

.build-actions {
  display: flex;
}

.footnote {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s, background 0.15s, border-color 0.15s;
}

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

.btn.primary {
  background: linear-gradient(140deg, #f1c06a, var(--accent) 55%, var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

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

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.btn.primary.block {
  width: 100%;
  padding: 12px 16px;
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.small {
  padding: 7px 13px;
  font-size: 13px;
}

.btn.ghost.small {
  background: var(--surface-2);
}

.hidden {
  display: none !important;
}

.build-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 38, 0.42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
  animation: fade 0.18s ease;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.build-modal {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.22);
  padding: 24px;
}

.ai-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 28px 40px;
}

.ai-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.build-modal-head, .ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ai-head p {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 6px;
}

.build-kicker, .ai-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.ai-kicker {
  text-transform: none;
  letter-spacing: 0;
}

.build-modal-head h2, .ai-head h2 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}

.icon-close {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.icon-close:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}

.icon-close:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.build-progress-block {
  margin-bottom: 20px;
}

.build-percent-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.build-percent {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
}

.build-timer {
  font-size: 13px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 1.5%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1c06a, var(--accent) 55%, var(--accent-2));
  transition: width 0.25s ease;
}

.build-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.build-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  flex: 1 1 auto;
  min-width: 0;
}

.build-step .step-dot {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.build-step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.build-step.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.build-step.done .step-dot {
  border-color: var(--success);
  background: var(--success);
}

.build-step.done .step-dot::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.build-step.failed {
  border-color: var(--danger);
  background: #fdeceb;
}

.build-step.failed .step-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.build-step strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.build-step small {
  display: none;
  font-size: 12px;
  color: var(--text-faint);
}

.wizard-pages {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 22px;
  min-height: 320px;
}

.wizard-page {
  display: none;
}

.wizard-page.active {
  display: block;
  animation: fade 0.18s ease;
}

.wizard-page-head {
  margin-bottom: 18px;
}

.wizard-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.wizard-page-head h3 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}

.wizard-page-head p {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 6px;
}

.build-log-head, .ai-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.build-log-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
}

.build-log, .ai-log, .ai-stream {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 14px;
}

.build-log {
  max-height: 200px;
  overflow-y: auto;
}

.ai-log {
  max-height: 240px;
  overflow-y: auto;
}

.ai-stream {
  max-height: 320px;
  overflow-y: auto;
  color: var(--text);
  background: #fcfaf5;
  border-color: var(--accent-soft);
}

.build-result {
  margin-bottom: 16px;
  font-size: 14px;
}

.build-result .result-ok {
  color: var(--success);
  font-weight: 600;
}

.build-result .result-fail {
  color: var(--danger);
  font-weight: 600;
}

.build-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.build-modal-foot span {
  font-size: 12px;
  color: var(--text-faint);
}

.ai-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.ai-tab {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 10px 4px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.ai-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ai-tab-panel .field-row {
  margin-bottom: 16px;
}

.ai-prompt {
  min-height: 76px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border-right: 1px solid var(--line);
}

.segmented label:last-child span {
  border-right: none;
}

.segmented input:checked + span {
  background: var(--accent);
  color: var(--accent-ink);
}

.segmented input:focus-visible + span {
  box-shadow: inset 0 0 0 3px rgba(201, 138, 22, 0.2);
}

.ai-req-block {
  margin-bottom: 16px;
}

.ai-req-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 12px;
  margin-top: 8px;
}

.ai-req-toggles .toggle-row {
  padding: 9px 11px;
}

.ai-req-toggles .toggle-text small {
  font-size: 11px;
}

.ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.ai-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
}

.ai-status.done {
  color: var(--success);
  background: #e7f6ee;
}

.ai-status.failed {
  color: var(--danger);
  background: #fdeceb;
}

.ai-stream-wrap .ai-stream-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.ai-result-foot {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--text);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
}

.result-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 28px 40px;
}

.result-section .ai-head {
  margin-bottom: 22px;
}

.gen-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.form-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-step {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  flex: 1 1 auto;
  min-width: 0;
}

.form-step .step-dot {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.form-step strong {
  font-size: 13px;
  font-weight: 600;
}

.form-step.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.form-step.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.form-step.done .step-dot {
  border-color: var(--success);
  background: var(--success);
}

.form-step.done .step-dot::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin: 1px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-pages {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 24px;
}

.form-page {
  display: none;
}

.form-page.active {
  display: block;
  animation: fade 0.18s ease;
}

.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.form-error {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.result-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

.api-list-wrap {
  margin-bottom: 4px;
}

.api-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}

.api-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px 14px 4px;
}

.api-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.api-item-head .api-name {
  flex: 1 1 auto;
}

.api-remove {
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.api-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn.small {
  padding: 8px 14px;
  font-size: 13px;
}

.field-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.field-hint {
  font-size: 12.5px;
  color: var(--accent);
}

.field-hint.hidden { display: none; }

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
  }
  .toggle-list, .field-row, .ai-req-toggles {
    grid-template-columns: 1fr;
  }
  .config-panel {
    padding: 4px 18px 20px;
  }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 360px;
  max-width: 92vw;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 30px 28px;
  box-shadow: 0 10px 30px rgba(20, 20, 40, 0.06);
}

.login-card h2 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.login-sub {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 20px;
}

.btn.block {
  width: 100%;
  margin-top: 8px;
}

.admin-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.admin-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge {
  font-size: 13px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
}

.admin-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1 1 260px;
}

.admin-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
  font-size: 14px;
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table th {
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}

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

.admin-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-faint);
}

.status-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.status-tag.ok { background: #e8f7ee; color: var(--success); }
.status-tag.bad { background: #fdecec; color: var(--danger); }
.status-tag.run { background: #eef3ff; color: var(--accent); }
.status-tag.q { background: var(--surface-2); color: var(--text-soft); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-card {
  width: 560px;
  max-width: 94vw;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 22px 24px 26px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 { margin: 0; font-size: 19px; }

.modal-body { font-size: 14px; }

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.detail-row span { color: var(--text-soft); }

.detail-block {
  margin-top: 16px;
}

.detail-block > span {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-block p {
  margin: 0;
  line-height: 1.6;
}

.api-view {
  margin: 0;
  padding-left: 18px;
}

.api-view li {
  margin-bottom: 10px;
}

.api-doc, .api-key {
  font-size: 12.5px;
  color: var(--text-soft);
  word-break: break-all;
}

.detail-actions {
  margin-top: 18px;
}

.btn-del {
  color: var(--danger);
  border-color: #f3c9c9;
}

.btn-del:hover {
  background: #fdecec;
  border-color: var(--danger);
}

.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 24px 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted, #98a2b3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.site-footer a {
  color: var(--accent, #5b8cff);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover {
  text-decoration: underline;
}
.site-footer .copyright {
  color: var(--muted, #98a2b3);
}

.site-footer .icp {
  color: var(--muted, #98a2b3);
  text-decoration: none;
  margin-left: 4px;
}
.site-footer .icp:hover {
  color: var(--accent, #5b8cff);
  text-decoration: underline;
}
