/* 土狗AI 算力中转平台 · 共享样式
   免构建：纯 CSS 变量 + 原生样式，无预处理器依赖。
   深色主题为主（开发者控制台长时间注视更舒适），浅色表格行交替提升可读性。 */

:root {
  /* 背景层次：从最深到最浅，用于营造纵深 */
  --bg-0: #0b0e14;
  --bg-1: #11151f;
  --bg-2: #171c28;
  --bg-3: #1e2532;

  --line: #2a3242;
  --line-soft: #232a38;

  /* 文本 */
  --text: #e8ecf4;
  --text-dim: #9aa4b8;
  --text-mute: #66708a;

  /* 主题色：土狗黄（品牌） */
  --brand: #ffc83d;
  --brand-dim: #d9a520;
  --brand-glow: rgba(255, 200, 61, .15);

  /* 语义色 */
  --ok: #3ddc97;
  --warn: #ffb84d;
  --err: #ff6b6b;
  --info: #5ab0ff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);

  --mono: 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
          'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }

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

.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 58px;
  background: rgba(11, 14, 20, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/*品牌标记：用土狗AI 官方素材（柴犬+电路板），已转透明底适配深色主题。
   注意：老素材是白底不透明，直接用在深色站上会显示成白色方块，
   必须用 scripts/gen_brand_assets.py 生成的品牌黄版本。 */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-2);
  display: grid; place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand .logo img { width: 26px; height: 26px; display: block; }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  padding: 6px 13px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.active { background: var(--brand-glow); color: var(--brand); }

.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  margin: -4px 0 16px;
}
.card-title { font-size: 15px; font-weight: 650; }
.card-title .hint { font-size: 12px; font-weight: 400; color: var(--text-mute); margin-left: 8px; }
.card-head .spacer { margin-left: auto; }

/* ---------- 统计块 ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--brand-glow);
}
.stat .label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.stat .value { font-size: 24px; font-weight: 700; font-family: var(--mono); letter-spacing: -.5px; }
.stat .sub { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.stat.ok .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }
.stat.err .value { color: var(--err); }
.stat.brand .value { color: var(--brand); }

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

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--bg-2); color: var(--text-dim);
  font-weight: 600; font-size: 12px; text-align: left;
  padding: 10px 12px; white-space: nowrap;
  position: sticky; top: 58px; z-index: 10;
}
tbody td { padding: 9px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: var(--bg-2); }
tbody tr:nth-child(even) { background: rgba(255,255,255,.012); }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
td.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- 标签 ---------- */

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.tag.ok { background: rgba(61,220,151,.13); color: var(--ok); border-color: rgba(61,220,151,.3); }
.tag.warn { background: rgba(255,184,77,.13); color: var(--warn); border-color: rgba(255,184,77,.3); }
.tag.err { background: rgba(255,107,107,.13); color: var(--err); border-color: rgba(255,107,107,.3); }
.tag.info { background: rgba(90,176,255,.13); color: var(--info); border-color: rgba(90,176,255,.3); }
.tag.mute { background: var(--bg-3); color: var(--text-dim); border-color: var(--line); }
.tag.brand { background: var(--brand-glow); color: var(--brand); border-color: rgba(255,200,61,.35); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font-size: 13px; font-weight: 550; font-family: inherit;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--bg-3); border-color: #3a4459; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #0b0e14; font-weight: 650; }
.btn.primary:hover:not(:disabled) { background: #ffd666; border-color: #ffd666; }
.btn.danger { background: rgba(255,107,107,.14); border-color: rgba(255,107,107,.35); color: var(--err); }
.btn.danger:hover:not(:disabled) { background: rgba(255,107,107,.22); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; font-weight: 500; }
.field label .req { color: var(--err); margin-left: 2px; }
input, select, textarea {
  width: 100%; padding: 8px 11px;
  background: var(--bg-0); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-dim); }
input.mono { font-family: var(--mono); }
textarea { resize: vertical; min-height: 64px; }
select { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }

/* ---------- 提示条 ---------- */

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2);
  font-size: 13px; margin-bottom: 14px; line-height: 1.55;
}
.alert.warn { background: rgba(255,184,77,.1); border-color: rgba(255,184,77,.3); color: #ffd9a0; }
.alert.err { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.3); color: #ffb3b3; }
.alert.ok { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.3); color: #a8f0cf; }
.alert.info { background: rgba(90,176,255,.1); border-color: rgba(90,176,255,.3); color: #b3daff; }
.alert .t { font-weight: 650; display: block; margin-bottom: 3px; }

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

.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.66); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 22px;
}
.modal.wide { width: min(880px, 100%); }
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .sub { color: var(--text-mute); font-size: 12.5px; margin-bottom: 18px; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }

/* ---------- 吐司 ---------- */

#toasts { position: fixed; top: 68px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 15px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 13px; max-width: 400px;
  animation: slidein .2s ease;
}
.toast.ok { border-color: rgba(61,220,151,.45); color: #a8f0cf; }
.toast.err { border-color: rgba(255,107,107,.45); color: #ffb3b3; }
.toast.warn { border-color: rgba(255,184,77,.45); color: #ffd9a0; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }

/* ---------- 工具 ---------- */

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { margin-left: auto; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.pos { color: var(--ok); } .neg { color: var(--err); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-mute); font-size: 13px; }

pre.code {
  background: var(--bg-0); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px;
  font-family: var(--mono); font-size: 12.5px;
  overflow-x: auto; color: #cfe3ff; margin: 0;
  line-height: 1.65;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  padding: 9px 15px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-size: 13.5px; font-weight: 550; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: all .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4459; }
/* ============================================================
   厂商筛选 + 模型参数详情（2026-10-06）
   ============================================================ */

/* 厂商分组标题 —— 厂商是模型原厂（可灵/海螺/千问），客户本来就知道，
   不像供应商那样需要隐藏 */
.vendor-head {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 12px;
}
.vendor-head:first-child { margin-top: 4px; }
.vendor-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.vendor-head .line { flex: 1; height: 1px; background: var(--line); }

/* 原厂标签：与 info/mute 区分开，让筛选结果一眼看出归属 */
.tag.vendor {
  background: rgba(120, 160, 255, .13);
  color: #9db8ff;
  border-color: rgba(120, 160, 255, .3);
}

/* 模型卡片可点击 */
.model[data-model] { cursor: pointer; transition: border-color .15s, transform .15s; }
.model[data-model]:hover {
  border-color: var(--brand-dim);
  transform: translateY(-1px);
}
.model .more {
  margin-top: 10px;
  font-size: 12px;
  color: var(--brand);
  opacity: .75;
}
.model[data-model]:hover .more { opacity: 1; }

/* 参数详情里的键值行 */
.kv-row {
  display: grid; grid-template-columns: auto 1fr auto 1fr;
  gap: 8px 14px; align-items: center;
}
.kv-row .k { color: var(--text-dim); font-size: 12.5px; }
.kv-row .v { font-size: 13px; }
@media (max-width: 640px) {
  .kv-row { grid-template-columns: auto 1fr; }
}

/* 复制成功反馈（2026-10-06） */
.btn.ok, button.ok {
  background: rgba(60, 200, 120, .16) !important;
  border-color: rgba(60, 200, 120, .45) !important;
  color: #4ade80 !important;
}
.key-reveal { user-select: all; -webkit-user-select: all; }
