/* Leo2API admin overrides on top of Tabler (MIT) — dark theme */
:root {
  --leo-accent: #2cc7aa;
  --leo-accent-2: #33a1ff;
  --leo-danger: #e16068;
  --leo-warn: #f0c040;
  --leo-muted: #a8bfd8;
  --leo-dim: #7f96ad;
}

body {
  background: radial-gradient(circle at 15% 0%, #132a42 0%, #0b131e 45%, #080d14 100%);
  background-attachment: fixed;
}

/* ── Navbar ─────────────────────────────── */
.leo-navbar {
  background: rgba(10, 18, 28, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(142, 181, 221, 0.14);
}
.leo-brand-mark {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(44, 199, 170, 0.5));
}
.leo-brand-sub {
  color: var(--leo-muted);
  font-size: 13px;
  margin-left: 8px;
}
.leo-nav-link {
  color: var(--leo-muted) !important;
  border-radius: 8px;
  padding: 0.5rem 0.75rem !important;
}
.leo-nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Tabs ───────────────────────────────── */
.leo-tabs .nav-link,
.leo-config-tabs .nav-link {
  color: var(--leo-muted);
  border: 1px solid rgba(142, 181, 221, 0.18);
  background: rgba(13, 25, 38, 0.5);
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
}
.leo-tabs .nav-link.active,
.leo-config-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(44, 199, 170, 0.9), rgba(51, 161, 255, 0.85));
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(44, 199, 170, 0.28);
}

/* Tab panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.config-cat-pane { display: none; }
.config-cat-pane.active { display: block; }

/* ── Cards ──────────────────────────────── */
.card {
  background: rgba(13, 25, 38, 0.78);
  border: 1px solid rgba(142, 181, 221, 0.16);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(142, 181, 221, 0.12);
}

.token-dashboard-body {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.quick-actions-panel {
  display: flex;
  align-items: center;
  min-height: 118px;
}

.token-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.token-dashboard-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 16px 18px;
  border: 1px solid rgba(44, 199, 170, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 8%, rgba(44, 199, 170, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(15, 40, 61, 0.95), rgba(8, 20, 33, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.22);
}

.token-dashboard-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(44, 199, 170, 0.55), transparent);
}

.token-dashboard-label {
  display: block;
  color: #a8bfd8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.token-dashboard-value {
  display: block;
  margin-top: 10px;
  color: #f1fbff;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.token-dashboard-hint {
  display: block;
  margin-top: 10px;
  color: #62d9c6;
  font-size: 12px;
}

