/* ==================================================================
   L · 管理后台 v2
   模型定价（分面筛选 / 数据表 / 批量条 / 右侧编辑抽屉）
   上游渠道（健康度 / 协议卡 / 行内优先级）
   与 admin.css / app.css 的单色主题共用同一套 CSS 变量
   ================================================================== */

/* ---------- 布局与侧栏分组 ---------- */
[hidden] { display: none !important; }
.admin-content { max-width: 1600px; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-label {
  font-size: 10.5px; letter-spacing: .09em; color: var(--muted-2);
  padding: 8px 14px 4px; font-weight: 600;
}
.admin-side nav { padding-bottom: 6px; }
.admin-head { z-index: 30; }

.adm-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.adm-page-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.adm-page-head p { margin: 0; max-width: 760px; line-height: 1.65; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- KPI ---------- */
.adm-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 15px; box-shadow: var(--shadow); min-width: 0;
}
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 23px; font-weight: 800; color: var(--green-900); margin: 3px 0 1px; line-height: 1.25; }
.kpi-value.warn { color: var(--warn); }
.kpi-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpi.clickable:hover { border-color: var(--green-400); }
.kpi.on { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.toolbar .input { height: 36px; width: auto; min-width: 118px; padding: 7px 10px; }
.toolbar select.input { padding-right: 26px; }
.toolbar-note { margin-left: auto; font-size: 12px; }

.searchbox { position: relative; flex: 1 1 280px; min-width: 240px; display: flex; }
.searchbox .input { width: 100%; height: 36px; padding: 7px 30px 7px 32px; }
.searchbox .search-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); font-size: 15px; pointer-events: none;
}
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: var(--green-50);
  color: var(--green-800); line-height: 1; font-size: 14px; padding: 0;
}
.search-clear:hover { background: var(--green-100); }

.link-btn {
  border: 0; background: none; color: var(--green-700); font-size: 12px; padding: 2px 0;
}
.link-btn:hover { color: var(--green-900); text-decoration: underline; }
.link-btn:disabled { color: var(--muted-2); cursor: default; text-decoration: none; }

/* ---------- 活跃筛选 chips ---------- */
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 0; margin-bottom: 10px; }
.active-filters:empty { display: none; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800);
  border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 12px;
}
.fchip button {
  width: 18px; height: 18px; border: 0; border-radius: 50%; padding: 0;
  background: rgba(17,24,39,.06); color: var(--green-800); line-height: 1; font-size: 12px;
}
.fchip button:hover { background: var(--green-100); }

/* ---------- 模型页双栏 ---------- */
.models-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 16px; align-items: start; }
.models-main { min-width: 0; }

.facet-panel {
  position: sticky; top: 74px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 10px; max-height: calc(100vh - 96px); overflow: auto;
  box-shadow: var(--shadow);
}
.facet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; }
.facet-head b { font-size: 13px; }
.facet-group { padding: 6px 0; border-top: 1px dashed var(--border); }
.facet-group:first-of-type { border-top: 0; }
.facet-title { font-size: 11px; color: var(--muted-2); letter-spacing: .05em; padding: 2px 6px 4px; font-weight: 600; }
.facet-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; padding: 5px 7px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); text-align: left;
}
.facet-item:hover { background: var(--green-50); }
.facet-item.on { background: var(--green-50); color: var(--green-900); font-weight: 600; }
.facet-item .facet-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-item b { font-size: 11px; font-weight: 600; color: var(--muted-2); }
.facet-item.on b { color: var(--green-700); }
.facet-scroll { max-height: 236px; overflow: auto; }

