/* openapihub 管理后台样式
   设计 token 与组件规范沿用 codexproxydaddy，保持两个后台观感一致。
   仅亮色模式；字体使用系统字体栈，不依赖外部 CDN。 */

:root {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --surface-2: #f1f5f9;
  --surface-hover: #e2e8f0;
  --text-main: #020617;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --primary: #0f172a;
  --primary-hover: #020617;
  --accent: #0369a1;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --success: #047857;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --focus-ring: rgba(3, 105, 161, 0.18);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.05);
  --radius: 8px;
}

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.small { font-size: 0.82rem; }
.hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.muted { color: var(--text-muted); }

::selection { background: rgba(3, 105, 161, 0.16); color: var(--text-main); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.menu-item:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 布局 ---------- */

#app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  /* 宽度由 #app 上的 --sidebar-w 决定（用户可拖拽，存 localStorage）。
     用变量而不是内联 width，是为了让窄屏的媒体查询还能覆盖它。 */
  width: var(--sidebar-w, 260px);
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 侧边栏右缘的拖拽把手：命中区 9px 宽，视觉上只在 hover/focus 时显出一条线 */
.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  z-index: 20;
  background: transparent;
}
.sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 0; left: 4px;
  width: 1px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
body.resizing .sidebar-resizer::after { opacity: 1; width: 2px; }
.sidebar-resizer:focus-visible { outline: none; }
/* 拖拽时锁住光标与选区，否则鼠标划过正文会选中一片文字 */
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { cursor: col-resize !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo svg { width: 16px; height: 16px; color: #fff; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.menu { flex: 1; padding: 12px; overflow-y: auto; }
.menu-item {
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.menu-item:hover { background: var(--surface-hover); color: var(--text-main); }
.menu-item:active { transform: scale(0.98); }
.menu-item.active { background: var(--primary); color: #ffffff; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-badge {
  display: inline-block;
  background: var(--primary); color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.user-id {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 8px;
  word-break: break-all;
}
.logout-btn { width: 100%; }
.logout-btn:hover { border-color: var(--danger); color: var(--danger); background: #fff; }

.main-content { flex: 1; padding: 32px 28px; overflow-y: auto; }

.panel { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-right: 130px; /* 避开固定在右上角的语言切换 */
}
.header h2 { font-size: 1.5rem; font-weight: 650; margin: 0; }
.header .subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }

.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 4px; }
.inline-actions input { flex: 1; min-width: 160px; }

/* ---------- 表格 ---------- */

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
td { font-size: 0.88rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--text-faint); padding: 44px !important; }
.actions-cell { white-space: nowrap; }
.actions-cell button { padding: 5px 11px; font-size: 0.78rem; margin-right: 6px; }
.actions-cell button:last-child { margin-right: 0; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.active { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge.pending { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge.disabled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.neutral { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge + .badge { margin-left: 4px; }

.tag-ep {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
/* 接口格式是参考信息不是状态，颜色压到很淡，
   否则十几行 × 三个标签会把整张表变成调色板 */
.tag-ep { border: 1px solid transparent; }
.tag-ep.chat { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.tag-ep.responses { background: #f7f5ff; color: #7c3aed; border-color: #e9e4fd; }
.tag-ep.messages { background: #f0fdf7; color: #059669; border-color: #cdf3e2; }

.model-cell { max-width: 240px; }
.model-count { cursor: help; border-bottom: 1px dashed var(--border-strong); }

/* ---------- 按钮与表单 ---------- */

button {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}
button:hover { background: var(--surface-2); border-color: var(--primary); }
button:active { transform: translateY(1px); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-hover); }
button.danger {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

input, select, textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 78px; line-height: 1.6; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.checks { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 2px; }
.check {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem; cursor: pointer;
}
.check input { width: auto; }

/* ---------- 弹窗 ---------- */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.modal-subtitle { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
.modal-header .close {
  border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--text-faint); padding: 0 4px; cursor: pointer;
}
.modal-header .close:hover { color: var(--text-main); background: none; }
.modal-body { padding: 24px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- 结果框 / 复制 ---------- */

.result-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}
.result-box .result-title { font-size: 0.82rem; font-weight: 700; color: #047857; margin-bottom: 8px; }
.key-display {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.82rem;
  word-break: break-all;
  margin-bottom: 10px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.96);
  color: #fff;
  padding: 13px 18px 13px 22px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  max-width: 70vw;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 16px;
}
.toast.show { bottom: 24px; }
.toast.error { background: rgba(220, 38, 38, 0.96); }
.toast .toast-close {
  background: none; border: none; color: rgba(255, 255, 255, 0.7);
  font-size: 17px; line-height: 1; padding: 0; cursor: pointer;
}
.toast .toast-close:hover { color: #fff; background: none; }

/* ---------- 语言切换 ---------- */

.lang-fixed {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 90;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-soft);
}
.lang-fixed select {
  border: none; padding: 2px 4px; font-size: 0.8rem; width: auto;
  background: none; cursor: pointer;
}
.lang-fixed select:focus { box-shadow: none; }
.lang-fixed svg { width: 15px; height: 15px; color: var(--text-muted); }

/* ---------- 登录页 ---------- */

.auth-page {
  flex: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.10);
  padding: 36px 32px 30px;
}
.auth-logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--primary);
}
.auth-logo svg { width: 28px; height: 28px; color: #fff; }
.auth-brand { font-size: 24px; font-weight: 700; text-align: center; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin: 6px 0 22px; }

.auth-field { position: relative; margin-bottom: 14px; }
.auth-field .field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
  transition: color 0.2s;
}
.auth-field:focus-within .field-icon { color: var(--accent); }
.auth-field input { padding: 12px 14px 12px 42px; border-radius: 11px; font-size: 14px; }
.auth-field.has-toggle input { padding-right: 44px; }
.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  padding: 0;
}
.pwd-toggle:hover { background: none; color: var(--text-main); }
.pwd-toggle svg { width: 16px; height: 16px; }

.auth-submit {
  width: 100%;
  padding: 13px 0;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}
.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.auth-foot { text-align: center; color: var(--text-faint); font-size: 11.5px; margin-top: 18px; }

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .sidebar { width: 220px; }
  .main-content { padding: 24px 18px; }
  .header { flex-direction: column; align-items: flex-start; padding-right: 0; }
}

@media (max-width: 720px) {
  #app { flex-direction: column; height: auto; overflow: visible; }
  body { overflow-y: auto; }
  .sidebar {
    width: 100%;
    max-height: 44vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  /* 竖排布局下没有左右可拖的边，把手会挡住内容 */
  .sidebar-resizer { display: none; }
  .lang-fixed { top: 10px; right: 10px; }
  .table-scroll table { min-width: 720px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 调度管理：分流占比 ----------
   百分比放在条子外面：叠在填充上时，中间值会正好压在深浅交界处看不清 */

.share { display: flex; align-items: center; gap: 10px; }
.share-track {
  flex: 1;
  min-width: 72px;
  height: 6px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
}
.share-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, var(--accent));
  border-radius: 999px;
  transition: none;
}
.share-num {
  min-width: 40px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

/* ---------- 复制按钮 / 代码框 / 错误信息 ---------- */

.copy-btn {
  padding: 1px 8px;
  font-size: 0.7rem;
  margin-left: 6px;
  vertical-align: middle;
}
.code-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}
.err-msg {
  max-width: 420px;
  word-break: break-all;
  color: var(--text-muted);
}

/* ---------- 价格参考 ---------- */

.provider-tabs {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.provider-tab {
  border: none;
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  padding: 9px 2px 11px;
  font-weight: 650;
}
.provider-tab:hover { border-color: var(--primary); background: transparent; }

.pricing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.pricing-types {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.pricing-types button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  min-height: 32px;
  padding: 5px 11px;
}
.pricing-types button:hover { background: #fff; border: none; }
.pricing-types button.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.09);
}
.pricing-types button span {
  color: var(--text-faint);
  font-size: 0.72rem;
  margin-left: 3px;
}
.pricing-search {
  position: relative;
  display: block;
  flex: 1 1 300px;
  min-width: 240px;
}
.pricing-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.pricing-search input {
  width: 100%;
  min-width: 0;
  padding-left: 36px;
}
.pricing-region {
  flex: 0 0 auto;
  margin: 0;
}
.pricing-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.pricing-unit-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  white-space: nowrap;
}
.pricing-unit-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  min-height: 26px;
  padding: 3px 7px;
  font-size: 0.68rem;
}
.pricing-unit-switch button:hover { border: none; background: #fff; }
.pricing-unit-switch button.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.09);
}

.pricing-table-card {
  padding: 0;
  overflow: hidden;
}
.pricing-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  color: var(--text-muted);
  font-size: 0.76rem;
  border-bottom: 1px solid var(--border);
}
.pricing-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  margin-top: 0;
  font-variant-numeric: tabular-nums;
}
.pricing-col-model { width: 150px; }
.pricing-col-type { width: 64px; }
.pricing-col-product { width: 120px; }
.pricing-col-detail { width: 408px; }
.pricing-col-regions { width: auto; }
.pricing-table th,
.pricing-table td {
  padding: 10px 12px;
  vertical-align: top;
}
.pricing-table th {
  padding: 9px 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: none;
}
.pricing-detail-heading { min-width: 0; }
.pricing-detail-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.pricing-detail-heading-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pricing-table th:first-child,
.pricing-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  box-shadow: 1px 0 0 var(--border);
}
.pricing-table th:first-child { z-index: 2; }
.pricing-table td:first-child { z-index: 1; }
.pricing-table tbody tr:hover td:first-child { background: var(--surface-2); }
.pricing-model {
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 650;
  word-break: break-word;
}
.pricing-model-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}
.pricing-model-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.pricing-model-name > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pricing-official-meta {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pricing-model-link:hover { color: var(--primary); }
.pricing-external-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--primary);
}
.pricing-product {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.pricing-unit-label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.pricing-detail-cell {
  min-width: 0;
  max-width: none;
}
.price-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}
.price-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 26px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
}
.price-line span {
  min-width: 0;
  line-height: 1.4;
}
.price-line strong {
  flex-shrink: 0;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 650;
}
.price-type {
  display: inline-block;
  min-width: 42px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 650;
}
.price-type.text { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.price-type.video { background: #f0fdf4; border-color: #bbf7d0; color: #047857; }
.price-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 104px;
}
.price-regions span {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.7rem;
  white-space: nowrap;
}
.pricing-disclaimer {
  border-top: 1px solid var(--border);
  margin: 0 18px;
  padding: 12px 0 16px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .pricing-count { margin-left: 0; }
}

@media (max-width: 720px) {
  .pricing-toolbar { display: grid; grid-template-columns: 1fr; }
  .pricing-search { min-width: 0; }
  .pricing-types { width: 100%; }
  .pricing-types button { flex: 1; }
  .pricing-region { justify-content: space-between; }
  .pricing-region select { flex: 1; }
  .pricing-count { margin-left: 0; }
  .pricing-source { flex-direction: column; }
}

/* ---------- 功能测试：对话式界面 ---------- */

.chat-card { display: flex; flex-direction: column; }

.chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-box {
  min-height: 320px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-empty {
  margin: auto;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-row.assistant { justify-content: flex-start; }

.chat-bubble {
  max-width: 76%;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  border: 1px solid var(--border);
}
.chat-bubble.user {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}
.chat-bubble.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}
.chat-text { white-space: pre-wrap; word-break: break-word; }

.chat-meta {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chat-meta a { color: var(--accent); text-decoration: none; }
.chat-meta a:hover { text-decoration: underline; }

.chat-typing { color: var(--text-muted); font-size: 0.85rem; }

.chat-input {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.chat-input textarea { flex: 1; min-height: 48px; resize: vertical; }
.chat-input button { white-space: nowrap; padding: 12px 22px; }

/* ---------- 功能测试：直连真实接口的对话页 ---------- */

/* 仅供屏幕阅读器的标签 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline > label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  margin: 0;
}
.field-inline select { width: auto; min-width: 150px; }

.chat-url {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  margin-top: 14px;
  word-break: break-all;
}
.alert-warn {
  font-size: 0.82rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-top: 14px;
}

.chat-input .model-select { min-width: 170px; }
.chat-input .send-btn { min-height: 44px; }

/* 链接样式的按钮：语义上是按钮，外观像链接 */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
}
.link-btn:hover { background: none; text-decoration: underline; }

/* 流式输出时的光标 */
.caret {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--text-muted);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: caretBlink 1s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* 移动端把偏小的操作按钮撑到易点尺寸 */
@media (max-width: 720px) {
  .actions-cell button,
  .copy-btn {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  .chat-input { flex-wrap: wrap; }
  .chat-input textarea { flex-basis: 100%; }
  .chat-input .model-select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

/* ---------- 渠道列表：Base URL 双行 ---------- */

.url-cell { min-width: 260px; }
.url-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.9;
}
.url-line + .url-line { border-top: 1px dashed var(--border); }
.url-line .mono { font-size: 0.78rem; word-break: break-all; }
.url-tag {
  flex-shrink: 0;
  width: 68px;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 0;
}
.url-tag.openai { background: #dbeafe; color: #1d4ed8; }
.url-tag.chat { background: #ede9fe; color: #6d28d9; }
.url-tag.anthropic { background: #d1fae5; color: #047857; }

/* ---------- 调度管理：组合框 ---------- */

.combo { position: relative; }
.combo-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.combo-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.combo-input svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.combo-input input {
  border: none;
  padding: 10px 0;
  flex: 1;
}
.combo-input input:focus { box-shadow: none; }
.combo-clear {
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  min-width: 24px;
}
.combo-clear:hover { color: var(--text-main); background: none; }

.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.combo-list li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.86rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.combo-list li:hover { background: var(--surface-2); }
.combo-list .combo-none {
  color: var(--text-faint);
  cursor: default;
  font-family: inherit;
}
.combo-list .combo-none:hover { background: none; }

/* ---------- 调度管理：紧凑大表 ---------- */

table.dense { font-variant-numeric: tabular-nums; }
table.dense th, table.dense td { padding: 8px 12px; }
table.dense th {
  border-bottom: 1px solid var(--border-strong);
  background: #fff;
}
table.dense td { font-size: 0.85rem; line-height: 1.45; }
/* 同一模型的若干渠道是一组，组与组之间用一条实线断开 */
table.dense tbody tr.model-start > td { border-top: 1px solid var(--border-strong); }
table.dense tbody tr:first-child > td { border-top: none; }
/* 组内相邻行之间不再画线，避免整张表变成密集的横条 */
table.dense tbody tr:not(.model-start) > td { border-bottom-color: transparent; }
table.dense tbody tr > td { border-bottom: 1px solid var(--border); }

.model-cell {
  vertical-align: middle;
  background: linear-gradient(90deg, var(--surface-2), #fbfcfd);
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border-strong);
  white-space: nowrap;
  min-width: 190px;
}
.model-cell .model-name {
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.005em;
  color: var(--text-main);
}
.model-cell .muted { margin-top: 2px; font-size: 0.7rem; }
table.dense tbody tr:hover .model-cell { background: var(--surface-2); }

.ch-name { white-space: nowrap; font-weight: 500; }
table.dense tbody tr:last-child > td { border-bottom: none; }
.ep-cell { white-space: nowrap; }
table.dense input[type=number] {
  padding: 5px 8px;
  font-size: 0.84rem;
  width: 68px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.weight-cell {
  text-align: right;
}
.weight-cell input[type="number"] {
  width: 78px;
  padding: 5px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: #fff;
  outline: none;
}
.weight-cell input[type="number"]:focus {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15);
}
.weight-cell.weight-editing {
  background: #fff7ed;
}
.weight-cell.weight-dirty input[type="number"] {
  background: #fef3c7;
  border-color: #d97706;
}
.weight-value {
  display: inline-block;
  min-width: 68px;
  padding: 5px 8px;
  font-variant-numeric: tabular-nums;
}
.weight-save-btn { margin-right: 6px; }

.header-actions { display: flex; gap: 10px; flex-shrink: 0; }

.channel-table {
  min-width: 980px;
  table-layout: fixed;
}

.channel-col-name { width: 128px; }
.channel-col-url { width: 27%; }
.channel-col-key { width: 15%; }
.channel-col-models { width: auto; }
.channel-col-actions { width: 96px; }

.channel-name-cell {
  vertical-align: middle;
}

.channel-name-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.channel-name-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 650;
  color: var(--primary);
}

.channel-table .model-cell {
  width: auto;
  max-width: none;
  min-width: 0;
  vertical-align: top;
}

.channel-models {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

.channel-model {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 29px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(198, 212, 226, 0.62);
}

.channel-model::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  margin: 0 8px 0 1px;
  border-radius: 50%;
  background: var(--accent);
}

.channel-model .mono {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
  color: #294463;
}

.channel-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.channel-actions button {
  width: 100%;
  min-height: 29px;
  margin: 0;
  padding: 5px 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .channel-models {
    grid-template-columns: minmax(0, 1fr);
  }

  .channel-actions button {
    min-height: 36px;
    padding: 8px 4px;
  }
}

.model-endpoint-list {
  display: grid;
  gap: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.model-endpoint-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) repeat(3, minmax(104px, .8fr)) minmax(128px, .9fr);
  gap: 0;
  align-items: center;
  min-height: 50px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.model-endpoint-row .checks {
  display: contents;
}

.model-endpoint-head {
  min-height: 34px;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.model-endpoint-head > span:not(:first-child) {
  text-align: center;
}

.model-endpoint-row .check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 42px;
  white-space: nowrap;
  color: var(--text-main);
  font-size: 0.78rem;
  line-height: 1;
}

.model-endpoint-row .check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}

.model-endpoint-default {
  width: calc(100% - 12px);
  min-width: 0;
  margin: 0 6px;
  padding: 8px 9px;
  font-size: 0.78rem;
}

.model-endpoint-default-note {
  margin: 0 4px;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

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

.model-endpoint-name {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .model-endpoint-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .model-endpoint-head {
    display: none;
  }

  .model-endpoint-row .checks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .model-endpoint-row .check {
    white-space: normal;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .model-endpoint-default {
    width: 100%;
    margin: 0;
  }

  .model-endpoint-default-note {
    margin: 0;
    text-align: left;
  }
}

/* ---------- 视觉精修：openapihub console ---------- */

:root {
  --bg-dark: #f4f7fb;
  --bg-card: #ffffff;
  --surface-2: #f3f7fb;
  --surface-hover: #e8f0f8;
  --text-main: #10233f;
  --text-muted: #53657a;
  --text-faint: #8da0b5;
  --primary: #10233f;
  --primary-hover: #08182d;
  --accent: #1677b8;
  --danger: #b42318;
  --danger-hover: #941b12;
  --success: #087f5b;
  --border: #dce6f0;
  --border-strong: #c6d4e2;
  --focus-ring: rgba(22, 119, 184, 0.2);
  --shadow-soft: 0 1px 2px rgba(16, 35, 63, 0.04), 0 12px 28px rgba(16, 35, 63, 0.055);
  --shadow-raised: 0 18px 46px rgba(16, 35, 63, 0.13);
  --radius: 12px;
}

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

body {
  background:
    linear-gradient(180deg, #f7fafd 0, var(--bg-dark) 42%, #f1f5fa 100%);
  color: var(--text-main);
  letter-spacing: 0.005em;
}

::selection {
  background: rgba(22, 119, 184, 0.18);
  color: var(--text-main);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c8d5e3;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #aebfd1;
  border-width: 2px;
  background-clip: padding-box;
}

#app {
  min-height: 100dvh;
  height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  background: rgba(255, 255, 255, 0.9);
  border-right-color: var(--border);
  box-shadow: 10px 0 32px rgba(16, 35, 63, 0.025);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  min-height: 78px;
  padding: 20px 21px;
  border-bottom-color: var(--border);
}

.brand-logo,
.auth-logo {
  background: var(--primary);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(16, 35, 63, 0.18);
}

.brand-logo {
  width: 34px;
  height: 34px;
}

.brand-logo svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-size: 16px;
  letter-spacing: -0.025em;
}

.menu {
  padding: 18px 12px;
}

.menu-item {
  position: relative;
  min-height: 44px;
  padding: 11px 13px;
  margin-bottom: 6px;
  border-radius: 10px;
  gap: 11px;
  color: #64758a;
  font-size: 0.91rem;
  font-weight: 520;
}

.menu-item:hover {
  background: #eef4fa;
  color: var(--text-main);
}

.menu-item.active {
  background: #eaf3fb;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(22, 119, 184, 0.1);
}

.menu-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  color: #8294a8;
  stroke-width: 1.8;
}

.sidebar-footer {
  padding: 18px 16px 16px;
  border-top-color: var(--border);
  background: rgba(248, 251, 254, 0.72);
}

.avatar {
  width: 38px;
  height: 38px;
  background: #dcecf8;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(22, 119, 184, 0.16);
}

.role-badge {
  background: #e9f3fb;
  color: var(--accent);
  padding: 2px 8px;
}

.user-id {
  background: #f3f7fb;
  border-color: var(--border);
}

.main-content {
  min-width: 0;
  padding: 40px clamp(22px, 4vw, 64px) 56px;
  background:
    radial-gradient(circle at 92% 0%, rgba(22, 119, 184, 0.055), transparent 28rem),
    transparent;
}

.panel {
  max-width: 1480px;
  margin: 0 auto;
  animation: fadeIn 0.28s ease both;
}

.header {
  align-items: flex-end;
  margin-bottom: 24px;
  padding-right: 132px;
}

.header h2 {
  color: var(--primary);
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 720;
  letter-spacing: -0.035em;
}

.header .subtitle {
  max-width: 760px;
  color: #6d7f93;
  line-height: 1.55;
}

.card {
  padding: 22px 24px;
  margin-bottom: 20px;
  border-color: var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.card-header {
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom-color: var(--border);
}

.card-header h3 {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

button {
  min-height: 36px;
  border-color: var(--border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(16, 35, 63, 0.025);
}

button:hover {
  background: #f4f8fc;
  border-color: #aebfd1;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(16, 35, 63, 0.14);
}

button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 8px 18px rgba(16, 35, 63, 0.18);
}

button.danger {
  background: #fff5f4;
  border-color: #f3c7c3;
  color: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

input,
select,
textarea {
  min-height: 38px;
  border-color: var(--border-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebfd1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: #91a3b7;
}

.hint {
  color: #6d7f93;
  line-height: 1.55;
}

.muted {
  color: #64778c;
}

th {
  color: #708298;
  font-size: 0.71rem;
  letter-spacing: 0.075em;
}

th,
td {
  padding: 13px 14px;
  border-bottom-color: #e4ebf2;
}

td {
  color: #263c57;
  font-size: 0.86rem;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover td {
  background: #f5f9fd;
}

.badge,
.tag-ep,
.price-type {
  border-radius: 7px;
}

.badge {
  padding: 4px 9px;
  font-size: 0.67rem;
  letter-spacing: 0.03em;
}

.badge.active {
  background: #e9f8f2;
  color: #087f5b;
  border-color: #bcebd9;
}

.badge.disabled {
  background: #fff1f0;
  color: #b42318;
  border-color: #f2c1bc;
}

.badge.pending {
  background: #fff8e8;
  color: #a15c00;
  border-color: #f1d49b;
}

.tag-ep {
  padding: 3px 8px;
  margin-right: 3px;
  font-size: 0.65rem;
  font-weight: 650;
}

.tag-ep.chat {
  background: #edf5ff;
  color: #2367a6;
  border-color: #cfe2f8;
}

.tag-ep.responses {
  background: #f3efff;
  color: #7050b3;
  border-color: #ddd2fb;
}

.tag-ep.messages {
  background: #ecfaf5;
  color: #087f5b;
  border-color: #c5eadc;
}

.actions-cell button {
  min-height: 31px;
  border-radius: 8px;
  padding: 5px 10px;
}

.copy-btn {
  min-height: 28px;
  border-radius: 7px;
  background: #f7fafc;
  color: var(--accent);
}

.model-cell {
  background: linear-gradient(90deg, #f1f6fb, #fbfdff);
  border-right-color: var(--border);
  border-left: 1px solid var(--border);
}

.model-cell .model-name {
  color: var(--primary);
}

.share-track {
  height: 7px;
  background: #e5edf5;
}

.share-fill {
  background: var(--accent);
  transition: none;
}

.modal-overlay {
  background: rgba(13, 28, 49, 0.43);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.modal {
  border-color: rgba(198, 212, 226, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow-raised);
}

.modal-header {
  padding: 22px 24px 18px;
  background: #fbfdff;
  border-bottom-color: var(--border);
}

.modal-header h3 {
  color: var(--primary);
  font-weight: 720;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.result-box {
  background: #eefaf5;
  border-color: #bfe8d8;
}

.result-box .result-title {
  color: var(--success);
}

.key-display,
.code-box {
  background: #f4f8fc;
  border-color: var(--border);
}

.lang-fixed {
  top: 18px;
  right: 22px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 9px;
  border-color: var(--border);
  box-shadow: 0 8px 20px rgba(16, 35, 63, 0.08);
}

.lang-fixed svg {
  color: var(--accent);
}

.auth-page {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 100dvh;
  background:
    linear-gradient(120deg, rgba(22, 119, 184, 0.055), transparent 32%),
    linear-gradient(300deg, rgba(16, 35, 63, 0.045), transparent 40%);
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(22, 119, 184, 0.1);
  transform: rotate(-14deg);
}

.auth-page::before {
  width: 480px;
  height: 480px;
  left: -250px;
  bottom: -190px;
  border-radius: 42px;
}

.auth-page::after {
  width: 300px;
  height: 300px;
  right: -125px;
  top: -100px;
  border-radius: 34px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(424px, calc(100vw - 36px));
  max-width: none;
  padding: 42px 36px 32px;
  border-color: rgba(198, 212, 226, 0.9);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(16, 35, 63, 0.12);
}

.auth-logo {
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  border-radius: 14px;
}

.auth-logo svg {
  width: 31px;
  height: 31px;
}

.auth-brand {
  color: var(--primary);
  font-size: 26px;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  margin-top: 7px;
  color: #6d7f93;
}

.auth-field {
  margin-bottom: 12px;
}

.auth-field input {
  min-height: 46px;
  border-radius: 10px;
  background: #fbfdff;
}

.auth-submit {
  min-height: 48px;
  margin-top: 10px;
  border-radius: 10px;
}

.auth-foot {
  color: #8b9db1;
  line-height: 1.5;
}

.chat-box {
  background: #f8fbfd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
}

.chat-bubble {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(16, 35, 63, 0.035);
}

.chat-bubble.user {
  background: var(--primary);
}

.chat-bubble.assistant {
  background: #fff;
  border-color: var(--border);
}

.chat-input {
  padding-top: 18px;
}

.chat-input textarea {
  min-height: 50px;
}

.alert-warn {
  background: #fff8e8;
  border-color: #f1d49b;
  color: #8a5a00;
}

.pricing-toolbar {
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.pricing-types {
  border-color: transparent;
  background: #eaf1f7;
}

.pricing-types button,
.pricing-unit-switch button {
  border-radius: 7px;
}

.pricing-types button.active,
.pricing-unit-switch button.active,
.pricing-types button:hover,
.pricing-unit-switch button:hover {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(16, 35, 63, 0.08);
}

.pricing-table-card {
  border-radius: 14px;
}

.pricing-source,
.pricing-table th {
  background: #f7fafd;
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  background: #fff;
}

.pricing-table tbody tr:hover td:first-child {
  background: #f5f9fd;
}

.pricing-official-meta,
.pricing-external-icon {
  color: var(--accent);
}

.trend-stats .ts {
  background: #f5f9fd;
  border-color: var(--border);
}

.chart {
  background: linear-gradient(180deg, #f7fafd, #fff);
  border-color: var(--border);
}

@media (max-width: 980px) {
  .main-content {
    padding: 30px 22px 42px;
  }

  .header {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  #app {
    min-height: 100dvh;
    height: auto;
  }

  .sidebar {
    max-height: none;
  }

  .brand {
    min-height: 68px;
  }

  .menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 12px;
  }

  .menu-item {
    margin: 0;
  }

  .sidebar-footer {
    padding-top: 14px;
  }

  .main-content {
    padding: 24px 14px 36px;
  }

  .header {
    gap: 14px;
    margin-bottom: 18px;
    padding-right: 0;
  }

  .header h2 {
    font-size: 1.42rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions button {
    flex: 1;
  }

  .card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .card-header {
    align-items: flex-start;
  }

  .inline-actions,
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-actions input,
  .inline-actions button {
    width: 100%;
  }

  .pricing-toolbar {
    padding: 8px;
    border-radius: 12px;
  }

  .pricing-types {
    border: 1px solid var(--border);
  }

  .auth-page {
    width: 100%;
    min-width: 0;
    padding: 18px;
  }

  .auth-card {
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 36px);
    padding: 34px 22px 26px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
    border-radius: 16px 16px 12px 12px;
  }

  .modal-header,
  .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .trend-bar {
    align-items: flex-start;
  }

  .seg {
    width: 100%;
  }

  .seg button {
    flex: 1;
    padding-inline: 8px;
  }
}

/* ---------- 首 token 耗时 ---------- */

.combo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ttft {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  cursor: help;
}
.ttft i { font-style: normal; font-size: 0.68rem; color: var(--text-faint); margin-left: 1px; }
.ttft-p50 { font-weight: 600; font-size: 0.86rem; }
.ttft-p95 { font-size: 0.8rem; color: var(--text-muted); }
.ttft-sep { color: var(--border-strong); }

/* ---------- 首 token 趋势图 ---------- */

.ttft-btn {
  display: flex;
  align-items: baseline;
  gap: 5px;
  border: none;
  background: none;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.ttft-btn:hover { background: var(--surface-hover); border: none; }
.ttft-btn i { font-style: normal; font-size: 0.68rem; color: var(--text-faint); margin-left: 1px; }
.ttft-chart-icon { width: 13px; height: 13px; color: var(--text-faint); align-self: center; }
.ttft-btn:hover .ttft-chart-icon { color: var(--accent); }

.modal-wide { width: 860px; }

.channel-modal {
  width: min(780px, 100%);
}

.trend-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: none;
  background: none;
  padding: 5px 13px;
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.seg button:hover { background: #fff; border: none; }
.seg button.on { background: var(--primary); color: #fff; }

.trend-legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--text-muted); flex-wrap: wrap; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-area { background: rgba(3, 105, 161, 0.22); height: 10px !important; border-radius: 3px !important; }
.lg-line { background: var(--accent); }
.lg-bar { background: var(--text-muted); height: 10px !important; width: 6px !important; }
.lg-ok { background: var(--success); }
.lg-fail { background: var(--danger); height: 10px !important; width: 6px !important; }

.trend-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.ts {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.ts b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ts b i { font-style: normal; font-size: 0.7rem; color: var(--text-faint); margin-left: 2px; }
.ts span { font-size: 0.72rem; color: var(--text-muted); }
/* 有失败时这张卡片自己变红，不必让用户去曲线上找 */
.ts.bad { background: #fef2f2; border-color: #fecaca; }
.ts.bad b, .ts.bad span, .ts.bad b i { color: var(--danger); }
.trend-hover span.bad, .trend-hover span.bad i.lg-ok { color: var(--danger); }
.trend-hover em { font-style: normal; color: var(--danger); }
.txt-bad { color: var(--danger); font-weight: 600; }
.chart-note { font-weight: 400; color: var(--success); }
.chart-foot { margin-top: 8px; line-height: 1.6; }

.chart-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 6px 0 6px;
}
.chart {
  width: 100%;
  height: 180px;
  display: block;
  background: linear-gradient(180deg, #fbfcfe, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}
.chart-sm { height: 70px; }
.chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .area { fill: rgba(3, 105, 161, 0.16); stroke: none; }
.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.chart .crosshair {
  stroke: var(--text-faint);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.chart .dot-on {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.chart .dot-bad {
  fill: var(--danger);
  stroke: #fff;
  stroke-width: 1.5;
  pointer-events: none;
}
/* 整列透明热区：鼠标落在这一列任意高度都能选中，不必精确命中数据点 */
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar { fill: var(--text-muted); opacity: 0.7; }
.chart .bar.on { fill: var(--primary); opacity: 1; }
.chart .bar-fail { fill: var(--danger); opacity: 0.85; }

/* 成功率图：Y 轴固定 0~100%，不做自适应缩放，
   否则 99.5% 掉到 99% 会被放大成断崖，看着像出大事了 */
.chart-ok { height: 64px; }
.chart .ok-area { fill: rgba(4, 120, 87, 0.13); stroke: none; }
.chart .ok-line {
  fill: none;
  stroke: var(--success);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart-wrap { position: relative; padding-left: 52px; }
.chart-axis { position: absolute; left: 0; top: 0; width: 46px; height: 100%; }
.chart-axis span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 0.66rem;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-xaxis {
  position: relative;
  height: 16px;
  margin: 4px 0 0 52px;
}
.chart-xaxis span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.66rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.chart-xaxis span:first-child { transform: none; }
.chart-xaxis span:last-child { transform: translateX(-100%); }
.trend-empty { text-align: center; color: var(--text-faint); padding: 52px 0; }
.trend-hover {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}
.trend-hover b { font-variant-numeric: tabular-nums; }
.trend-hover span { color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.trend-hover i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

.trend-table-toggle { margin-top: 10px; }
.trend-table-toggle .link-btn { font-size: 0.78rem; }

@media (max-width: 720px) {
  .trend-stats { grid-template-columns: repeat(2, 1fr); }
  /* 窄屏藏掉 Y 轴刻度，那 52px 的让位也要一起收回来给图表 */
  .chart-axis { display: none; }
  .chart-wrap { padding-left: 0; }
  .chart-xaxis { margin-left: 0; }
}

/* ---------- 价格参考：目录式信息层级 ---------- */

.pricing-panel .header {
  margin-bottom: 18px;
}

.pricing-panel .header h2 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.pricing-panel .header .subtitle {
  max-width: 680px;
}

.provider-tabs {
  align-items: stretch;
  margin: 0 0 14px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background:
    linear-gradient(90deg, rgba(22, 119, 184, 0.08), rgba(22, 119, 184, 0) 42%),
    #fbfdff;
}

.provider-tab {
  position: relative;
  min-height: 48px;
  padding: 13px 2px 12px;
  border-bottom: 2px solid var(--accent);
  color: var(--primary);
  font-size: 0.88rem;
  letter-spacing: -0.005em;
}

.pricing-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.pricing-types {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #eaf1f7;
}

.pricing-types button {
  min-width: 66px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  color: #64778c;
}

.pricing-types button.active {
  color: var(--primary);
}

.pricing-search {
  min-width: 0;
}

.pricing-search input {
  min-height: 42px;
  border-radius: 11px;
  background: #fff;
  padding-left: 38px;
}

.pricing-search svg {
  left: 13px;
  color: var(--accent);
}

.pricing-region {
  min-height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.pricing-region > label {
  color: #7a8da1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.pricing-region select {
  min-height: 36px;
  min-width: 116px;
  width: auto;
  padding: 6px 26px 6px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
}

.pricing-region select:focus {
  box-shadow: none;
}

.pricing-count {
  padding: 0 2px;
  color: #718398;
  font-size: 0.76rem;
  font-weight: 600;
}

.pricing-table-card {
  overflow: hidden;
  border-color: #d5e1ec;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(16, 35, 63, 0.065);
}

.pricing-source {
  align-items: center;
  min-height: 52px;
  padding: 12px 20px;
  border-bottom-color: var(--border);
  background: #f7fafd;
}

.pricing-source span:first-child {
  color: #536a81;
  font-size: 0.77rem;
  font-weight: 600;
}

.pricing-source-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pricing-source-meta > span {
  color: #8a9bad;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.pricing-exchange-rate {
  color: var(--primary) !important;
  font-weight: 700;
}

.pricing-reference-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.pricing-reference-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.pricing-reference-link svg {
  width: 13px;
  height: 13px;
}

.pricing-table {
  min-width: 1040px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.pricing-col-model { width: 220px; }
.pricing-col-type { width: 82px; }
.pricing-col-product { width: 150px; }
.pricing-col-detail { width: 492px; }
.pricing-col-regions { width: 150px; }

.pricing-table th {
  height: 44px;
  padding: 10px 16px;
  border-bottom: 1px solid #d7e3ee;
  background: #eef4f9;
  color: #687d92;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.pricing-table td {
  padding: 16px;
  border-bottom: 1px solid #e4ebf2;
  vertical-align: top;
}

.pricing-table tbody tr:last-child td {
  border-bottom: 0;
}

.pricing-table tbody tr:hover td {
  background: #f8fbfe;
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  box-shadow: 1px 0 0 #dfe8f0;
}

.pricing-table th:first-child {
  z-index: 3;
  background: #eaf2f8;
}

.pricing-table td:first-child {
  z-index: 1;
  background: #fbfdff;
}

.pricing-table tbody tr:hover td:first-child {
  background: #f3f8fc;
}

.pricing-model {
  min-width: 0;
  font-size: 0.86rem;
}

.pricing-model-link {
  gap: 7px;
}

.pricing-model-name {
  width: 100%;
  align-items: flex-start;
  gap: 6px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}

.pricing-model-name > span:first-child {
  overflow-wrap: anywhere;
}

.pricing-external-icon {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  color: #8ba0b4;
  transition: color 0.18s ease, transform 0.18s ease;
}

.pricing-model-link:hover .pricing-external-icon {
  color: var(--accent);
  transform: translate(1px, -1px);
}

.pricing-official-meta {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #d8e7f2;
  border-radius: 6px;
  background: #f0f7fc;
  color: #5d7890;
  font-size: 0.63rem;
  font-weight: 650;
}

.price-type {
  min-width: 46px;
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 750;
}

.price-type.text {
  background: #edf5ff;
  border-color: #cfe2f8;
  color: #2367a6;
}

.price-type.video {
  background: #ecfaf5;
  border-color: #c5eadc;
  color: #087f5b;
}

.pricing-product {
  padding-top: 18px !important;
  color: #61768b;
  font-size: 0.78rem;
  line-height: 1.55;
}

.pricing-detail-cell {
  padding: 12px 16px !important;
}

.pricing-detail-heading-row {
  gap: 12px;
}

.pricing-unit-switch {
  border-color: #d4e0eb;
  border-radius: 8px;
  background: #e7eef5;
}

.pricing-unit-switch button {
  min-height: 27px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.64rem;
}

.pricing-unit-label {
  margin: 3px 0 8px;
  color: #71869a;
  font-size: 0.67rem;
}

.price-list {
  gap: 6px 8px;
}

.price-line {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #e2ebf3;
  border-radius: 8px;
  background: #f8fbfd;
  color: #718398;
  font-size: 0.71rem;
}

.price-line strong {
  color: var(--primary);
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}

.price-regions {
  min-width: 0;
  gap: 6px;
  padding-top: 2px;
}

.price-regions span {
  padding: 4px 7px;
  border-color: #dce7ef;
  border-radius: 6px;
  background: #f6f9fb;
  color: #64798d;
  font-size: 0.66rem;
}

.pricing-disclaimer {
  margin: 0;
  padding: 14px 20px 16px;
  border-top-color: var(--border);
  background: #fbfdff;
  color: #7a8da0;
  font-size: 0.7rem;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .pricing-toolbar {
    grid-template-columns: auto minmax(200px, 1fr);
  }

  .pricing-region {
    justify-content: space-between;
  }

  .pricing-count {
    justify-self: end;
  }
}

@media (max-width: 720px) {
  .provider-tabs {
    padding: 0 14px;
  }

  .pricing-toolbar {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .pricing-types {
    width: 100%;
  }

  .pricing-types button {
    flex: 1;
  }

  .pricing-search input {
    min-height: 44px;
  }

  .pricing-region {
    width: 100%;
  }

  .pricing-region select {
    flex: 1;
  }

  .pricing-count {
    justify-self: start;
    padding-left: 2px;
  }

  .pricing-source {
    align-items: flex-start;
    gap: 4px;
    padding: 13px 16px;
  }

  .pricing-source-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .pricing-table {
    min-width: 960px;
  }

  .pricing-table th,
  .pricing-table td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .price-list {
    grid-template-columns: 1fr;
  }

  .pricing-disclaimer {
    padding-left: 16px;
    padding-right: 16px;
  }
}
