/* 算力商后台 · 癸路
   颜色、圆角、阴影只用 --r12-* 变量；数据驱动的宽度用 --w 带进来。 */

/* ---------- 总览 ---------- */
.sp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sp-overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 8px; align-items: start; }
.sp-trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.sp-chart { margin: 0; min-width: 0; }
.sp-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sp-chart-head b { font-size: 13px; font-weight: 600; color: var(--r12-ink); }
.sp-chart-head span { font-size: 11px; color: var(--r12-muted); }
.sp-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp-chart-grid { stroke: var(--r12-line); stroke-width: 1; }
.sp-chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-chart-line.is-success { stroke: var(--r12-ok); }
.sp-chart-line.is-latency { stroke: var(--r12-running); }
.sp-chart-dot { stroke: var(--r12-surface); stroke-width: 2; }
.sp-chart-dot.is-success { fill: var(--r12-ok); }
.sp-chart-dot.is-latency { fill: var(--r12-running); }
.sp-chart-x, .sp-chart-y { fill: var(--r12-faint); font-size: 10px; }
.sp-chart-label { fill: var(--r12-ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

.sp-messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-message { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-control); background: var(--r12-surface-2); color: var(--r12-ink); font: inherit; text-align: left; }
.sp-message:hover { border-color: var(--r12-line-strong); }
.sp-message-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-message-body b { font-size: 13px; font-weight: 600; }
.sp-message-body span { font-size: 12px; color: var(--r12-muted); }
.sp-message-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.sp-message-side em { font-style: normal; font-size: 11px; color: var(--r12-faint); white-space: nowrap; }

/* ---------- 报价表 / 待确认 ---------- */
.sp-subbar { display: flex; align-items: center; gap: 8px; }
.sp-tabs { background: var(--r12-surface-2); }
.sp-toolbar { margin-bottom: 0; }
.sp-quotes-layout { display: flex; align-items: flex-start; gap: 8px; }
.sp-quotes-main { flex: 1; min-width: 0; }
.sp-filter { position: sticky; top: 0; }
.sp-quotes-main .sq-table { table-layout: fixed; }
.sp-quotes-main .sq-table > tbody > tr > td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-quotes-main .sq-table > tbody > tr.sq-expand-row > td { height: auto; white-space: normal; overflow: visible; }
.sp-quotes-main .sq-table td[data-cell="common"] { color: var(--r12-muted); }
.sp-quotes-main .sq-table td[data-cell="status"] { white-space: normal; }
.sp-paste-text { width: 100%; min-height: 92px; padding: 8px 10px; resize: vertical; font-family: var(--font-mono); }
.sp-paste .toolbar-actions { margin-top: 8px; justify-content: flex-end; }
.sp-big { margin-left: 6px; }
.sq-tier-table tr.is-big > td { background: var(--r12-review-soft); }

.sp-traffic { display: inline-flex; align-items: center; gap: 8px; }
.sp-bar { display: inline-block; width: 64px; height: 6px; flex: none; border-radius: var(--r12-r-pill); background: var(--r12-surface-3); overflow: hidden; }
.sp-bar-fill { display: block; width: var(--w, 0%); height: 100%; border-radius: var(--r12-r-pill); background: var(--r12-running); }
.sp-traffic b { font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-concurrency { display: inline-flex; align-items: center; gap: 6px; }
.sp-concurrency .input { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.sp-concurrency-now { display: block; margin-top: 2px; font-size: 11px; color: var(--r12-faint); }
.sp-concurrency-now b { color: var(--r12-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 账号与权限（二级菜单在左侧导航里） ---------- */
.sp-account-main { min-width: 0; }
.sp-profile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 轻提示 ---------- */
.sp-toast { position: fixed; left: 50%; bottom: 24px; z-index: 600; padding: 8px 14px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-pill); background: var(--r12-pop-bg); color: var(--r12-ink); box-shadow: var(--r12-shadow-pop); font-size: 12px; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity var(--r12-dur-2) var(--r12-ease), transform var(--r12-dur-2) var(--r12-ease); }
.sp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .sp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .sp-trend-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-quotes-layout,
  .sp-library-layout { flex-direction: column; }
  .sp-filter { position: static; width: 100%; }
}

/* ---------- 我的模型：状态筛选条 ---------- */
.sp-statusbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sp-statusbar .sp-status b { margin-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--r12-muted); }
.sp-statusbar .sp-status.is-on { background: var(--r12-selected-bg); border-color: var(--r12-line-strong); color: var(--r12-ink); font-weight: 600; }
.sp-statusbar .sp-status.is-on b { color: var(--r12-ink); }

/* ---------- 模型库 ---------- */
.sp-library-layout { display: flex; align-items: flex-start; gap: 8px; }
.sp-library-main { flex: 1; min-width: 0; }
.sp-library-main .sp-toolbar { margin-bottom: 8px; }
.sp-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sp-lib-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border-radius: var(--r12-r-card); background: var(--r12-surface-2); border: 1px solid var(--r12-line); }
.sp-lib-top { display: flex; align-items: center; gap: 8px; }
.sp-lib-vendor { width: 24px; height: 24px; margin-left: auto; color: var(--r12-muted); }
.sp-lib-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-lib-name b { font-size: 14px; font-weight: 600; color: var(--r12-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-lib-name code { font-family: var(--font-mono); font-size: 10px; color: var(--r12-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-lib-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--r12-muted); }
.sp-lib-facts b { color: var(--r12-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-lib-foot { display: flex; align-items: center; justify-content: flex-end; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--r12-line); }

/* ---------- 我的模型：卡片 / 列表 ---------- */
.sp-view-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-pill); background: var(--r12-surface-2); }
.sp-view-toggle .btn { border: 0; background: transparent; color: var(--r12-muted); }
.sp-view-toggle .btn[aria-pressed="true"] { background: var(--r12-selected-bg); color: var(--r12-ink); font-weight: 600; }
.sp-mcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 10px; }
.sp-mcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border-radius: var(--r12-r-card); background: var(--r12-surface-2); border: 1px solid var(--r12-line); cursor: pointer; transition: border-color var(--r12-dur-2) var(--r12-ease); }
.sp-mcard:hover { border-color: var(--r12-line-strong); }
.sp-mcard.is-idle { opacity: .66; }
.sp-mcard-top { display: flex; align-items: center; gap: 8px; }
.sp-mcard-modality { flex: none; }
.sp-mcard-vendor { width: 26px; height: 26px; color: var(--r12-muted); }
.sp-mcard-access { margin-left: auto; }
.sp-mcard-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-mcard-name b { font-size: 14px; font-weight: 600; color: var(--r12-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-mcard-name code { font-family: var(--font-mono); font-size: 10px; color: var(--r12-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-mcard-line { font-size: 12px; color: var(--r12-muted); }
.sp-mcard-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--r12-muted); }
.sp-mcard-facts b { color: var(--r12-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--r12-line); }
.sp-mcard-actions { display: inline-flex; align-items: center; gap: 6px; }
.sp-mcard-listed { display: inline-flex; align-items: center; gap: 4px; }
.sp-mcard-listed em { font-style: normal; font-size: 11px; color: var(--r12-muted); }
.sp-mcard-listed[aria-disabled="true"] { opacity: .5; }
.sp-quick { margin-top: 8px; }
.sp-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-control); background: var(--r12-surface-2); }
.sp-more-text b { font-size: 13px; font-weight: 600; color: var(--r12-ink); }
.sp-more-text p { margin-top: 2px; font-size: 12px; color: var(--r12-muted); }
.sp-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.sp-pager-text { font-size: 12px; color: var(--r12-muted); }
.sp-pager-text b { color: var(--r12-ink); font-variant-numeric: tabular-nums; }
.sp-browse-foot { display: flex; justify-content: center; margin-top: 10px; }