/* ---------- 数据表 v2 ---------- */
.models-table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: auto; max-height: calc(100vh - 360px); min-height: 300px; box-shadow: var(--shadow);
}
.m-filter-btn { display: none; }
.dt2 { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 900px; table-layout: fixed; }
.dt2 thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.dt2 thead th.sortable { cursor: pointer; user-select: none; }
.dt2 thead th.sortable:hover { color: var(--green-800); background: var(--green-50); }
.dt2 .sort-ico { display: inline-block; margin-left: 4px; color: var(--muted-2); font-size: 10px; }
.dt2 .sort-ico.on { color: var(--green-900); }
.dt2 tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dt2 tbody tr:last-child td { border-bottom: 0; }
.dt2 tbody tr:hover { background: var(--surface-2); }
.dt2 tbody tr.is-selected { background: var(--green-50); }
.dt2 tbody tr.is-selected:hover { background: var(--green-100); }
.dt2 .num { text-align: right; }
.dt2 .small, .small { font-size: 11px; }
.dt2 th.col-check, .dt2 td.col-check { width: 34px; padding-right: 2px; }
.dt2 .col-model { width: auto; overflow: hidden; }
.dt2 .col-type { width: 112px; overflow: hidden; }
.dt2 .col-channel { width: 112px; overflow: hidden; }
.dt2 .col-price { width: 102px; }
.dt2 .col-margin { width: 118px; }
.dt2 .col-rate { width: 68px; }
.dt2 .col-status { width: 56px; }
.dt2 .col-ops { width: 146px; }

.model-name {
  border: 0; background: none; padding: 0; text-align: left; font-weight: 600; color: var(--ink);
  font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}
.model-name:hover { color: var(--green-800); text-decoration: underline; }
.model-sub { color: var(--muted); font-size: 10.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.type-bill { margin-left: 5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }

.price-chip {
  border: 0; background: none; padding: 0; font-size: 14px; font-weight: 700; color: var(--ink);
  border-bottom: 1px dashed transparent;
}
.price-chip:hover { color: var(--green-800); border-bottom-color: var(--green-400); }
.inline-price { width: 88px; height: 30px; padding: 4px 8px; font-size: 13px; }
.inline-hint { font-size: 10px; color: var(--muted); margin-top: 2px; }
.cost { color: var(--ink-2); }

.ratebar { width: 44px; height: 4px; background: var(--green-100); border-radius: 4px; overflow: hidden; margin-bottom: 3px; }
.ratebar i { display: block; height: 100%; background: var(--green-500); }
.ratebar.mid i { background: var(--gold); }
.ratebar.low i { background: var(--danger); }

.switch {
  width: 34px; height: 20px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--border-strong); position: relative; padding: 0; transition: background .15s;
}
.switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: left .15s; }
.switch.on { background: var(--green-700); border-color: var(--green-700); }
.switch.on i { left: 16px; }

.row-ops { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-ops .btn, .row-ops .icon-btn, .row-ops .row-menu { flex: 0 0 auto; white-space: nowrap; }
.icon-btn {
  width: 28px; height: 28px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 14px; padding: 0;
}
.icon-btn:hover { background: var(--green-50); color: var(--green-800); border-color: var(--green-100); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.danger-text, .icon-btn.danger { color: var(--danger); }

.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] { z-index: 5; }
.row-menu-list {
  position: absolute; right: 0; top: 30px; min-width: 132px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 5px; z-index: 10;
}
.row-menu-list button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 9px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2);
}
.row-menu-list button:hover { background: var(--green-50); }
.row-menu-list button.danger { color: var(--danger); }
.row-menu-list button.danger:hover { background: var(--danger-soft); }

.tag-plain { background: var(--green-100); color: var(--ink-2); }
.tag-violet { background: var(--green-100); color: var(--ink-2); }
.tag-gold { background: var(--gold-soft); color: var(--green-800); }

