/* 模型接入页专用样式 */

/* ---------- Hero ---------- */
.page-hero h1 .text-grad { display: inline-block; }
.mh-actions { justify-content: flex-start; }
.mh-facts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-8); margin-top: var(--sp-8); }
.mh-facts li { display: flex; flex-direction: column; }
.mh-facts b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.1; color: var(--text); letter-spacing: -.02em; }
.mh-facts span { font-size: 13px; color: var(--text-3); }
.mh-note { margin-top: var(--sp-6); max-width: 560px; }

.mh-mock .mock-body { padding: var(--sp-4); }
.chan-head, .chan-list li { display: grid; grid-template-columns: 1fr auto 66px; gap: 12px; align-items: center; }
.chan-head { padding: 0 10px 8px; font-size: 12px; color: var(--text-3); }
.chan-head span:first-child { padding-left: 0; }
.chan-list { list-style: none; display: grid; gap: 6px; }
.chan-list li {
  grid-template-columns: 34px minmax(0, 1fr) auto 66px;
  padding: 8px 10px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.chan-head { grid-template-columns: 1fr auto 66px; }
.chan-list .vendor-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
.chan-name { min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
.chan-name small { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-sans); }
.chan-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.chan-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.chan-st.ok::before { background: var(--success); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.chan-st.standby::before { background: var(--warning); }
.chan-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: var(--sp-3); padding: 0 4px; font-size: 12px; color: var(--text-3); }

/* ---------- 模型筛选 ---------- */
.model-filter {
  display: grid; gap: var(--sp-3); margin-bottom: var(--sp-8);
  padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
}
.mf-row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.mf-label { flex: none; width: 64px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.mf-count { margin: 0; font-size: 13px; color: var(--text-3); }
.mf-count b { color: var(--text); }
.mf-empty { text-align: center; padding: var(--sp-10) var(--sp-4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-3); }

.vendor-group + .vendor-group { margin-top: var(--sp-10); }
.vendor-group[hidden] { display: none; }
.vg-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.vg-title svg { width: 20px; height: 20px; color: var(--primary); }
.vg-title .muted { font-size: 13px; font-weight: 500; }
.vendor-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.vendor-grid .vendor-card { align-items: flex-start; }
.vendor-grid .vendor-card[hidden] { display: none; }
.vendor-grid .vendor-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.vendor-grid .vendor-card > div { min-width: 0; }
.v-caps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.v-caps .tag { font-size: 11.5px; padding: 1px 6px; }
.vendor-mark.vm-any { background: var(--bg-muted); color: var(--text-2); border: 1px dashed var(--border-strong); font-family: var(--font-mono); font-size: 14px; }
.vendor-card.is-match .v-caps .tag.is-hit { background: var(--primary-soft); color: var(--primary-soft-text); border-color: transparent; }
@media (max-width: 1024px) { .vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 英文标签更长 */
:lang(en) .mf-label { width: 84px; }
@media (max-width: 768px) {
  .vendor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-filter { padding: var(--sp-4); }
  .mf-row { gap: var(--sp-2); }
  .mf-label, :lang(en) .mf-label { width: 100%; }
}
@media (max-width: 480px) {
  .vendor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .vendor-grid .vendor-card { flex-direction: column; gap: 8px; padding: 12px; }
  .vendor-grid .vendor-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
  .vendor-grid .v-desc { display: none; }
  .v-caps { margin-top: 6px; }
}

/* ---------- 统一 API：命名规则 ---------- */
.name-rules { display: grid; gap: 0; margin: var(--sp-6) 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.name-rules > div { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: var(--sp-4); align-items: center; padding: 10px 14px; }
.name-rules > div + div { border-top: 1px solid var(--border); }
.name-rules dt code { font-size: 13px; white-space: nowrap; }
.name-rules dd { margin: 0; font-size: 14px; color: var(--text-2); }
@media (max-width: 480px) { .name-rules > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- 智能路由示意 ---------- */
.route-tip { margin-top: var(--sp-5); font-size: 13px; color: var(--text-3); }
.route-viz {
  padding: var(--sp-6); border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.rv-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.rv-strategies button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.rv-req {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 0 auto; padding: 10px 14px; max-width: 420px; border-radius: var(--r-md);
  background: var(--code-bg); color: var(--code-text); font-family: var(--font-mono); font-size: 13px;
}
.rv-req code { background: none; padding: 0; color: inherit; }
.rv-method { padding: 1px 7px; border-radius: 4px; background: rgba(52,211,153,.18); color: var(--brand-300); font-weight: 700; font-size: 12px; }
.rv-model { color: #c3e88d; }
.rv-stem { width: 2px; height: 22px; margin: 0 auto; background: var(--border-strong); }
.rv-core {
  margin: 0 auto; max-width: 420px; padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); text-align: center;
  background: linear-gradient(160deg, #10261f 0%, #0f5c45 55%, #0e7466 100%); color: #fff;
  box-shadow: 0 14px 36px rgba(16, 185, 129,.3);
}
.rv-core-title { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; }
.rv-core-title svg { width: 20px; height: 20px; }
.rv-rule { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.85); min-height: 1.6em; }
.rv-branches { width: 100%; height: 40px; overflow: visible; }
.rv-branches path { fill: none; stroke: var(--border-strong); stroke-width: 2; vector-effect: non-scaling-stroke; transition: stroke .3s, opacity .3s; }
.rv-branches path.is-on { stroke: var(--primary); stroke-dasharray: 6 5; animation: rv-dash 1s linear infinite; }
.rv-branches path.is-off { opacity: .35; stroke-dasharray: 3 4; }
@keyframes rv-dash { to { stroke-dashoffset: -11; } }
.rv-targets { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.rv-target {
  padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .3s, box-shadow .3s, opacity .3s;
}
.rv-target.is-top { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(52, 211, 153,.14); }
.rv-target.is-down { opacity: .7; border-style: dashed; }
.rv-t-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rv-t-head .vendor-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.rv-t-head > span:last-child { min-width: 0; line-height: 1.3; }
.rv-t-head b { display: block; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-t-head small { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-bar { height: 6px; margin: 12px 0 8px; border-radius: 3px; background: var(--bg-muted); overflow: hidden; }
.rv-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--grad-brand); transition: width .5s var(--ease); }
.rv-t-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.rv-share { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; font-size: 14px; }
.rv-state { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); white-space: nowrap; }
.rv-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rv-state.ok { color: var(--success); }
.rv-state.down { color: var(--danger); }
.rv-state.probe { color: var(--warning); }
.rv-actions { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); flex-wrap: wrap; }
.rv-actions .btn { flex: none; }
.rv-log { flex: 1 1 200px; margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.route-cards { margin-top: var(--sp-16); }
@media (max-width: 560px) {
  .route-viz { padding: var(--sp-4); }
  .rv-strategies { display: flex; width: 100%; flex-wrap: nowrap; }
  .rv-strategies button { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; white-space: nowrap; }
  .rv-targets { grid-template-columns: 1fr; }
  .rv-branches { display: none; }
  .rv-core { margin-bottom: var(--sp-4); }
}

/* ---------- 计量与配额 ---------- */
.quota-mock .mock-body { display: grid; gap: var(--sp-4); }
.q-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.q-kpis > div { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.q-kpis span { display: block; font-size: 12px; color: var(--text-3); }
.q-kpis b { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.q-list { list-style: none; display: grid; gap: 4px; }
.q-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 96px; gap: var(--sp-4); align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.q-list li:last-child { border-bottom: 0; }
.q-name b { display: block; font-size: 14px; color: var(--text); }
.q-name small { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-bar { height: 8px; border-radius: 4px; background: var(--bg-muted); overflow: hidden; }
.q-bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad-brand); }
.q-bar.warn i { background: var(--warning); }
.q-bar.danger i { background: var(--danger); }
.q-list .badge { justify-self: end; white-space: nowrap; }
:lang(en) .q-list li { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 118px; }
.q-badge-danger { background: rgba(248,113,113,.14); color: var(--danger); }
.q-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.q-note { margin: 0; font-size: 12px; color: var(--text-3); text-align: right; }
@media (max-width: 480px) {
  .q-kpis b { font-size: 16px; }
  .q-list li, :lang(en) .q-list li { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .q-list .q-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- 能力类型 ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-5); }
.cap-card { display: flex; flex-direction: column; }
.cap-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cap-top .badge { flex: none; }
.cap-card p { flex: 1; }
.cap-ep { align-self: flex-start; margin-top: var(--sp-4); font-size: 12px; color: var(--text-2); }
@media (max-width: 1024px) { .cap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cap-grid { grid-template-columns: 1fr; } }

/* ---------- 对比表 ---------- */
.compare-table { min-width: 860px; }
.compare-table thead th { white-space: nowrap; }
@media (max-width: 768px) { .compare-table td { white-space: nowrap; } }
.compare-table tbody th { font-weight: 600; color: var(--text); white-space: nowrap; }
.compare-table td .badge { white-space: nowrap; }
.legend-row { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); align-items: center; margin-top: var(--sp-4); font-size: 13px; color: var(--text-2); }
.legend-row > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 本地接入 ---------- */
.step-code { margin-top: var(--sp-4); padding: 12px 14px; font-size: 12.5px; line-height: 1.6; }
.step { display: flex; flex-direction: column; }
.step p { margin-bottom: 0; flex: 1 0 auto; }
.discover-mock { max-width: 900px; margin: var(--sp-12) auto 0; }
.discover-body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.dm-form { display: grid; gap: var(--sp-3); align-content: start; }
.dm-field { display: grid; gap: 4px; }
.dm-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.dm-input { display: block; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-input.mono { font-family: var(--font-mono); font-size: 13px; }
.dm-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--success); font-weight: 600; }
.dm-ok svg { width: 16px; height: 16px; }
.dm-found { padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.dm-found-head { display: flex; justify-content: space-between; margin-bottom: var(--sp-3); font-size: 14px; }
.dm-found-head .muted { font-size: 12px; }
.dm-found ul { list-style: none; display: grid; gap: 8px; }
.dm-found li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dm-found li code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; background: none; padding: 0; color: var(--text); }
.dm-check { flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); background: var(--surface); }
.dm-check.on {
  border-color: var(--primary);
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat;
}
@media (max-width: 768px) { .discover-body { grid-template-columns: 1fr; } .discover-mock { margin-top: var(--sp-8); } }
