/* 接口测试页专用样式（复用 style.css 的配色变量） */

.tp-body { overflow: hidden; }
.tp-wrap { display: flex; height: 100vh; overflow: hidden; }

/* ---------------- 左侧面板 ---------------- */
.tp-panel {
  width: 352px; flex: 0 0 352px;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  min-width: 0;
}
.tp-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.tp-head h2 { margin: 0 0 10px; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.tp-kv {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.9;
  word-break: break-all;
}
.tp-kv b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500; color: var(--ink-2); font-size: 11.5px;
}
.tp-tip {
  padding: 9px 16px; font-size: 12px; line-height: 1.7;
  color: var(--warn-ink); background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
}
.tp-tip a { color: var(--warn-ink); text-decoration: underline; margin-left: 4px; }

.tp-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px 4px; }

.tp-group { margin-bottom: 14px; }
.tp-group-title {
  font-size: 11.5px; color: var(--ink-3); margin: 0 0 7px;
  letter-spacing: .3px;
}
.tp-btns { display: flex; flex-wrap: wrap; gap: 6px; }

.tb {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; font-size: 12px; font-family: inherit;
  color: var(--ink-2); background: var(--field);
  border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.tb:hover:not(:disabled) { background: var(--surface-4); border-color: var(--ink-3); color: var(--ink); }
.tb:disabled { opacity: .45; cursor: not-allowed; }
.tb.busy { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tb.off {
  color: var(--ink-4); border-color: var(--line);
  background: var(--surface-4); text-decoration: line-through;
}
.tb .tb-use {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; color: var(--ink-3); font-weight: 400;
}
.tb.busy .tb-use { color: rgba(255,255,255,.75); }
.tb.alt { color: var(--ink-2); border-color: var(--line-2); }
.tb.alt:hover:not(:disabled) { background: var(--surface-4); border-color: var(--ink-3); }

/* ---------------- 底部统计 + 日志 ---------------- */
.tp-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px; font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line); background: var(--surface-2);
}
.tp-foot .ok { color: var(--ok); }
.tp-foot .bad { color: var(--danger); }
.tp-foot .btn { margin-left: auto; }

.tp-log {
  height: 190px; margin: 0; padding: 10px 12px;
  background: var(--deep); color: #c9d4e6;
  font-size: 11.5px; line-height: 1.85; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all;
  border-radius: 0;
}
.tp-log .t { color: #5b6b85; }
.tp-log .ok { color: #5ddba0; }
.tp-log .err { color: #ff8b8b; }
.tp-log .req { color: #7fb2ff; }
.tp-log .dim { color: #8b99b0; }

/* ---------------- 地图区 ---------------- */
.tp-map { flex: 1 1 auto; position: relative; background: var(--surface-5); min-width: 0; }
.tp-map #map { position: absolute; inset: 0; }
.tp-mapbadge {
  position: absolute; left: 14px; top: 14px; z-index: 5;
  background: rgba(16, 20, 24, .8); color: #fff;
  font-size: 12px; padding: 6px 12px; border-radius: 8px;
  backdrop-filter: blur(4px);
  max-width: calc(100% - 28px); line-height: 1.5;
}
/* 失败提示里的「重试」：跨境链路下重试一次往往就通了，不用整页刷新 */
.tp-mapbadge .tp-mapretry {
  color: #ffd79a; font-weight: 600; text-decoration: underline;
  margin-left: 4px; white-space: nowrap;
}
.tp-mapbadge .tp-mapretry:hover { color: #fff; }

/* ---------------- 返回数据小窗（JSON） ---------------- */
.tp-json {
  position: absolute; right: 14px; top: 14px; z-index: 6;
  width: min(420px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  display: flex; flex-direction: column;
  background: rgba(16, 20, 24, .93);
  color: #d7e0f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px -18px rgba(16,20,24,.5);
  backdrop-filter: blur(4px);
}
.tp-json-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex: 0 0 auto;
}
.tp-json-title { font-size: 12.5px; font-weight: 600; color: #fff; }
.tp-json-actions { display: flex; gap: 4px; }
.tp-json-actions .icon-btn {
  width: 26px; height: 26px; line-height: 24px;
  background: rgba(255,255,255,.12); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tp-json-actions .icon-btn:hover { background: rgba(255,255,255,.22); }
.tp-json-body {
  flex: 1 1 auto; overflow: auto;
  margin: 0; padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 11.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-all;
  color: #cfe3ff;
}

/* ---------------- 静态图预览 ---------------- */
.tp-preview {
  position: fixed; inset: 0; background: rgba(16,20,24,.5);
  display: flex; align-items: center; justify-content: center; z-index: 80;
}
.tp-preview-inner { position: relative; background: #fff; padding: 8px; border-radius: 12px; }
.tp-preview-inner img { display: block; max-width: 80vw; max-height: 80vh; border-radius: 8px; }
.tp-preview-inner .icon-btn { position: absolute; right: 6px; top: 2px; background: rgba(255,255,255,.9); border-radius: 50%; }

/* ---------------- 额度概览 + 接口明细 ---------------- */
.tp-quota {
  padding: 12px 14px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.tpq-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 7px;
}
.tpq-used { font-size: 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.tpq-progress {
  height: 7px; background: var(--surface-5); border-radius: 999px;
  overflow: hidden; margin-bottom: 7px;
}
.tpq-progress i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .3s; }
.tpq-progress.warn i { background: var(--warn); }
.tpq-progress.danger i { background: var(--danger); }
.tpq-meta { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; line-height: 1.7; }
.tpq-toggle {
  width: 100%; padding: 6px; font-size: 11.5px; color: var(--ink-2);
  background: var(--field); border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer; font-family: inherit;
}
.tpq-toggle:hover { background: var(--surface-4); color: var(--ink); }
.tpq-detail { margin-top: 8px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.tpq-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.tpq-table th, .tpq-table td {
  padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tpq-table th { color: var(--ink-3); font-weight: 520; white-space: nowrap; background: var(--surface-4); position: sticky; top: 0; }
.tpq-table tr:last-child td { border-bottom: none; }
.tpq-name { line-height: 1.45; color: var(--ink); }
.tpq-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; white-space: nowrap; }
.tpq-num.err { color: var(--danger); }

@media (max-width: 900px) {
  .tp-panel { width: 300px; flex-basis: 300px; }
}