/* 渠道标签：统一中性色，渠道名称保留文字区分 */
.ch-tag {
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 2px 7px; border-radius: 6px;
  font-size: 11px; line-height: 1.5; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.ch-auto,
.ch-yingke,
.ch-czniu,
.ch-a6,
.ch-xinbi,
.ch-aicost,
.ch-sd2 { background: var(--green-100); color: var(--ink-2); }
.facet-item.zero { opacity: .58; }
.facet-item.zero.on { opacity: 1; }

/* ---------- 空状态 / 加载 ---------- */
.empty-state { text-align: center; padding: 46px 20px; }
.empty-ico { font-size: 26px; color: var(--green-400); margin-bottom: 6px; }
.empty-state b { display: block; font-size: 14px; margin-bottom: 4px; }
.empty-state p { margin: 0 0 12px; }
.loading-block { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pager-info { flex: 0 0 auto; white-space: nowrap; }
.pager-info b { color: var(--ink-2); }
.pager-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: 0 0 auto; }
.pager-btn {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--ink-2); font-size: 12px;
}
.pager-btn:hover:not(:disabled) { background: var(--green-50); }
.pager-btn.on { background: var(--green-900); color: #fff; }
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-gap { color: var(--muted-2); padding: 0 2px; }
.pager-size { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; white-space: nowrap; }
.pager-size select { height: 28px; padding: 2px 6px; font-size: 12px; }

/* ---------- 批量操作条 ---------- */
.bulkbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 7px 10px; box-shadow: 0 14px 40px rgba(0,0,0,.25); z-index: 120;
  max-width: calc(100vw - 32px);
}
.bulkbar[hidden] { display: none; }
.bulk-count { font-size: 12.5px; padding: 0 6px; white-space: nowrap; }
.bulk-count b { color: #d1d5db; }
.bulk-sep { width: 1px; height: 18px; background: rgba(255,255,255,.16); margin: 0 3px; }
.bulk-btn {
  border: 0; background: none; color: rgba(255,255,255,.88); font-size: 12.5px;
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
}
.bulk-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.bulk-btn.danger { color: #ffb9b2; }
.bulk-btn.danger:hover { background: rgba(192,80,77,.32); }
.bulk-btn.ghost { color: rgba(255,255,255,.6); }

/* ---------- 右侧抽屉 ---------- */
body.adm-drawer-open { overflow: hidden; }
.adm-drawer-mask {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.25);
  display: none; justify-content: flex-end;
}
.adm-drawer-mask.show { display: flex; }
.adm-drawer {
  display: flex; flex-direction: column; height: 100%; background: var(--surface);
  width: 760px; max-width: 100vw; box-shadow: -18px 0 50px rgba(0,0,0,.12);
  animation: admSlideIn .22s cubic-bezier(.2,.8,.25,1);
}
.adm-drawer-mask.size-md .adm-drawer { width: 620px; }
.adm-drawer-mask.size-lg .adm-drawer { width: 760px; }
.adm-drawer-mask.size-xl .adm-drawer { width: 980px; }
@keyframes admSlideIn { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.adm-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 16px 20px 13px; border-bottom: 1px solid var(--border); background: #fff;
}
.adm-drawer-titles h3 { margin: 0 0 2px; font-size: 16px; }
.adm-drawer-titles p { margin: 0; font-size: 11.5px; line-height: 1.5; }
.adm-drawer-body { flex: 1; overflow: auto; padding: 18px 20px 26px; }
.adm-drawer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.mfoot-left { min-width: 0; }
.mfoot-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 模型编辑器 ---------- */
.mform { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 20px; align-items: start; }
.mform-main { min-width: 0; }
.mtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.mtab {
  border: 0; background: none; padding: 8px 12px; font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mtab:hover { color: var(--green-800); }
.mtab.on { color: var(--green-900); border-bottom-color: var(--green-900); font-weight: 600; }

.mform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mform-grid.tight { grid-template-columns: repeat(3, 1fr); }
.mfield { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; min-width: 0; }
.mfield > label, .mfield-label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.mfield > .input, .mfield > textarea, .mfield > .seg2, .mfield > .chip-input,
.mfield > .input-with-btn, .mfield > .proto-cards, .mfield > select { margin-top: 5px; }
.mfield.span2 { grid-column: span 2; }
.mfield .input { width: 100%; }
.mfield input[type="number"] { font-variant-numeric: tabular-nums; }
.req { color: var(--danger); }
.mform-grid .mfield { margin-bottom: 4px; }

.seg2 { display: inline-flex; gap: 2px; background: var(--green-100); border-radius: 9px; padding: 3px; align-self: flex-start; }
.seg2 button {
  border: 0; background: none; padding: 6px 13px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2);
}
.seg2 button.on { background: #fff; color: var(--green-900); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 5px 7px;
  min-height: 38px; background: #fff; cursor: text;
}
.chip-input:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.chip {
  display: inline-flex; align-items: center; gap: 2px; background: var(--green-50);
  color: var(--green-800); border-radius: 7px; padding: 2px 4px 2px 8px; font-size: 12px;
}
.chip button { border: 0; background: none; color: var(--green-700); width: 16px; height: 16px; padding: 0; line-height: 1; }
.chip-entry { border: 0; outline: 0; flex: 1; min-width: 96px; font-size: 12.5px; background: transparent; height: 24px; }
.chip-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip-sug {
  border: 1px dashed var(--border-strong); background: #fff; color: var(--muted);
  border-radius: 99px; padding: 3px 9px; font-size: 11px;
}
.chip-sug:hover { color: var(--green-800); border-color: var(--green-400); background: var(--green-50); }

/* 定价 */
.price-hero { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 12px; align-items: end; }
.price-hero .mfield { margin-bottom: 6px; }
.price-input { font-size: 16px; font-weight: 700; }
.margin-big { font-size: 22px; font-weight: 800; color: var(--green-900); line-height: 1.5; margin-top: 2px; }
.margin-big.range { font-size: 17px; }
.margin-big.neg { color: var(--danger); }
.margin-track { height: 5px; background: var(--green-100); border-radius: 5px; overflow: hidden; }
.margin-track.wide { margin-top: 2px; }
.margin-track i { display: block; height: 100%; background: var(--green-500); border-radius: 5px; }
.margin-track i.neg { background: var(--danger); }

.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 8px; }
.sec-head b { font-size: 13px; }
.sec-head .dim { font-size: 11.5px; }

