:root {
  color-scheme: light;
  --brand: #fb7299;
  --brand-dark: #e25c84;
  --brand-hover: #e25c84;
  --brand-soft: #fdeaf0;
  --link: #d95780;
  --ink: #1f2430;
  --muted: #6b7280;
  --bg: #f4f6f9;
  --sidebar: #111827;
  --line: #e7eaf0;
  --line-strong: #d5dae3;
  --border-soft: #f0f2f5;
  --surface: #fff;
  --surface-soft: #fafbfc;
  --surface-muted: #f8fafc;
  --surface-hover: #fdf7f9;
  --text-soft: #374151;
  --text-faint: #9aa4b2;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --qr-bg: #fff;
  --login-bg:
    radial-gradient(circle at 18% 18%, #ffe3ec 0, transparent 42%),
    radial-gradient(circle at 82% 82%, #e2ebff 0, transparent 42%),
    #f7f8fb;
  --login-card-bg: rgba(255, 255, 255, 0.92);
  --login-card-border: rgba(255, 255, 255, 0.75);
  --login-card-shadow: 0 24px 60px rgba(17, 24, 39, 0.12);
  --error-card-bg: rgba(255, 255, 255, 0.95);
  --error-card-shadow: 0 24px 60px rgba(17, 24, 39, 0.1);
  --glow-a: #ffd1e0;
  --glow-b: #cfe0ff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
}

[data-theme="dark"] {
  color-scheme: dark;
  --brand: #fb7299;
  --brand-dark: #ff8fb1;
  --brand-hover: #e25c84;
  --brand-soft: rgba(251, 114, 153, 0.16);
  --link: #ff8fb1;
  --ink: #e6e9ef;
  --muted: #9aa4b2;
  --bg: #0f131a;
  --sidebar: #090d13;
  --line: #252d3a;
  --line-strong: #3a4454;
  --border-soft: #202836;
  --surface: #151b24;
  --surface-soft: #121821;
  --surface-muted: #1a2130;
  --surface-hover: rgba(251, 114, 153, 0.08);
  --text-soft: #c7ceda;
  --text-faint: #7f8a9c;
  --topbar-bg: rgba(15, 19, 26, 0.9);
  --qr-bg: #fff;
  --login-bg:
    radial-gradient(circle at 18% 18%, rgba(251, 114, 153, 0.12) 0, transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(91, 141, 239, 0.14) 0, transparent 42%),
    #0b0f16;
  --login-card-bg: rgba(21, 27, 36, 0.94);
  --login-card-border: rgba(255, 255, 255, 0.08);
  --login-card-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --error-card-bg: rgba(21, 27, 36, 0.96);
  --error-card-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  --glow-a: #6a2a3c;
  --glow-b: #1f3557;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--brand);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff8fb1, var(--brand));
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(251, 114, 153, 0.35);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  color: #fff;
  font-size: 15px;
}

.brand-text small {
  color: #8b95a7;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #9aa4b2;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.9;
  flex: none;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(251, 114, 153, 0.18);
}

.sidebar-link.active svg {
  color: var(--brand);
  opacity: 1;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #6f7a8b;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1035;
}

.app-main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  line-height: 1;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: none;
}

.theme-menu {
  min-width: 9rem;
  --bs-dropdown-link-active-bg: var(--brand);
  --bs-dropdown-link-active-color: #fff;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.content {
  padding: 24px 28px 48px;
  flex: 1;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  color: var(--ink);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.card-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: #f3a3ba;
  box-shadow: 0 0 0 0.2rem rgba(251, 114, 153, 0.12);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card .card-body {
  padding: 20px 22px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin: 6px 0 2px;
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

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

.stat-unit {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.accent-blue {
  background: #5b8def;
}

.accent-pink {
  background: var(--brand);
}

.accent-green {
  background: #34c38f;
}

.accent-amber {
  background: #f0ad4e;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-primary {
  background: #5b8def;
}

.dot-info {
  background: #38bdf8;
}

.dot-success {
  background: #34c38f;
}

.dot-secondary {
  background: #94a3b8;
}

.dot-warning {
  background: #f0ad4e;
}

.dot-danger {
  background: #ef4444;
}

.dot-dark {
  background: #475569;
}

.dot-muted {
  background: #cbd5e1;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  padding: 12px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 20px;
  border-color: var(--border-soft);
  vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
  background: var(--surface-hover);
}

.table-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.table-link:hover {
  color: var(--brand);
}

.table-subtext {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.badge.rounded-pill {
  padding: 0.36em 0.7em;
  font-weight: 500;
}

.badge-soft {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 500;
}

.progress-thin {
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
}

.progress-thin .progress-bar {
  background: var(--brand);
  border-radius: 999px;
}

.comment-feed {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: inherit;
  text-decoration: none;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item:hover {
  background: var(--surface-hover);
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: none;
}

.feed-avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.feed-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.feed-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.feed-text {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.comment-content {
  color: var(--text-soft);
  line-height: 1.6;
  word-break: break-word;
}

.thread-head {
  display: flex;
  gap: 16px;
}

.thread-content {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.reply-list .reply-item {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.reply-list .reply-item:last-child {
  border-bottom: 0;
}

.reply-current {
  background: var(--surface-hover);
}

.reply-content {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 500;
}

.detail-list dd {
  margin-bottom: 0.6rem;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
  color: var(--muted);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-item.done .timeline-dot {
  border-color: var(--brand);
  background: var(--brand);
}

.timeline-item.done .fw-semibold {
  color: var(--ink);
}

.empty-state {
  padding: 54px 24px;
  text-align: center;
}

.empty-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 2px dashed var(--line-strong);
  border-radius: 50%;
}

.empty-title {
  font-weight: 600;
}

.empty-description {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.log-message {
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.alert {
  border: 0;
}

.login-page,
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--login-bg);
  position: relative;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}

.login-glow-a {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: var(--glow-a);
}

.login-glow-b {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: -100px;
  background: var(--glow-b);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 36px;
  border: 1px solid var(--login-card-border);
  border-radius: 20px;
  background: var(--login-card-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--login-card-shadow);
}

.setup-card {
  max-width: 660px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

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

.brand-mark-lg {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.error-card {
  width: 100%;
  max-width: 560px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--error-card-bg);
  box-shadow: var(--error-card-shadow);
}

.error-code {
  color: var(--brand);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.error-card h1 {
  margin: 12px 0 8px;
  font-size: 22px;
}

.error-card p {
  color: var(--muted);
  margin-bottom: 16px;
}

.error-meta {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-muted);
  font-size: 12px;
  word-break: break-all;
}

.error-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.discover-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discover-ups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discover-up {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.discover-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-muted);
  flex: none;
}

.discover-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
}

.discover-up-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.discover-result {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.discover-result:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.discover-result:has(.discover-check:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.discover-check {
  margin-top: 4px;
  flex: none;
}

.discover-cover {
  width: 160px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-muted);
  flex: none;
}

.discover-cover-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
}

.discover-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.discover-title {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.discover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 12px;
}

.discover-desc {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.discover-id {
  color: var(--text-faint);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 575.98px) {
  .discover-result {
    gap: 10px;
  }

  .discover-cover {
    width: 112px;
  }

  .discover-up {
    flex-wrap: wrap;
  }

  .discover-up .btn {
    width: 100%;
  }
}

@media (min-width: 992px) {
  .app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  .app-shell.sidebar-collapsed .app-main {
    margin-left: 0;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    padding: 12px 18px;
  }

  .content {
    padding: 18px 18px 40px;
  }
}

@media (max-width: 575.98px) {
  .content {
    padding: 16px 14px 32px;
  }

  .page-header h2 {
    font-size: 20px;
  }

  .login-card {
    padding: 26px 22px;
  }
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex: none;
}

.account-avatar-sm {
  width: 34px;
  height: 34px;
}

.account-meta {
  min-width: 0;
}

.qr-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--qr-bg);
  padding: 12px;
}

.qr-wrapper img {
  width: 230px;
  height: 230px;
  max-width: 100%;
}

.proxy-rules-popover {
  --bs-popover-max-width: min(560px, calc(100vw - 2rem));
}

.proxy-rules-popover .popover-body {
  max-height: 60vh;
  overflow-y: auto;
}

.api-endpoint-list {
  display: flex;
  flex-direction: column;
}

.api-endpoint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 15px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.api-endpoint:last-child {
  border-bottom: 0;
}

.api-endpoint[hidden] {
  display: none !important;
}

.api-endpoint:hover,
.api-endpoint:focus-visible {
  background: var(--surface-hover);
  outline: 0;
}

.api-endpoint.active {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1.2;
  flex: none;
}

.api-method-get {
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.11);
}

.api-method-post {
  color: #198754;
  background: rgba(25, 135, 84, 0.13);
}

.api-method-put,
.api-method-patch {
  color: #b26a00;
  background: rgba(255, 165, 0, 0.14);
}

.api-method-delete {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.12);
}

.api-endpoint-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.api-endpoint-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.35;
}

.api-tag {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.api-path {
  color: var(--text-soft);
  font-size: 12px;
  background: transparent;
}

.api-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.api-endpoint-arrow {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 15px;
  flex: none;
}

.api-info-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.api-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--sidebar);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.api-code-sm {
  padding: 10px 12px;
  font-size: 11.5px;
}

.api-conventions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.api-convention-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand);
  vertical-align: 1px;
}

.api-demo-switch .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.api-demo-badge {
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.api-demo-badge-live {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.api-tabs {
  margin-top: 4px;
  border-bottom: 1px solid var(--line);
}

.api-tabs .nav-link {
  padding: 7px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.api-tabs .nav-link:hover {
  color: var(--ink);
}

.api-tabs .nav-link.active {
  border-bottom-color: var(--brand);
  background: transparent;
  color: var(--brand-dark);
}

.api-tab-panel {
  display: none;
  padding-top: 10px;
}

.api-tab-panel.active {
  display: block;
}

.api-textarea {
  min-height: 214px;
  font-size: 12px;
  line-height: 1.6;
}

.api-response {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow: hidden;
}

.api-response-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.api-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.api-status-idle {
  background: var(--surface-muted);
  color: var(--muted);
}

.api-status-ok {
  background: rgba(25, 135, 84, 0.13);
  color: #198754;
}

.api-status-err {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

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

.api-response-body {
  flex: 1;
  min-height: 240px;
  max-height: 420px;
  padding: 14px;
  border-radius: 0;
  background: var(--surface);
  color: var(--text-soft);
  overflow: auto;
}

.api-response-details {
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.api-response-details summary {
  cursor: pointer;
  user-select: none;
}

.api-response-details pre {
  margin-top: 8px;
  max-height: 160px;
  overflow: auto;
}

#api-console {
  scroll-margin-top: 20px;
}

@media (max-width: 575.98px) {
  .api-endpoint {
    padding: 13px 15px;
  }

  .api-endpoint-arrow {
    display: none;
  }

  .api-textarea {
    min-height: 180px;
  }
}

[data-theme="dark"] .api-method-get {
  color: #7ab8ff;
  background: rgba(13, 110, 253, 0.2);
}

[data-theme="dark"] .api-method-post {
  color: #63d79b;
  background: rgba(25, 135, 84, 0.22);
}

[data-theme="dark"] .api-method-put,
[data-theme="dark"] .api-method-patch {
  color: #f0b75c;
  background: rgba(255, 165, 0, 0.2);
}

[data-theme="dark"] .api-method-delete {
  color: #ff8a94;
  background: rgba(220, 53, 69, 0.22);
}

[data-theme="dark"] .api-status-ok,
[data-theme="dark"] .api-demo-badge-live {
  color: #63d79b;
}

[data-theme="dark"] .api-status-err {
  color: #ff8a94;
}
