/* ==========================================================
   API Hub · 样式
   主题：参考图卡片式布局 + 蓝白调，支持暗色模式
   ========================================================== */

:root {
  /* Light */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --method-get: #10b981;
  --method-get-bg: #d1fae5;
  --method-post: #3b82f6;
  --method-post-bg: #dbeafe;
  --method-delete: #ef4444;
  --method-delete-bg: #fee2e2;
  --method-put: #f59e0b;
  --method-put-bg: #fef3c7;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #0f172a;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --border-strong: #475569;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-soft: #1e3a8a;
  --success: #34d399;
  --success-soft: #064e3b;
  --warning: #fbbf24;
  --warning-soft: #78350f;
  --danger: #f87171;
  --danger-soft: #7f1d1d;
  --method-get: #34d399;
  --method-get-bg: #064e3b;
  --method-post: #60a5fa;
  --method-post-bg: #1e3a8a;
  --method-delete: #f87171;
  --method-delete-bg: #7f1d1d;
  --method-put: #fbbf24;
  --method-put-bg: #78350f;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main#app {
  flex: 1;
}

/* ==========================================================
   顶部栏
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}

.brand-logo {
  font-size: 20px;
}

.brand-name {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.crumb {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.crumb:hover {
  background: var(--surface-2);
}

.crumb + .crumb::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-tertiary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-tertiary);
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.apikey-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.apikey-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.apikey-box input {
  width: 160px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  outline: none;
}

.apikey-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  cursor: pointer;
  transition: background var(--transition);
}

.apikey-status.active {
  background: var(--success);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ==========================================================
   视图切换
   ========================================================== */
.view {
  padding: 32px 24px;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 200ms ease-out;
}

.view.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   首页 · 卡片网格
   ========================================================== */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.home-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.home-notice {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 180px;
  overflow: hidden;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card.featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-icon-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: var(--radius);
  background: var(--surface-2);
  flex-shrink: 0;
}

.card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: 500;
}