.tier-table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.price-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.price-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.price-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.price-table .tag { white-space: nowrap; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table .input { height: 30px; padding: 3px 8px; font-size: 12px; }
.price-table .tier-key { width: 100%; min-width: 84px; }
.price-table .tier-price { width: 96px; }
.price-table .tier-markup { width: 70px; }
.price-table .num { text-align: right; }
.tier-add { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tier-add select.input { width: 140px; height: 32px; padding: 3px 24px 3px 8px; }
.tier-add input.input { flex: 1; min-width: 120px; height: 32px; padding: 5px 8px; }

/* 定价页：探测参考 */
.probe-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 10px 12px; margin-top: 14px; font-size: 12px; }
.probe-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.probe-head b { font-size: 12.5px; }
.probe-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.probe-table th, .probe-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); }
.probe-table th { color: var(--muted); font-weight: 500; }
.probe-table .num { text-align: right; }
.probe-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.price-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.price-tools input.input { width: 64px; height: 30px; display: inline-block; padding: 3px 7px; }

.price-preview {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 11px 13px; font-size: 12px;
}
.price-preview .input { height: 30px; width: auto; padding: 3px 8px; }
.price-preview label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.price-preview input[type="number"] { width: 64px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.input:disabled, .input[readonly], textarea.input[readonly] { background: var(--green-100); color: var(--muted); cursor: not-allowed; }
.test-out { margin-left: auto; text-align: right; }
.test-pay { font-size: 12px; color: var(--muted); }
.test-pay b { font-size: 20px; color: var(--green-900); margin-right: 2px; }
.test-pay .tag { margin-left: 6px; }

.mfieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); margin: 6px 0 14px; }
.mfieldset-title { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; color: var(--ink-2); }
.json-box { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; background: var(--surface-2); }
.json-box summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.json-box pre { margin: 8px 0 2px; max-height: 220px; overflow: auto; font-size: 11px; line-height: 1.5; color: var(--ink-2); }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px dashed var(--danger-soft); background: #fdf8f7; border-radius: 12px; padding: 12px 14px; margin-top: 18px;
}
.danger-zone b { font-size: 12.5px; }