/* ── Status badges ──────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}
.status-active { background: rgba(44, 199, 170, 0.14); color: #4de2c4; border-color: rgba(44, 199, 170, 0.35); }
.status-disabled { background: rgba(127, 150, 173, 0.14); color: #a8bfd8; border-color: rgba(127, 150, 173, 0.3); }
.status-exhausted { background: rgba(240, 192, 64, 0.12); color: #ffca58; border-color: rgba(240, 192, 64, 0.3); }
.status-invalid { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-error { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-abnormal { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-pending { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; border-color: rgba(51, 161, 255, 0.35); }
.status-temporary_unavailable { background: rgba(240, 192, 64, 0.12); color: #ffca58; border-color: rgba(240, 192, 64, 0.3); }
.status-reserved { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; border-color: rgba(51, 161, 255, 0.35); }
.status-rate_limited { background: rgba(240, 120, 64, 0.14); color: #ff9e64; border-color: rgba(240, 120, 64, 0.35); }
.status-succeeded { background: rgba(44, 199, 170, 0.14); color: #4de2c4; border-color: rgba(44, 199, 170, 0.35); }

/* ── Token row controls ─────────────────── */
.switch-btn {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(127, 150, 173, 0.35);
  background: rgba(127, 150, 173, 0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch-btn.on { background: rgba(44, 199, 170, 0.55); border-color: rgba(44, 199, 170, 0.6); }
.switch-btn.off { background: rgba(127, 150, 173, 0.12); }
.switch-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.switch-btn.on .switch-knob { left: 20px; }
.switch-text { margin-left: 8px; font-size: 12px; color: var(--leo-muted); }

.action-mini {
  background: rgba(51, 161, 255, 0.12);
  color: #7cc0ff;
  border: 1px solid rgba(51, 161, 255, 0.3);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
  white-space: nowrap;
}
.action-mini:hover { background: rgba(51, 161, 255, 0.25); }
.action-mini.danger { background: rgba(225, 96, 104, 0.12); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.3); }
.action-mini.danger:hover { background: rgba(225, 96, 104, 0.25); }
.action-mini:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Logs ───────────────────────────────── */
.log-row-running td { background: rgba(51, 161, 255, 0.05) !important; }
.log-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid rgba(127, 150, 173, 0.28);
  background: rgba(127, 150, 173, 0.12);
  color: var(--leo-muted);
}
.log-type-badge.image-text {
  background: rgba(51, 161, 255, 0.14);
  color: #7cc0ff;
  border-color: rgba(51, 161, 255, 0.34);
}
.log-type-badge.image-ref {
  background: rgba(44, 199, 170, 0.14);
  color: #4de2c4;
  border-color: rgba(44, 199, 170, 0.34);
}
.log-type-badge.video {
  background: rgba(240, 192, 64, 0.12);
  color: #ffca58;
  border-color: rgba(240, 192, 64, 0.3);
}
.log-size-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 78px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid rgba(127, 150, 173, 0.28);
  background: rgba(127, 150, 173, 0.12);
  color: #b9c9dc;
}
.log-size-tier-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.log-size-tier-badge.tier-1k {
  background: rgba(44, 199, 170, 0.12);
  color: #4de2c4;
  border-color: rgba(44, 199, 170, 0.3);
}
.log-size-tier-badge.tier-2k {
  background: rgba(51, 161, 255, 0.14);
  color: #7cc0ff;
  border-color: rgba(51, 161, 255, 0.34);
}
.log-size-tier-badge.tier-4k {
  background: rgba(240, 192, 64, 0.12);
  color: #ffca58;
  border-color: rgba(240, 192, 64, 0.3);
}
.log-state-btn {
  background: rgba(44, 199, 170, 0.12);
  color: #4de2c4;
  border: 1px solid rgba(44, 199, 170, 0.3);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.log-state-btn.failed {
  background: rgba(225, 96, 104, 0.12);
  color: #ffb4bc;
  border-color: rgba(225, 96, 104, 0.3);
}
.log-prompt-btn {
  background: none;
  border: none;
  color: var(--leo-accent-2);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-prompt-btn:hover { text-decoration: underline; }
.log-size-transform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.log-size-transform .size-before { color: #7f96ad; }
.log-size-transform .size-arrow { color: #f5b544; font-weight: 700; }
.log-size-transform .size-after { color: #e7f1fd; font-weight: 600; }
.log-preview-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.log-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #2a3f56;
  cursor: zoom-in;
  background: #16222f;
  transition: transform 0.12s, border-color 0.12s;
}
.log-thumb:hover { transform: scale(1.06); border-color: #3d76c4; }
.log-origin-link { font-size: 12px; color: #6ea8dc; white-space: nowrap; }
.log-origin-link:hover { text-decoration: underline; }
.preview-btn { cursor: pointer; }

.stats-grid .stat-value { color: #e7f1fd; }
.logs-pagination { align-items: center; }

/* ── Task report ────────────────────────── */
.task-report-status { font-weight: 600; color: var(--leo-accent); }
.task-report-progress-bar { background: linear-gradient(90deg, var(--leo-accent), var(--leo-accent-2)); }
.task-report-items { max-height: 320px; overflow-y: auto; font-size: 13px; }
.task-report-current { color: var(--leo-muted); font-size: 13px; }
.refresh-status { color: var(--leo-muted); font-size: 13px; }
.task-report-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(127, 150, 173, 0.14);
  color: var(--leo-muted);
}
.task-report-badge.success, .task-report-badge.succeeded { background: rgba(44, 199, 170, 0.14); color: #4de2c4; }
.task-report-badge.failed, .task-report-badge.error { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; }
.task-report-badge.pending, .task-report-badge.running { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; }

/* ── Dialogs / modals ───────────────────── */
.dialog-modal,
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1050;
  overflow-y: auto;
  padding: 6vh 16px 40px;
}
.dialog-modal.open,
.preview-modal.open { display: flex; }
.dialog-card {
  width: 100%;
  max-width: 640px;
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 22px;
}
.preview-modal-dialog {
  width: 100%;
  max-width: 860px;
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 22px;
}
.preview-content video, .preview-content img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}
.preview-close { float: right; }
.error-detail-content, .prompt-detail-content {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 13px;
  color: var(--leo-muted);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 10px;
}

/* ── Toast ──────────────────────────────── */
.leo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.25);
  color: #e7f1fd;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1200;
  font-size: 14px;
  max-width: 80vw;
}
.leo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.leo-toast.success { border-color: rgba(44, 199, 170, 0.5); }
.leo-toast.error { border-color: rgba(225, 96, 104, 0.5); }

/* ── Misc ───────────────────────────────── */
.help { color: var(--leo-muted); }
.msg { color: var(--leo-muted); font-size: 13px; }
.leo-pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  color: var(--leo-muted);
}
.leo-hint { color: var(--leo-warn); }
.leo-footer { border-top: 1px solid rgba(142, 181, 221, 0.1); }
.leo-footer a { color: var(--leo-accent-2); text-decoration: none; }
.leo-footer a:hover { text-decoration: underline; }

.empty-state { color: var(--leo-dim); }

/* Tabler form-check inside label needs pointer */
.checkbox-label { cursor: pointer; user-select: none; }

/* ── JS-injected config inputs (built with .input-text / plain label / .help) ── */
.input-text {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4285714286;
  color: var(--tblr-body-color, #e7f1fd);
  background-color: var(--tblr-bg-forms, #0b1522);
  background-clip: padding-box;
  border: var(--tblr-border-width, 1px) solid var(--tblr-border-color, #2a3b52);
  border-radius: var(--tblr-border-radius, 8px);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.input-text:focus {
  border-color: #3f6f9e;
  box-shadow: 0 0 0 0.25rem rgba(51, 161, 255, 0.15);
  outline: none;
}
.input-select {
  background-color: var(--tblr-bg-forms, #0b1522);
  color: var(--tblr-body-color, #e7f1fd);
}
.form-group > label:not(.form-label) {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--tblr-body-color, #e7f1fd);
}
.form-group .form-label { margin-bottom: 0.25rem; }

/* Table tweaks */
.table-vcenter td { vertical-align: middle; }
.card-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Responsive */
@media (max-width: 768px) {
  .leo-brand-sub { display: none !important; }
  .card-header { align-items: flex-start; }
  .token-dashboard-body { grid-template-columns: 1fr; }
  .quick-actions-panel { min-height: auto; }
  .token-dashboard-cards { grid-template-columns: 1fr; }
}

/* ── Image token credit policy ─────────── */
.image-credit-policy-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(74, 222, 222, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(44, 199, 170, 0.18), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(51, 161, 255, 0.16), transparent 30%),
    rgba(8, 20, 32, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.04);
}
.image-credit-policy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.image-credit-policy-eyebrow {
  color: #65f3d0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}
.image-credit-policy-title {
  margin: 4px 0 6px;
  color: #f4fbff;
  font-size: 18px;
  font-weight: 750;
}
.image-credit-policy-desc {
  margin: 0;
  color: #93aeca;
  font-size: 13px;
  line-height: 1.55;
}
.image-credit-policy-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #c7fff0;
  background: rgba(44, 199, 170, 0.12);
  border: 1px solid rgba(44, 199, 170, 0.28);
  font-size: 12px;
  font-weight: 700;
}
.image-credit-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.image-credit-model-card {
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(142, 181, 221, 0.16);
  background: rgba(9, 18, 30, 0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.image-credit-model-card.pro { border-color: rgba(168, 85, 247, 0.26); }
.image-credit-model-card.flash { border-color: rgba(59, 130, 246, 0.26); }
.image-credit-model-card.image2 { border-color: rgba(34, 197, 94, 0.24); }
.model-card-topline { color: #8fb6d8; font-size: 12px; font-weight: 650; }
.model-card-name { margin-top: 3px; color: #ffffff; font-size: 14px; font-weight: 760; word-break: break-word; }
.model-card-alias { margin-top: 4px; color: #6f8aaa; font-size: 12px; }
.tier-input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.tier-input-grid label { display: block; margin: 0; }
.tier-input-grid label span { display: block; margin-bottom: 5px; color: #9eb8d0; font-size: 12px; font-weight: 700; }
.tier-input-grid .input-text { text-align: center; padding-left: 6px; padding-right: 6px; border-radius: 10px; }
@media (max-width: 1100px) { .image-credit-policy-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .image-credit-policy-head { flex-direction: column; } .tier-input-grid { grid-template-columns: 1fr; } }
/* ─── Test Image Generation Modal ─── */
.test-image-card {
  max-width: 960px;
}
.test-image-layout {
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.test-image-left {
  flex: 0 0 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
}
.test-image-left textarea {
  resize: vertical;
  min-height: 160px;
}
.test-image-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.test-image-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 340px;
  border: 1px dashed rgba(142, 181, 221, 0.3);
  border-radius: 12px;
  background: rgba(16, 27, 43, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.test-image-placeholder {
  color: #7f96ad;
  font-size: 0.9rem;
}
.test-image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.test-image-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(142, 181, 221, 0.25);
  border-top-color: #4de2c4;
  animation: test-image-spin 0.9s linear infinite;
}
@keyframes test-image-spin {
  to { transform: rotate(360deg); }
}
.test-image-elapsed {
  font-size: 1.15rem;
  font-weight: 600;
  color: #e6f0fa;
  font-variant-numeric: tabular-nums;
}
.test-image-result {
  max-width: 100%;
  max-height: 420px;
  border-radius: 10px;
  object-fit: contain;
}
.test-image-error {
  color: #ffb4bc;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 100%;
  overflow: auto;
}
.test-image-meta {
  min-height: 1.2em;
}
@media (max-width: 760px) {
  .test-image-layout { flex-direction: column; }
  .test-image-left { flex: none; max-width: none; width: 100%; }
}
.test-image-account-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(77, 226, 196, 0.35);
  background: rgba(77, 226, 196, 0.08);
  border-radius: 10px;
  font-size: 0.88rem;
}
.test-image-account-badge strong { color: #4de2c4; word-break: break-all; }

/* ── LeoApp 增补 ─────────────────────────────
   与 Leo2API 共用同一套配色与卡片样式，
   只补齐本项目独有的表格、结果卡、toast。
   ─────────────────────────────────────────── */

.leo-login-brand {
  background: linear-gradient(135deg, var(--leo-accent), var(--leo-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.leo-table {
  --tblr-table-bg: transparent;
  color: #dbe7f3;
}
.leo-table > :not(caption) > * > * {
  border-bottom-color: rgba(142, 181, 221, 0.12) !important;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.leo-table thead th {
  color: var(--leo-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.leo-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.msg {
  font-size: 13px;
  min-height: 18px;
}

.leo-result-card {
  border: 1px solid rgba(142, 181, 221, 0.16);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 18, 28, 0.6);
}
.leo-result-card img {
  display: block;
  width: 100%;
  height: auto;
}

.leo-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(16, 30, 45, 0.96);
  border: 1px solid rgba(44, 199, 170, 0.5);
  color: #d9f5ee;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: leo-toast-in 0.16s ease-out;
}
.leo-toast-error {
  border-color: rgba(225, 96, 104, 0.6);
  color: #ffd9dc;
}
@keyframes leo-toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.navbar .nav-link#logoutBtn:hover { color: var(--leo-danger) !important; }

.card-table { margin-bottom: 0; }
textarea.form-control { resize: vertical; }

/* ── 筛选栏 / 分页 / 预览 ───────────────── */
.leo-filter-bar { padding: 0.75rem 1rem; }
.leo-search { max-width: 190px; }
.leo-select { max-width: 140px; }
.leo-jump { width: 72px; }

.leo-thumb {
  display: block;
  width: 100%;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.leo-thumb:hover { opacity: 0.85; }

.leo-preview-img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
}

.leo-pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(8, 14, 22, 0.7);
  border: 1px solid rgba(142, 181, 221, 0.14);
  border-radius: 8px;
  padding: 12px;
  font-size: 12.5px;
  color: #c7d9ec;
  max-height: 60vh;
  overflow: auto;
}

.leo-snip {
  cursor: pointer;
  border-bottom: 1px dashed rgba(142, 181, 221, 0.4);
}
.leo-snip:hover { color: var(--leo-accent); }

.leo-err { cursor: pointer; }
.leo-err:hover { text-decoration: underline; }

.leo-result-card img { border-radius: 10px; }

.leo-config-tabs .nav-link { font-size: 13px; padding: 0.4rem 0.9rem; }
.cfg-pane { display: none; }
.cfg-pane.active { display: block; }

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

.leo-table td { vertical-align: middle; }

/* 操作列：3 列网格，紧凑但不溢出 */
.leo-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.leo-actions .btn {
  padding: 0.08rem 0.1rem;
  font-size: 11px;
  line-height: 1.35;
  width: 100%;
  overflow: hidden;
}
.leo-table { table-layout: fixed; width: 100%; }
.card-body .table-responsive { overflow-x: hidden; }
.leo-table td:nth-child(2) { word-break: break-all; }
.leo-table td small, .leo-table td .small { font-size: 11.5px; }
.leo-table td, .leo-table th { overflow: hidden; text-overflow: ellipsis; }

/* 日志表：列多，允许横向滚动，且不固定布局 */
.leo-log-table { table-layout: auto; min-width: 1080px; }
.leo-table-scroll { overflow-x: auto; }
.leo-log-table td, .leo-log-table th {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.leo-log-table .leo-snip { white-space: normal; display: block; max-width: 190px; }
.leo-log-table td:nth-child(7) { white-space: normal; word-break: break-all; }

/* 失败徽章可点击查看错误详情 */
.leo-fail-btn {
  border: 0;
  cursor: pointer;
  text-decoration: underline dotted;
}
.leo-fail-btn:hover { filter: brightness(1.3); }

/* ── 请求日志页（1:1 对齐 leo2api：统计卡 / 状态徽章 / 账号 / 模型） ── */
.stat-card { border: 1px solid rgba(127, 150, 173, 0.22); background: rgba(13, 25, 38, 0.6); }
.stat-card .stat-value { font-weight: 700; }
.log-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.log-state.running { color: #7cc0ff; }
.log-state.success { color: #4de2c4; }
.log-state.failed { color: #ffb4bc; }
.log-account-email { color: #c7d0e0; }
.log-model-name { color: #c7d0e0; font-weight: 600; }
.log-time-cell .date { color: #7f96ad; }
.log-prompt-cell { max-width: 220px; }