.badge.badge-top {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.badge.badge-featured {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.method-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.method-pill.get, .method-pill.GET { background: var(--method-get-bg); color: var(--method-get); }
.method-pill.post, .method-pill.POST { background: var(--method-post-bg); color: var(--method-post); }
.method-pill.delete, .method-pill.DELETE { background: var(--method-delete-bg); color: var(--method-delete); }
.method-pill.put, .method-pill.PUT { background: var(--method-put-bg); color: var(--method-put); }

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

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

.tag-free {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.card-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  transition: gap var(--transition);
}

.card:hover .card-action {
  gap: 8px;
}

/* ==========================================================
   模块视图 · 端点列表
   ========================================================== */
.module-header {
  margin-bottom: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.back-btn:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}

.module-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.module-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.endpoint-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.endpoint-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.endpoint-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.endpoint-table tr:hover {
  background: var(--surface-2);
}

.endpoint-table td:nth-child(2) {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
}

.endpoint-table td.col-feature {
  font-weight: 600;
  color: var(--text);
}

.endpoint-table td:nth-child(4) {
  color: var(--text-secondary);
}

.endpoint-table .auth-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.endpoint-table .auth-tag.required {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.btn-detail {
  padding: 5px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-detail:hover {
  background: var(--primary);
  color: white;
}

/* ==========================================================
   详情视图 · 左中右布局
   ========================================================== */
.detail-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-copy-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-copy-page:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-copy-page.copied {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.detail-body {
  display: block;
}

.detail-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.detail-right {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.debugger-section {
  margin-top: 0;
}

.debugger-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.endpoint-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.method-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.method-badge.get { background: var(--method-get-bg); color: var(--method-get); }
.method-badge.post { background: var(--method-post-bg); color: var(--method-post); }
.method-badge.delete { background: var(--method-delete-bg); color: var(--method-delete); }
.method-badge.put { background: var(--method-put-bg); color: var(--method-put); }

.endpoint-path {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
}

.endpoint-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.endpoint-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.meta-block {
  margin-top: 24px;
}

.meta-block h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-block p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.param-section {
  margin-bottom: 16px;
}

.param-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.param-table th,
.param-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.param-table th {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  background: var(--surface-2);
}

.param-table td:first-child {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.param-table .type {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.param-table .required {
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
}

.response-example {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  overflow-x: auto;
  margin: 0;
  line-height: 1.6;
}

/* 响应字段说明（responseHints） */
.response-hints {
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.response-hints-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.response-hint-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.response-hint-row:last-child { border-bottom: none; }
.response-hint-key {
  flex: 0 0 auto;
  min-width: 100px;
  padding: 2px 6px;
  background: var(--surface-1);
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--accent);
  text-align: left;
  height: fit-content;
}
.response-hint-text {
  flex: 1;
  color: var(--text-secondary);
}

/* 响应示例 tabs（多种场景切换） */
.response-examples-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.resp-tab {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.resp-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.resp-tab.active {
  color: #fff;
  border-color: transparent;
}
.resp-tab-success.active {
  background: var(--success, #2ea043);
}
.resp-tab-error.active {
  background: #d9534f;
}

/* ==========================================================
   调试器
   ========================================================== */
.debugger-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.debugger-left,
.debugger-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.debugger-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.debugger-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.debug-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.debug-select,
.debug-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.debug-select:focus,
.debug-input:focus {
  border-color: var(--primary);
}

.debug-input[readonly] {
  background: var(--surface-2);
  cursor: not-allowed;
}

/* 调试字段：label + 输入框/textarea */
.debug-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.debug-field-label .field-name {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
}

.debug-field-label .field-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.debug-field input[type="text"],
.debug-field input[type="number"],
.debug-field textarea,
.debug-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  outline: none;
  transition: border-color var(--transition);
}

.debug-field textarea {
  resize: vertical;
  min-height: 220px;
  font-size: 13px;
  line-height: 1.6;
}

.debug-field input:focus,
.debug-field textarea:focus,
.debug-field select:focus {
  border-color: var(--primary);
}

.debug-field input[type="file"] {
  font-size: 12px;
  color: var(--text-secondary);
}

.debug-field .required-mark {
  color: var(--danger);
  margin-left: 2px;
}

.debug-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 12px 0 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-section-title:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.btn-debug-send {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 8px;
}

.btn-debug-send:hover {
  background: var(--primary-hover);
}

.btn-debug-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.debugger-right {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .debugger-right {
  background: #0f172a;
  border-color: #1e293b;
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
}

.response-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.response-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-copy-result {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-copy-result:hover {
  background: #334155;
  border-color: #64748b;
}

.btn-copy-result.copied {
  background: #064e3b;
  border-color: #10b981;
  color: #10b981;
}

.debugger-right .debugger-response {
  flex: 1;
  max-height: 500px;
  overflow: auto;
  border: none;
  background: transparent;
}

.debugger-right .debugger-response .placeholder {
  color: #64748b;
  font-style: italic;
}

.debugger-right .debugger-response .response-meta {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  color: #94a3b8;
}

.debugger-right .debugger-response .response-body {
  color: #e2e8f0;
  background: transparent;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 16px;
}

.debugger-right .debugger-response audio,
.debugger-right .debugger-response img {
  max-width: 100%;
  border-radius: var(--radius);
  margin-top: 12px;
}

/* ==========================================================
   代码示例卡片
   ========================================================== */
.code-tabs {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}

.code-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.btn-copy {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  transition: all var(--transition);
}

.btn-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-copy.copied {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.code-block {
  margin: 0;
  padding: 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--text);
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre;
}

/* ==========================================================
   Toast 提示
   ========================================================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 20px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all 240ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}

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

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 980px) {
  .debugger-layout {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar-left {
    flex: 1 0 auto;
  }
  .topbar-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .search-box {
    width: 100%;
    flex: 1;
  }
  .apikey-box {
    flex: 1;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .view {
    padding: 16px;
  }
  .home-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .apikey-box input {
    width: 100px;
  }
}

/* ==========================================================
   页脚（备案号 + 链接 + 版权）
   ========================================================== */
.site-footer {
  margin-top: 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 28px;
}

.footer-col {
  min-width: 0;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}

.footer-logo {
  font-size: 20px;
  line-height: 1;
}

.footer-name {
  letter-spacing: 0.5px;
}

.footer-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-tertiary);
}

.footer-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links li {
  font-size: 12px;
  line-height: 1.6;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-static {
  color: var(--text-tertiary);
  word-break: break-all;
}

/* 页脚二维码 */
.footer-qrcode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-qr {
  display: block;
  width: 84px;
  height: 84px;
  padding: 3px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  object-fit: contain;
  transition: transform var(--transition), border-color var(--transition);
}

.footer-qr:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.footer-qr-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-copy {
  letter-spacing: 0.3px;
}

.footer-bottom .beian {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-bottom .beian:hover {
  color: var(--text-secondary);
}

.footer-bottom .beian-icon {
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 32px 20px 20px;
  }
}

@media (max-width: 540px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}