/* 右侧摘要 */
.mside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.mside-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; background: var(--surface-2); }
.mside-label { font-size: 11.5px; color: var(--muted); }
.mside-price { margin: 2px 0 6px; }
.mside-price b { font-size: 26px; font-weight: 800; color: var(--green-900); }
.mside-price span { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.mside-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 2px 0; }
.mside-row b { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: right; }
.mside-row b.pos { color: var(--green-700); }
.mside-row b.neg { color: var(--danger); }
.mside-tips { font-size: 11.5px; color: var(--muted); line-height: 1.7; padding: 4px 2px; }
.mside-tips b { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 3px; }
.mside-tips p { margin: 3px 0; }

/* 批量调价预览 */
.bulk-preview { margin-top: 12px; font-size: 12px; }
.bulk-preview .preview-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th, .mini-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-table th { color: var(--muted); font-weight: 500; }
.mini-table .up { color: var(--danger); }
.mini-table .down { color: var(--green-700); }

/* ---------- 渠道页 ---------- */
.channel-card { padding: 8px 10px; overflow: hidden; }
.channel-table { min-width: 1000px; }
.channel-table .col-st { width: 46px; }
.channel-table .col-name { width: 200px; overflow: hidden; }
.channel-table .col-count { width: 56px; }
.channel-table .col-url { width: 220px; overflow: hidden; }
.channel-table .col-key { width: 120px; overflow: hidden; }
.channel-table .col-pri { width: 74px; }
.channel-table .col-proxy { width: 100px; overflow: hidden; }
.channel-table .col-health { width: 130px; }
.channel-table .col-ops { width: 206px; }
.channel-table tr.is-off td { opacity: .62; }
.ch-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.ch-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.pri-input { width: 62px; height: 28px; padding: 3px 6px; text-align: center; font-size: 12px; }
.url-btn {
  border: 0; background: none; padding: 0; font-size: 11px; color: var(--ink-2);
  max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.url-btn:hover { color: var(--green-800); text-decoration: underline; }
.health-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); margin-right: 5px; vertical-align: 1px; }
.health-dot.ok { background: #22a35a; }
.health-dot.bad { background: var(--danger); }
.health-dot.idle { background: #c9d2cb; }
.spinner {
  display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border-strong);
  border-top-color: var(--green-600); border-radius: 50%; animation: admSpin .8s linear infinite;
}
@keyframes admSpin { to { transform: rotate(360deg); } }

.proto-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.proto-card {
  text-align: left; border: 1px solid var(--border-strong); border-radius: 11px;
  background: #fff; padding: 9px 10px; display: flex; flex-direction: column; gap: 3px;
}
.proto-card b { font-size: 12.5px; color: var(--ink); }
.proto-card span { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.proto-card:hover { border-color: var(--green-400); }
.proto-card.on { border-color: var(--green-700); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green-700); }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn .input { flex: 1; min-width: 0; }
.check-list { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }

/* ---------- 模型探测 ---------- */
.disc-channels { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.disc-ch {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 150px; padding: 8px 12px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 12px; text-align: left;
}
.disc-ch:hover { border-color: var(--green-400); }
.disc-ch.on { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); background: var(--green-50); }
.disc-ch-name { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.disc-ch b { font-size: 17px; color: var(--green-900); line-height: 1.2; }
.disc-ch-meta { font-size: 10.5px; color: var(--muted); }
.disc-table { min-width: 1080px; }
.disc-table .col-channel { width: 110px; }
.disc-table .col-type { width: 112px; }
.disc-table .col-cost { width: 172px; }
.disc-table .col-price { width: 184px; }
.disc-table .col-change { width: 96px; }
.disc-table .col-status { width: 122px; }
.disc-table .col-ops { width: 152px; }
.disc-table .num { text-align: right; }
.disc-table td .tag { margin-bottom: 2px; }
.disc-model-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tag { font-size: 10.5px; padding: 1px 6px; }
.disc-table-wrap { max-height: calc(100vh - 465px); min-height: 280px; }
.disc-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.disc-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.disc-raw { max-height: 340px; overflow: auto; font-size: 11px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; background: var(--surface-2); padding: 8px; border-radius: 8px; }

/* 上架弹窗：按档位加价 */
.dp-tiers { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.dp-tiers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.dp-tiers-head label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dp-tiers-head .input { width: 66px; height: 30px; padding: 3px 8px; text-align: center; }
.dp-tier-grid { display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow: auto; }
.dp-tier-row { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px; align-items: center; }
.dp-tier-row.no-ref { grid-template-columns: 64px 1fr; }
.dp-tier-name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.dp-tier-row label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.dp-tier-row label .input { width: 100%; min-width: 0; height: 29px; padding: 3px 7px; }
@media (max-width: 900px) {
  .disc-price-grid { grid-template-columns: 1fr; }
  .disc-table-wrap { max-height: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .models-layout { grid-template-columns: 1fr; }
  .facet-panel { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 14px; }
  .facet-head { grid-column: 1 / -1; }
  .facet-group { border-top: 1px solid var(--border); }
  .facet-scroll { max-height: none; }
  .mform { grid-template-columns: 1fr; }
  .mside { position: static; flex-direction: row; flex-wrap: wrap; }
  .mside-card { flex: 1 1 210px; }
  .mside-tips { flex: 1 1 100%; }
  .models-table-wrap { max-height: none; }
}
@media (max-width: 900px) {
  .adm-kpis { grid-template-columns: 1fr 1fr; }
  .adm-page-head { gap: 10px; }
  .mform-grid, .mform-grid.tight, .price-hero { grid-template-columns: 1fr; }
  .mfield.span2 { grid-column: auto; }
  .proto-cards { grid-template-columns: 1fr; }
  .adm-drawer, .adm-drawer-mask.size-md .adm-drawer, .adm-drawer-mask.size-lg .adm-drawer, .adm-drawer-mask.size-xl .adm-drawer { width: 100%; }
  .bulkbar { left: 10px; right: 10px; transform: none; justify-content: center; }
  .toolbar .searchbox { flex-basis: 100%; }
}

/* ================================================================================
 * 手机后台：侧栏改为顶部横向导航，表格内部横向滚动，不撑破页面
 * ================================================================================ */
@media (max-width: 900px) {
  .admin-side {
    position: static; width: 100%; height: auto; min-height: 0;
    padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .admin-logo { padding: 2px 4px 6px; font-size: 15px; }
  .admin-logo .logo { width: 30px; height: 30px; font-size: 16px; }
  #adminNav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  #adminNav .nav-group { display: contents; }
  #adminNav .nav-label { display: none; }
  #adminNav .adm-nav { flex: 0 0 auto; white-space: nowrap; margin: 0; padding: 8px 10px; font-size: 12.5px; }
  .admin-side-foot { display: flex; gap: 8px; margin-top: 6px; }
  .admin-side-foot .btn { width: auto; flex: 1; margin-top: 0 !important; }
  .admin-head { height: 48px; padding: 0 12px; }
  .tab-title { font-size: 15px; }
  .admin-content { padding: 12px; overflow-x: hidden; }
  .adm-page-head h2 { font-size: 17px; }
  .adm-actions { width: 100%; }
  .adm-actions .btn { flex: 1; }
  .adm-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 20px; }
  .toolbar { gap: 6px; }
  .toolbar .input { flex: 1 1 120px; min-width: 0; }
  .facet-panel { display: flex; overflow-x: auto; gap: 8px; padding: 8px; max-height: none; }
  .facet-head { display: none; }
  .facet-group { min-width: 150px; border-top: 0; padding: 0 8px; }
  .facet-scroll { max-height: none; overflow: visible; }
  .models-table-wrap { max-height: none; }
  .pager { flex-wrap: wrap; gap: 6px; }
  .pager-nav { margin-left: auto; }
  .dt { min-width: 620px; }
  .dt2 { min-width: 900px; }
  .cardx { overflow-x: auto; }
  .channel-card { padding: 0; }
  .disc-channels { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .disc-ch { flex: 0 0 auto; min-width: 135px; }
  .adm-drawer { width: 100%; }
  .mform { grid-template-columns: 1fr; }
  .mside { position: static; flex-direction: row; flex-wrap: wrap; }
  .mside-card { flex: 1 1 200px; }
  .mside-tips { flex: 1 1 100%; }
  .price-hero { grid-template-columns: 1fr; }
  .disc-price-grid { grid-template-columns: 1fr; }
  .admin-head { top: 0; }
  .disc-table .col-model { width: 220px; }

  /* 横向滚动时冻结勾选列与模型列，手机上始终能看到“在改哪个模型” */
  .dt2 thead th.col-check, .dt2 thead th.col-model { position: sticky; z-index: 3; background: var(--surface-2); }
  .dt2 thead th.col-check { left: 0; }
  .dt2 thead th.col-model { left: 34px; }
  .dt2 tbody td.col-check, .dt2 tbody td.col-model { position: sticky; z-index: 2; background: var(--surface); }
  .dt2 tbody td.col-check { left: 0; }
  .dt2 tbody td.col-model { left: 34px; box-shadow: 1px 0 0 var(--border); }
  .dt2 tbody tr:hover td.col-check, .dt2 tbody tr:hover td.col-model { background: var(--surface-2); }
  .dt2 tbody tr.is-selected td.col-check, .dt2 tbody tr.is-selected td.col-model { background: var(--green-50); }
}

@media (max-width: 600px) {
  .facet-panel { display: none; }
  .facet-panel.mobile-open { display: flex; flex-wrap: wrap; max-height: 62vh; overflow: auto; }
  .facet-panel.mobile-open .facet-head { display: flex; width: 100%; }
  .facet-panel.mobile-open .facet-group { min-width: 140px; flex: 1 1 40%; }
  .m-filter-btn { display: inline-flex; }
}

/* ================================================================================
 * 渠道比价
 * ================================================================================ */
.cmp-table { min-width: 1040px; }
#cmpMode { width: 270px; max-width: 44vw; }
.cmp-table th, .cmp-table td { vertical-align: middle; }
.cmp-model { min-width: 230px; }
.cmp-model b { font-size: 13.5px; color: var(--ink); }
.cmp-sub { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.45; word-break: break-all; }
.cmp-toggle {
  border: 0; background: var(--surface-2); color: var(--green-800);
  width: 22px; height: 22px; border-radius: 6px; margin-right: 5px;
  font-size: 12px; line-height: 1; cursor: pointer; vertical-align: middle;
}
.cmp-toggle:hover { background: var(--green-50); }
.cmp-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px;
  padding: 0 6px; border-radius: 999px; background: var(--green-50); color: var(--green-900);
  font-size: 12px; font-weight: 700;
}
.cmp-cost { color: var(--ink); font-weight: 700; white-space: nowrap; }
.cmp-cost .dim, .cmp-table .dim { margin-left: 3px; font-weight: 400; }
.cmp-rate { color: var(--green-800); }
.cmp-source { font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.cmp-local { font-size: 11px; padding: 2px 6px; border-radius: 5px; }
.cmp-local.on { background: var(--green-50); color: var(--green-800); }
.cmp-local.off { background: #f3f4f3; color: var(--muted); }
.cmp-detail-row > td { padding: 0 !important; background: var(--surface-2); }
.cmp-detail { padding: 8px 12px 14px 38px; }
.cmp-channel-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-channel-table th {
  text-align: left; padding: 6px 8px; color: var(--muted);
  font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cmp-channel-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.cmp-channel-table tr:last-child td { border-bottom: 0; }
.cmp-channel-table .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--ink-2); }
@media (max-width: 900px) {
  .cmp-detail { padding-left: 12px; overflow-x: auto; }
  .cmp-channel-table { min-width: 720px; }
}

/* ---------- 视频模型统计 ---------- */
.vms-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 14px 12px; }
.vms-toolbar .input { width: 240px; }
.vms-toolbar select.input { width: 190px; }
.vms-table { min-width: 960px; }
.vms-table th, .vms-table td:not(.vms-model) { white-space: nowrap; }
.vms-table .vms-sub { white-space: normal; }
.vms-task { min-width: 150px; }
.vms-table .vms-task .vms-sub { white-space: nowrap; }
.vms-table th:last-child, .vms-table td:last-child { width: 64px; text-align: right; }
.vms-model { min-width: 220px; white-space: normal; }
.vms-model-name { font-weight: 600; color: var(--ink); }
.vms-sub { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.vms-rate { min-width: 112px; }
.vms-rate-line { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.vms-rate-line b { font-size: 12.5px; }
.vms-bar { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.vms-bar i { display: block; height: 100%; border-radius: 4px; background: var(--green-600); }
.vms-bar i.bad { background: #d9534f; }
.vms-ok { color: var(--green-800); font-weight: 600; }
.vms-bad { color: #b94a48; font-weight: 600; }
.vms-last { font-size: 12px; }
.vms-error { max-width: 280px; white-space: normal; word-break: break-word; font-size: 12px; color: #8a4b4b; }
.vms-detail-table { width: 100%; min-width: 0; table-layout: fixed; }
.vms-detail-table th:nth-child(1) { width: 140px; }
.vms-detail-table th:nth-child(2) { width: 82px; }
.vms-detail-table th:nth-child(3) { width: 62px; }
.vms-detail-table th:nth-child(4) { width: 70px; }
.vms-detail-table th:nth-child(5) { width: 44px; }
.vms-detail-table th:nth-child(-n+5), .vms-detail-table td:nth-child(-n+5) { white-space: nowrap; }
.vms-detail-table .vms-error { max-width: none; }
.vms-detail-table .empty { padding: 16px; }
#vmsBody.is-loading { opacity: .55; pointer-events: none; }
@media (max-width: 900px) {
  .vms-toolbar { padding: 0 10px 10px; }
  .vms-toolbar .input, .vms-toolbar select.input { width: 100%; }
  .vms-table { min-width: 1100px; }
  .vms-detail-table { min-width: 0; }
}

/* ---------- 问题反馈 ---------- */
.fb-content-cell { max-width: 360px; }
#fbStatusFilter { width: 170px; max-width: 44vw; }
.fb-content-line {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; line-height: 1.55;
}
.fb-admin-detail h3 { margin: 0; }
.fb-detail-text {
  white-space: pre-wrap; word-break: break-word; line-height: 1.75;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; max-height: 300px; overflow: auto;
}
.fb-img-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.fb-img { display: block; aspect-ratio: 1; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.fb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-admin-note { display: grid; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.fb-admin-note textarea { min-height: 76px; resize: vertical; }
@media (max-width: 640px) {
  .fb-img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 模型时长档快捷选择 */
.dur-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.dur-presets .btn { padding: 3px 8px; }
/* 模型列表：时长/规格列不折行 */
.dt2 .col-spec { min-width: 118px; white-space: nowrap; }