/* ---------- 模型详情 ---------- */
.sp-detail-page { display: flex; flex-direction: column; gap: 8px; }
.sp-detail-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 8px; align-items: stretch; }
.sp-detail-main { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 16px; }
.sp-detail-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp-detail-vendor { width: 36px; height: 36px; color: var(--r12-ink); }
.sp-detail-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-detail-name b { font-size: 16px; font-weight: 600; color: var(--r12-ink); }
.sp-detail-name code { font-family: var(--font-mono); font-size: 11px; color: var(--r12-faint); }
.sp-detail-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sp-detail-desc { margin: 0; font-size: 12px; line-height: 1.6; color: var(--r12-muted); }
.sp-detail-figures { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.sp-detail-figure { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-detail-figure span { font-size: 11px; color: var(--r12-muted); }
.sp-detail-figure b { font-size: 16px; font-weight: 600; color: var(--r12-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-detail-figure em { font-style: normal; font-size: 11px; color: var(--r12-faint); }
.sp-access-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.sp-access-card .panel-head { margin-bottom: 0; }
.sp-access-rows { display: flex; flex-direction: column; gap: 6px; }
.sp-access-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.sp-access-row span { color: var(--r12-muted); flex: none; }
.sp-access-row b { font-weight: 500; color: var(--r12-ink); text-align: right; }
.sp-access-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sp-why { font-size: 11px; color: var(--r12-muted); }
.sp-detail-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-pill); background: var(--r12-surface-2); align-self: flex-start; }
.sp-detail-tab { height: 28px; padding: 0 14px; border: 0; border-radius: var(--r12-r-pill); background: transparent; color: var(--r12-muted); font: inherit; font-size: 13px; }
.sp-detail-tab:hover { background: var(--r12-hover); color: var(--r12-ink); }
.sp-detail-tab.is-on { background: var(--r12-selected-bg); color: var(--r12-ink); font-weight: 600; }
.sp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.sp-param-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sp-param-head h3 { font-size: 13px; font-weight: 600; color: var(--r12-ink); }
.sp-param-table { min-width: 860px; }
.sp-param-table td { vertical-align: middle; }
.sp-param-table td > * { vertical-align: middle; }
.sp-param-ops .btn { vertical-align: middle; }
.sp-type-seg { flex-wrap: nowrap; }
.sp-range { display: inline-flex; align-items: center; gap: 4px; }
.sp-range .input { width: 64px; }
.sp-range em { font-style: normal; color: var(--r12-faint); }
.sp-param-ops { display: flex; justify-content: flex-end; gap: 4px; }
.sp-test-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.sp-test-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.sp-test-output { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.sp-test-output-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sp-test-output-head b { font-size: 13px; font-weight: 600; color: var(--r12-ink); }
.sp-test-output-head span { font-size: 11px; color: var(--r12-faint); }
.sp-test-result { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--r12-line); border-radius: var(--r12-r-control); background: var(--r12-surface-3); }
.sp-test-result.is-idle { color: var(--r12-muted); font-size: 12px; }
.sp-test-verdict { display: flex; align-items: center; gap: 6px; }
.sp-test-detail { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.sp-test-detail span { color: var(--r12-muted); }
.sp-test-detail b { font-weight: 600; color: var(--r12-ink); font-variant-numeric: tabular-nums; }
.sp-test-note { font-size: 12px; color: var(--r12-muted); }
.sp-preview { display: flex; align-items: center; justify-content: center; min-height: 96px; border: 1px dashed var(--r12-line-strong); border-radius: var(--r12-r-control); color: var(--r12-faint); font-size: 12px; }

/* ---------- 接入 ---------- */
.sp-url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row-sub { margin-top: 2px; font-size: 11px; color: var(--r12-faint); }
.sp-row-sub.is-warn { color: var(--r12-error); }
/* 操作列用行内 flex，别直接改 td 的 display：否则这一格会脱离表格行，垂直居中跑偏。 */
.sp-row-ops { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.sp-masked { letter-spacing: 1px; }
.sp-endpoint-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sp-endpoint-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--r12-line); }
.sp-endpoint-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.sp-endpoint-title b { font-size: 14px; font-weight: 600; color: var(--r12-ink); }
.sp-endpoint-title .sp-url { max-width: 360px; font-size: 11px; color: var(--r12-faint); }
.sp-endpoint-meta { font-size: 12px; color: var(--r12-muted); white-space: nowrap; }
.sp-endpoint-time { font-size: 11px; color: var(--r12-faint); white-space: nowrap; }
.sp-key-table { min-width: 760px; }
.sp-endpoint-card .table-wrap { padding: 0 14px; }
.sp-endpoint-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px 12px; }
.sp-endpoint-foot .hint { margin: 0; }

/* ---------- 成员与权限 ---------- */
.sp-perms { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.sp-perm { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--r12-muted); white-space: nowrap; }
.sp-perm input { accent-color: var(--r12-ink); }
.sp-perm input:disabled { opacity: .6; }
.sp-perms-edit { flex-direction: column; align-items: flex-start; gap: 6px; }
.sp-apply-list { display: flex; flex-direction: column; }
.sp-apply { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--r12-line); }
.sp-apply:last-child { border-bottom: 0; }
.sp-apply-body { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.sp-apply-body b { font-size: 13px; font-weight: 600; color: var(--r12-ink); }
.sp-apply-body em { font-style: normal; font-size: 11px; color: var(--r12-faint); }
.sp-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

@media (max-width: 1180px) {
  .sp-detail-head { grid-template-columns: minmax(0, 1fr); }
  .sp-test-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-form-grid { grid-template-columns: minmax(0, 1fr); }
}
