/* v2 监控页面专属样式 — 编辑型 MaaS 调（暖纸 + 暖墨 + 琥珀） */

:root {
  --paper:     #FAFAF6;
  --paper-2:   #F4F0E6;
  --paper-3:   #EDE7D6;
  --ink:       #1A1714;
  --ink-2:     #44403A;
  --ink-3:     #7A736A;
  --ink-4:     #A39A8C;
  --hairline:  #E6E0D2;
  --accent:    #B85C00;
  --accent-2:  #8E4500;
  --accent-soft:#F5E6D2;
  --ok:        #2EA34F;
  --bad:       #DD3A1F;
  --warn:      #B85C00;

  --font-display: 'Fraunces', 'Songti SC', 'STSong', Georgia, serif;
  --font-body:    'Geist', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono:    'Geist Mono', 'SF Mono', 'JetBrains Mono', Menlo, Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-feature-settings: "ss01", "ss02";
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Login overlay === */
#login-overlay { position: fixed; inset: 0; background: rgba(26,23,20,0.78); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; }
#login-overlay.hidden { display: none; }
#login-form { background: white; padding: 36px 40px;
  border: 1px solid var(--hairline); border-radius: 4px;
  width: 380px; max-width: 90vw;
  box-shadow: 0 24px 60px rgba(26,23,20,0.18); }
#login-form h2 { margin: 0 0 24px; font-family: var(--font-display);
  font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: -0.018em; }
#login-form label { display: block; margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
#login-form input, #login-form select { width: 100%; padding: 9px 0; margin-top: 6px;
  border: none; border-bottom: 1px solid var(--hairline); border-radius: 0;
  background: transparent; font-size: 14px; font-family: var(--font-body);
  color: var(--ink); outline: none;
  transition: border-color .18s, box-shadow .18s; }
#login-form input:hover, #login-form select:hover { border-bottom-color: var(--ink-3); }
#login-form input:focus, #login-form select:focus { border-bottom-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
#login-form button { width: 100%; padding: 13px; margin-top: 14px;
  background: var(--ink); color: #FAFAF6;
  border: 0; border-radius: 2px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; cursor: pointer;
  transition: background .18s; }
#login-form button:hover { background: var(--accent); }
.login-error { display: none; padding: 10px 0 10px 14px;
  border-left: 2px solid var(--bad); background: transparent;
  font-family: var(--font-display); font-style: italic;
  font-size: 13px; color: var(--bad); margin-bottom: 14px; }

/* === Topbar === */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px; height: 60px;
  background: white;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 100;
  box-shadow: none;
}
.brand {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.012em;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand::before {
  content: '◆';
  color: var(--accent);
  font-size: 11px;
}
.brand small {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
  font-weight: 400; margin-left: 0;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.brand em { font-style: italic; color: var(--accent); font-weight: 400; }
.nav-links { display: flex; gap: 4px; flex: 1; padding-left: 16px; }
.nav-links a {
  padding: 7px 14px; color: var(--ink-3);
  text-decoration: none; font-size: 13px;
  border-radius: 2px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper); }
.nav-links a.active {
  color: var(--ink);
  background: transparent;
  font-weight: 500;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
}
.user-area {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.user-info b { color: var(--ink); font-family: var(--font-body); font-weight: 500; letter-spacing: -0.005em; }

.btn-ghost {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color .18s, color .18s, background .18s;
}
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); background: var(--paper); }
.btn-primary {
  padding: 8px 16px;
  background: var(--ink); color: #FAFAF6;
  border: 0; border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: background .18s;
}
.btn-primary:hover { background: var(--accent); }

/* === Container === */
.container { padding: 26px 28px; max-width: 1700px; margin: 0 auto; }
.container h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.muted { color: var(--ink-3); }

/* === Filter bar === */
.filter-bar { display: flex; gap: 14px 18px; margin-bottom: 20px; flex-wrap: wrap; align-items: flex-start; }
.filter-bar select, .filter-bar input {
  padding: 7px 11px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: white;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color .18s;
}
.filter-bar select:hover, .filter-bar input:hover { border-color: var(--ink-3); }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent); outline: none; }
.filter-bar label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.filter-bar .taginput input { padding: 3px 4px; }

/* === Cards === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.card {
  background: white;
  padding: 22px 24px;
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: none;
  transition: border-top-color .2s ease;
}
.card:hover { border-top-color: var(--accent); }
.card-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
}
.card-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1;
  font-feature-settings: "ss01", "tnum";
}
.card-sub {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 8px;
}
.card.danger  { border-top-color: var(--bad); }
.card.danger .card-value { color: var(--bad); }
.card.warn    { border-top-color: var(--accent); }
.card.warn .card-value { color: var(--accent-2); }
.card.success { border-top-color: var(--ok); }

/* === Sections === */
.section {
  background: white;
  padding: 22px 26px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: none;
  margin-bottom: 22px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.chart { height: 320px; }

/* === Tables === */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 10px 14px;
  text-align: center;
  background: var(--paper-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  position: sticky; top: 0;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  text-align: center;
  color: var(--ink);
}
tbody tr:hover { background: var(--paper); cursor: pointer; }
tbody tr.expanded { background: var(--paper-2); }
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}
.bad        { color: var(--bad); font-weight: 500; }
.warn-text  { color: var(--accent-2); }
.good       { color: var(--ok); }

/* === Tags === */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tag-perfect    { background: rgba(46,163,79,0.10);   color: var(--ok);     border-color: rgba(46,163,79,0.22); }
.tag-available  { background: rgba(46,163,79,0.08);   color: var(--ok);     border-color: rgba(46,163,79,0.28); }
.tag-partial    { background: rgba(184,92,0,0.10);    color: var(--accent); border-color: rgba(184,92,0,0.22); }
.tag-unavailable{ background: rgba(221,58,31,0.10);   color: var(--bad);    border-color: rgba(221,58,31,0.22); }
.tag-untested   { background: var(--paper-2);         color: var(--ink-3);  border-color: var(--hairline); }
.tag-cold       { background: var(--paper-2);         color: var(--ink-4);  border-color: var(--hairline); }
.tag-prio       { background: rgba(184,92,0,0.08);    color: var(--accent-2);border-color: rgba(184,92,0,0.22); font-weight: 600; }
.tag-remark {
  background: var(--paper-2);
  color: var(--ink-2);
  border-color: var(--hairline);
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  max-width: 280px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.3;
}
.ch-remark-wrap { margin-top: 4px; line-height: 1; }
.ch-line1 { line-height: 1.4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ch-line-name { line-height: 1.4; color: var(--ink-2); word-break: break-all; margin-top: 2px; }
.ch-name-link { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; transition: color .12s, border-color .12s; }
.ch-name-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* v2-models 模型列：固定宽度 + 左对齐 + 超长换行 */
#models-table th:first-child,
#models-table td.td-model { text-align: left; }
#models-table td.td-model {
  width: 280px; min-width: 280px; max-width: 280px;
  word-break: break-all; line-height: 1.5;
}
#models-table .model-name { cursor: copy; user-select: none; transition: background .15s; padding: 0 2px; border-radius: 2px; }
#models-table .model-name:hover { background: rgba(184,92,0,0.08); }
#models-table .model-name.copied {
  background: rgba(46,163,79,0.18); color: var(--ok);
  animation: copy-flash .9s ease;
}
@keyframes copy-flash {
  0% { background: rgba(46,163,79,0.32); }
  100% { background: transparent; }
}

/* 「N 组 / M 通道  🔀 路由透视」同行 */
.dist-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch-id { color: var(--ink); font-family: var(--font-mono); font-weight: 500; font-feature-settings: "tnum"; }
.ch-line2 { margin-top: 4px; line-height: 1; }
.ch-remark-inline { vertical-align: middle; }

/* 分布列：分组 → 通道 对应关系 */
.active-by-group { font-size: 11px; color: var(--ok); line-height: 1.5; max-width: 260px; margin-top: 2px; font-family: var(--font-mono); }
.abg-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.abg-group { font-weight: 600; }
.abg-sep { color: var(--ink-4); }
.abg-channels { color: var(--ok); word-break: break-all; }
body.hide-channel-remark .ch-remark-wrap,
body.hide-channel-remark .ch-remark-inline { display: none; }

/* === 树形下拉（模型家族 + 子模型） === */
.td-wrap { position: relative; display: inline-block; vertical-align: middle; }
.td-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 1500;
  min-width: 360px; max-width: 540px; max-height: 400px; overflow-y: auto;
  background: white; border: 1px solid var(--hairline); border-radius: 4px;
  box-shadow: 0 12px 28px rgba(26,23,20,0.12); padding: 4px 0;
}
.td-dropdown.hidden { display: none; }
.td-fam {
  padding: 7px 12px; font-size: 13px; color: var(--ink);
  background: var(--paper-2); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 500;
}
.td-fam-other { color: var(--ink-3); }
.td-count {
  color: var(--ink-3); font-weight: 400; margin-left: 4px;
  font-family: var(--font-mono); font-size: 11px;
}
.td-fam-select {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; margin: -2px 0; border-radius: 2px;
  cursor: pointer;
}
.td-fam-select:hover { background: rgba(184,92,0,0.18); }
.td-fam-select-spacer { width: 14px; padding: 0; cursor: default; }
.td-fam-select-spacer:hover { background: transparent; }
.td-fam-label {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0; padding: 2px 4px; margin: -2px 0; border-radius: 2px;
  cursor: pointer; user-select: none;
}
.td-fam-label:hover { background: var(--accent-soft); }
.td-fam-arrow {
  display: inline-block; width: 12px; text-align: center;
  font-family: var(--font-mono); color: var(--ink-3);
}
.td-mod {
  padding: 5px 12px 5px 28px; font-size: 12px; color: var(--ink-2); cursor: pointer;
  border-bottom: 1px solid var(--hairline); word-break: break-all;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
}
.td-mod:hover { background: var(--paper); color: var(--ink); }
.td-cb { margin: 0; cursor: pointer; flex-shrink: 0; pointer-events: none; }
.td-mod .td-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: auto;
  flex-shrink: 0;
}
.td-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.td-foot a {
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.16em;
}
.td-foot a:hover { color: var(--accent); }
.td-empty {
  padding: 18px;
  text-align: center; color: var(--ink-3); font-size: 13px;
  font-family: var(--font-display); font-style: italic;
}

/* === 列设置面板 === */
#col-settings-panel.hidden, #qa-pick-overlay.hidden { display: none; }
#col-settings-panel, #qa-pick-overlay { position: fixed; inset: 0; z-index: 2000; }
#col-settings-panel .ssc-mask, #qa-pick-overlay .ssc-mask {
  position: absolute; inset: 0;
  background: rgba(26,23,20,0.55); backdrop-filter: blur(2px);
}
#col-settings-panel .ssc-card, #qa-pick-overlay .ssc-card {
  position: relative; margin: 80px auto 0; width: 540px; max-width: 92vw;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(26,23,20,0.20);
  overflow: hidden;
}
#col-settings-panel .ssc-head, #qa-pick-overlay .ssc-head {
  display: flex; align-items: center; padding: 16px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-2);
}
#col-settings-panel .ssc-head span, #qa-pick-overlay .ssc-head span { flex: 1; }
#col-settings-panel .ssc-close, #qa-pick-overlay .ssc-close {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  color: var(--ink-3); cursor: pointer; padding: 0 4px;
  transition: color .15s;
}
#col-settings-panel .ssc-close:hover, #qa-pick-overlay .ssc-close:hover { color: var(--ink); }
#col-settings-panel .ssc-body, #qa-pick-overlay .ssc-body { padding: 22px 24px; max-height: 60vh; overflow-y: auto; }
#col-settings-panel .ssc-hint {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px; color: var(--ink-3); margin-top: 14px;
}
#col-settings-panel .ssc-foot, #qa-pick-overlay .ssc-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  background: var(--paper-2);
  border-top: 1px solid var(--hairline);
}
#col-settings-panel .ssc-foot .btn-primary, #qa-pick-overlay .ssc-foot .btn-primary {
  padding: 9px 18px; background: var(--ink); color: #FAFAF6;
  border: 0; border-radius: 2px; cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: background .18s;
}
#col-settings-panel .ssc-foot .btn-primary:hover, #qa-pick-overlay .ssc-foot .btn-primary:hover { background: var(--accent); }

/* === 额度提醒：通知策略 chip 列 + 绑定 picker === */
.qa-policy-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qa-policy-cell .tag { white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.qa-policy-cell .btn-link { flex-shrink: 0; }
.qa-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--hairline);
  cursor: pointer; transition: background .12s;
}
.qa-pick-row:last-child { border-bottom: 0; }
.qa-pick-row:hover { background: var(--paper-2); }
.qa-pick-row input[type="checkbox"] { flex-shrink: 0; cursor: pointer; }
.qa-pick-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.qa-pick-name { font-size: 13px; color: var(--ink); }
.qa-pick-target {
  font-family: var(--font-mono); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-section { margin-bottom: 16px; }
.cs-section-title {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
  margin-bottom: 10px;
  font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
}
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.cs-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink); cursor: pointer;
  padding: 5px 7px; border-radius: 2px;
  transition: background .15s;
}
.cs-item:hover { background: var(--paper); }
.cs-item input { margin: 0; cursor: pointer; }

/* === 主表列显隐（按 th nth-child 控制） === */
#models-table.hide-col-dist        th:nth-child(2),  #models-table.hide-col-dist        tbody tr:not(.md-banner-unconfigured) td:nth-child(2)  { display: none; }
#models-table.hide-col-realtime    th:nth-child(3),  #models-table.hide-col-realtime    tbody tr:not(.md-banner-unconfigured) td:nth-child(3)  { display: none; }
#models-table.hide-col-reqcnt      th:nth-child(4),  #models-table.hide-col-reqcnt      tbody tr:not(.md-banner-unconfigured) td:nth-child(4)  { display: none; }
#models-table.hide-col-errcnt      th:nth-child(5),  #models-table.hide-col-errcnt      tbody tr:not(.md-banner-unconfigured) td:nth-child(5)  { display: none; }
#models-table.hide-col-errrate     th:nth-child(6),  #models-table.hide-col-errrate     tbody tr:not(.md-banner-unconfigured) td:nth-child(6)  { display: none; }
#models-table.hide-col-ttft        th:nth-child(7),  #models-table.hide-col-ttft        tbody tr:not(.md-banner-unconfigured) td:nth-child(7)  { display: none; }
#models-table.hide-col-throughput  th:nth-child(8),  #models-table.hide-col-throughput  tbody tr:not(.md-banner-unconfigured) td:nth-child(8)  { display: none; }
#models-table.hide-col-capacity    th:nth-child(9),  #models-table.hide-col-capacity    tbody tr:not(.md-banner-unconfigured) td:nth-child(9)  { display: none; }
#models-table.hide-col-cache       th:nth-child(10), #models-table.hide-col-cache       tbody tr:not(.md-banner-unconfigured) td:nth-child(10) { display: none; }
#models-table.hide-col-spend       th:nth-child(11), #models-table.hide-col-spend       tbody tr:not(.md-banner-unconfigured) td:nth-child(11) { display: none; }
#models-table.hide-col-orig        th:nth-child(12), #models-table.hide-col-orig        tbody tr:not(.md-banner-unconfigured) td:nth-child(12) { display: none; }
#models-table.hide-col-timeline    th:nth-child(13), #models-table.hide-col-timeline    tbody tr:not(.md-banner-unconfigured) td:nth-child(13) { display: none; }
#models-table.hide-col-action      th:nth-child(14), #models-table.hide-col-action      tbody tr:not(.md-banner-unconfigured) td:nth-child(14) { display: none; }

/* === v2-group-detail #gd-models-table 列显隐（22 列：模型 / 状态 / 请求 / 错误 / 整体率 / 5xx率 / 4xx / 5xx / 限流 / RPM / TPM / 配额 / TTFT平均 / TTFT P95 / P95 延迟 / 缓存 / 活跃通道 / TOP通道 / 集中度 / 消费 / 原价 / 操作） === */
#gd-models-table.hide-col-status     th:nth-child(2),  #gd-models-table.hide-col-status     tbody tr:not(.channel-row) td:nth-child(2)  { display: none; }
#gd-models-table.hide-col-reqcnt     th:nth-child(3),  #gd-models-table.hide-col-reqcnt     tbody tr:not(.channel-row) td:nth-child(3)  { display: none; }
#gd-models-table.hide-col-errcnt     th:nth-child(4),  #gd-models-table.hide-col-errcnt     tbody tr:not(.channel-row) td:nth-child(4)  { display: none; }
#gd-models-table.hide-col-errrate    th:nth-child(5),  #gd-models-table.hide-col-errrate    tbody tr:not(.channel-row) td:nth-child(5)  { display: none; }
#gd-models-table.hide-col-srvrate    th:nth-child(6),  #gd-models-table.hide-col-srvrate    tbody tr:not(.channel-row) td:nth-child(6)  { display: none; }
#gd-models-table.hide-col-err4xx     th:nth-child(7),  #gd-models-table.hide-col-err4xx     tbody tr:not(.channel-row) td:nth-child(7)  { display: none; }
#gd-models-table.hide-col-err5xx     th:nth-child(8),  #gd-models-table.hide-col-err5xx     tbody tr:not(.channel-row) td:nth-child(8)  { display: none; }
#gd-models-table.hide-col-throttle   th:nth-child(9),  #gd-models-table.hide-col-throttle   tbody tr:not(.channel-row) td:nth-child(9)  { display: none; }
#gd-models-table.hide-col-rpm        th:nth-child(10), #gd-models-table.hide-col-rpm        tbody tr:not(.channel-row) td:nth-child(10) { display: none; }
#gd-models-table.hide-col-tpm        th:nth-child(11), #gd-models-table.hide-col-tpm        tbody tr:not(.channel-row) td:nth-child(11) { display: none; }
#gd-models-table.hide-col-quota      th:nth-child(12), #gd-models-table.hide-col-quota      tbody tr:not(.channel-row) td:nth-child(12) { display: none; }
#gd-models-table.hide-col-ttft-avg   th:nth-child(13), #gd-models-table.hide-col-ttft-avg   tbody tr:not(.channel-row) td:nth-child(13) { display: none; }
#gd-models-table.hide-col-ttft-p95   th:nth-child(14), #gd-models-table.hide-col-ttft-p95   tbody tr:not(.channel-row) td:nth-child(14) { display: none; }
#gd-models-table.hide-col-p95-lat    th:nth-child(15), #gd-models-table.hide-col-p95-lat    tbody tr:not(.channel-row) td:nth-child(15) { display: none; }
#gd-models-table.hide-col-cache      th:nth-child(16), #gd-models-table.hide-col-cache      tbody tr:not(.channel-row) td:nth-child(16) { display: none; }
#gd-models-table.hide-col-active-ch  th:nth-child(17), #gd-models-table.hide-col-active-ch  tbody tr:not(.channel-row) td:nth-child(17) { display: none; }
#gd-models-table.hide-col-top-ch     th:nth-child(18), #gd-models-table.hide-col-top-ch     tbody tr:not(.channel-row) td:nth-child(18) { display: none; }
#gd-models-table.hide-col-conc       th:nth-child(19), #gd-models-table.hide-col-conc       tbody tr:not(.channel-row) td:nth-child(19) { display: none; }
#gd-models-table.hide-col-spend      th:nth-child(20), #gd-models-table.hide-col-spend      tbody tr:not(.channel-row) td:nth-child(20) { display: none; }
#gd-models-table.hide-col-orig       th:nth-child(21), #gd-models-table.hide-col-orig       tbody tr:not(.channel-row) td:nth-child(21) { display: none; }
#gd-models-table.hide-col-action     th:nth-child(22), #gd-models-table.hide-col-action     tbody tr:not(.channel-row) td:nth-child(22) { display: none; }

/* === v2-overview #groups-table 列显隐（17 列：分组 / 配置模型 / 请求 / 错误 / 整体率 / 5xx率 / 4xx / 5xx / 限流 / RPM / TPM / TTFT平均 / TTFT P95 / P95延迟 / 缓存 / 活跃模型 / 活跃通道 / 消费） === */
#groups-table.hide-col-models     th:nth-child(2),  #groups-table.hide-col-models     tbody td:nth-child(2)  { display: none; }
#groups-table.hide-col-reqcnt     th:nth-child(3),  #groups-table.hide-col-reqcnt     tbody td:nth-child(3)  { display: none; }
#groups-table.hide-col-errcnt     th:nth-child(4),  #groups-table.hide-col-errcnt     tbody td:nth-child(4)  { display: none; }
#groups-table.hide-col-errrate    th:nth-child(5),  #groups-table.hide-col-errrate    tbody td:nth-child(5)  { display: none; }
#groups-table.hide-col-srvrate    th:nth-child(6),  #groups-table.hide-col-srvrate    tbody td:nth-child(6)  { display: none; }
#groups-table.hide-col-err4xx     th:nth-child(7),  #groups-table.hide-col-err4xx     tbody td:nth-child(7)  { display: none; }
#groups-table.hide-col-err5xx     th:nth-child(8),  #groups-table.hide-col-err5xx     tbody td:nth-child(8)  { display: none; }
#groups-table.hide-col-throttle   th:nth-child(9),  #groups-table.hide-col-throttle   tbody td:nth-child(9)  { display: none; }
#groups-table.hide-col-rpm        th:nth-child(10), #groups-table.hide-col-rpm        tbody td:nth-child(10) { display: none; }
#groups-table.hide-col-tpm        th:nth-child(11), #groups-table.hide-col-tpm        tbody td:nth-child(11) { display: none; }
#groups-table.hide-col-ttft-avg   th:nth-child(12), #groups-table.hide-col-ttft-avg   tbody td:nth-child(12) { display: none; }
#groups-table.hide-col-ttft-p95   th:nth-child(13), #groups-table.hide-col-ttft-p95   tbody td:nth-child(13) { display: none; }
#groups-table.hide-col-p95-lat    th:nth-child(14), #groups-table.hide-col-p95-lat    tbody td:nth-child(14) { display: none; }
#groups-table.hide-col-cache      th:nth-child(15), #groups-table.hide-col-cache      tbody td:nth-child(15) { display: none; }
#groups-table.hide-col-active-md  th:nth-child(16), #groups-table.hide-col-active-md  tbody td:nth-child(16) { display: none; }
#groups-table.hide-col-active-ch  th:nth-child(17), #groups-table.hide-col-active-ch  tbody td:nth-child(17) { display: none; }
#groups-table.hide-col-spend      th:nth-child(18), #groups-table.hide-col-spend      tbody td:nth-child(18) { display: none; }

/* === v2-alerts #alerts-table 列显隐（12 列：触发时间 / 级别 / 状态 / 对象层级 / 分组 / 模型 / 通道 / 通道备注 / 原因 / 当前值 / 阈值 / 恢复时间） === */
#alerts-table.hide-col-level    th:nth-child(2),  #alerts-table.hide-col-level    tbody td:nth-child(2)  { display: none; }
#alerts-table.hide-col-status   th:nth-child(3),  #alerts-table.hide-col-status   tbody td:nth-child(3)  { display: none; }
#alerts-table.hide-col-scope    th:nth-child(4),  #alerts-table.hide-col-scope    tbody td:nth-child(4)  { display: none; }
#alerts-table.hide-col-group    th:nth-child(5),  #alerts-table.hide-col-group    tbody td:nth-child(5)  { display: none; }
#alerts-table.hide-col-model    th:nth-child(6),  #alerts-table.hide-col-model    tbody td:nth-child(6)  { display: none; }
#alerts-table.hide-col-channel  th:nth-child(7),  #alerts-table.hide-col-channel  tbody td:nth-child(7)  { display: none; }
#alerts-table.hide-col-remark   th:nth-child(8),  #alerts-table.hide-col-remark   tbody td:nth-child(8)  { display: none; }
#alerts-table.hide-col-reason   th:nth-child(9),  #alerts-table.hide-col-reason   tbody td:nth-child(9)  { display: none; }
#alerts-table.hide-col-current  th:nth-child(10), #alerts-table.hide-col-current  tbody td:nth-child(10) { display: none; }
#alerts-table.hide-col-threshold th:nth-child(11),#alerts-table.hide-col-threshold tbody td:nth-child(11) { display: none; }
#alerts-table.hide-col-recovered th:nth-child(12),#alerts-table.hide-col-recovered tbody td:nth-child(12) { display: none; }

/* 通道备注 — 无权限时整列隐藏；📝 通道备注按钮 toggle 也整列隐藏（与 v2-models 行为一致） */
body.no-remark-perm        #alerts-table th.col-remark,
body.no-remark-perm        #alerts-table td.col-remark,
body.hide-channel-remark   #alerts-table th.col-remark,
body.hide-channel-remark   #alerts-table td.col-remark { display: none; }

/* 告警 P1/P2/P3 + open/recovered 状态 */
.tag-p1 { background: rgba(221,58,31,0.10);  color: var(--bad);    border-color: rgba(221,58,31,0.30); font-weight: 600; }
.tag-p2 { background: rgba(184,92,0,0.10);   color: var(--accent); border-color: rgba(184,92,0,0.30); }
.tag-p3 { background: rgba(68,64,58,0.06);   color: var(--ink-2);  border-color: var(--hairline); }
.tag-recovered { background: rgba(46,163,79,0.10); color: var(--ok); border-color: rgba(46,163,79,0.30); }
.tag-open      { background: rgba(221,58,31,0.10); color: var(--bad); border-color: rgba(221,58,31,0.30); }

/* === Channel detail (expanded sub-row) === */
.channel-row {
  padding: 14px 22px;
  background: var(--paper);
  border-top: 1px dashed var(--hairline);
}
.channel-row table { font-size: 12px; }
.channel-row thead th { background: transparent; }

.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--hairline);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === 分组总览：置顶 / 配置模型列 / 无调用行 === */
.v2-pin-btn {
  background: transparent; border: 0;
  font-size: 13px; cursor: pointer;
  margin-right: 6px; padding: 1px 4px;
  border-radius: 2px;
  opacity: 0.4; transition: opacity .15s, background .15s;
}
.v2-pin-btn:hover { opacity: 1; background: rgba(26,23,20,0.06); }
.v2-pin-btn.on { opacity: 1; }
.v2-pin-btn.on:hover { background: rgba(184,92,0,0.14); }

tbody tr.pinned-row {
  background: linear-gradient(to right, var(--accent-soft) 0%, transparent 70%);
  border-left: 2px solid var(--accent);
}
tbody tr.pinned-row:hover { background: linear-gradient(to right, #F0D8B0 0%, var(--paper) 70%); }

tbody tr.inactive-row { color: var(--ink-3); }
tbody tr.inactive-row td { background: var(--paper); }

/* === v2-models 模型主视图 === */
.btn-mini { padding: 3px 10px; font-size: 10px; border-radius: 2px; cursor: pointer; }

#models-table .model-row { cursor: pointer; }
#models-table .model-row:hover { background: var(--paper); }

/* 展开行：分组横幅 + 通道行 */
#models-table .md-row td { background: var(--paper); border-bottom: 1px solid var(--hairline); }
#models-table .md-row.md-banner td {
  background: var(--paper-2);
  padding: 8px 12px; font-size: 12.5px; color: var(--ink);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  font-family: var(--font-body);
  vertical-align: middle;
}
#models-table .md-row.md-banner td:first-child { padding-left: 24px; font-weight: 500; }
#models-table .md-row.md-banner td.num { font-family: var(--font-mono); }
#models-table .md-banner-icon { margin-right: 6px; color: var(--accent); }
#models-table .md-banner .btn-mini { margin-top: 0; }
#models-table .md-row.md-banner:hover td { background: var(--paper-3); }
#models-table .md-banner-caret {
  display: inline-block; width: 14px; margin-right: 4px;
  color: var(--ink-3); font-size: 11px; user-select: none;
  transition: color .15s;
}
#models-table .md-row.md-banner:hover .md-banner-caret { color: var(--accent); }
#models-table .md-channel-row.md-channel-hidden { display: none; }
#models-table .md-row.md-banner-unconfigured td {
  background: rgba(220, 138, 0, 0.08);
  border-left: 3px solid #d97706;
}
#models-table .md-banner-unconfigured .md-banner-icon { color: #d97706; }
#models-table .md-channel-row td { padding: 8px 12px; font-size: 12.5px; }
#models-table .md-channel-row .ch-arrow {
  color: var(--ink-4); font-family: var(--font-mono); margin-right: 6px;
}
#models-table .md-channel-row .ch-metrics {
  font-family: var(--font-mono);
  font-size: 11.5px;
}
#models-table .md-loading td { padding: 14px 24px; font-family: var(--font-display); font-style: italic; color: var(--ink-3); }

/* 5min 调用 / 5min 错误 两列居中 */
#models-table th:nth-child(5),
#models-table th:nth-child(6),
#models-table td:nth-child(5),
#models-table td:nth-child(6) { text-align: center; }

/* === 跨页跳转链接 === */
.md-group-link, .model-link {
  color: var(--accent-2);
  text-decoration: none; cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: color .15s, border-color .15s;
}
.md-group-link:hover, .model-link:hover {
  text-decoration: none;
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.model-link b { color: inherit; font-family: var(--font-body); }

/* === 多行紧凑单元格 === */
.cell-multi-line { font-size: 12px; line-height: 1.4; }
.cell-multi-line > div { white-space: nowrap; }
.cell-rate {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 11.5px; line-height: 1.4;
  font-family: var(--font-mono);
}
.cell-rate > span { white-space: nowrap; }

/* === 顶部卡片可点击 + 当前筛选 badge === */
.card-clickable { cursor: pointer; transition: border-top-color .18s, transform .15s; }
.card-clickable:hover { transform: translateY(-1px); }
.card-clickable:active { transform: translateY(0); }
.card.card-active {
  border-top-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 1px 3px rgba(184,92,0,0.10);
}

.card-filter-active {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; align-self: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(184,92,0,0.22);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
}
.card-filter-active b { color: var(--ink); font-family: var(--font-body); font-weight: 500; letter-spacing: -0.005em; text-transform: none; }
.card-filter-active button {
  background: transparent; border: 0; cursor: pointer;
  color: var(--accent); font-size: 14px; line-height: 1;
  padding: 0 4px; border-radius: 2px;
}
.card-filter-active button:hover { background: rgba(184,92,0,0.20); color: var(--ink); }
.card-filter-active.hidden { display: none; }

/* heatmap 格子可点击 → 提示穿透 */
.v2-heatmap .tl-seg { cursor: pointer; }
.v2-heatmap .tl-seg:hover { stroke: var(--accent-2); stroke-width: 1; }

/* === 30s 详细趋势弹窗 === */
#detail-chart-modal.hidden { display: none; }
#detail-chart-modal { position: fixed; inset: 0; z-index: 2100; }
#detail-chart-modal .dc-mask {
  position: absolute; inset: 0;
  background: rgba(26,23,20,0.55); backdrop-filter: blur(2px);
}
#detail-chart-modal .dc-card {
  position: relative; margin: 50px auto 0;
  width: min(1100px, 95vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(26,23,20,0.20);
  overflow: hidden;
}
.dc-head {
  display: flex; align-items: flex-start; padding: 16px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hairline);
}
.dc-title-wrap { flex: 1; }
.dc-title {
  font-family: var(--font-display);
  font-size: 17px; color: var(--ink);
  font-weight: 500; line-height: 1.4;
  letter-spacing: -0.012em;
}
.dc-meta {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: 0.10em;
}
.dc-close {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  color: var(--ink-3); cursor: pointer; padding: 0 4px; flex-shrink: 0;
  transition: color .15s;
}
.dc-close:hover { color: var(--ink); }
.dc-body { padding: 14px 22px 20px; overflow-y: auto; }
.dc-chart { width: 100%; height: 360px; min-height: 360px; }
.dc-loading, .dc-error {
  display: flex; align-items: center; justify-content: center;
  height: 360px; color: var(--ink-3);
  font-family: var(--font-display); font-style: italic;
}
.dc-error { color: var(--bad); }
.dc-alerts { margin-top: 16px; }
.dc-alerts-title {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
  font-weight: 500; margin-bottom: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.dc-alerts-empty { font-size: 12px; padding: 8px 0; font-family: var(--font-display); font-style: italic; color: var(--ink-3); }
.dc-alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 12px;
  border-bottom: 1px solid var(--hairline);
}
.dc-alert-item:last-child { border-bottom: 0; }

/* 时间线 SVG */
.v2-timeline { vertical-align: middle; border-radius: 2px; }
.v2-timeline .tl-seg { cursor: help; }
.v2-timeline .tl-seg.tl-open { animation: tl-pulse 1.5s ease-in-out infinite; }
@keyframes tl-pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.5; } }

/* === 标签式多选输入框（datalist 自动补全 + chip） === */
.taginput {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--hairline); border-radius: 2px; background: white;
  vertical-align: middle;
  max-width: 420px;
  max-height: 64px;
  overflow-y: auto;
  transition: border-color .18s, box-shadow .18s;
}
.taginput input {
  border: 0; outline: 0; padding: 3px 4px; font-size: 13px;
  flex: 1; min-width: 80px; background: transparent;
  font-family: var(--font-body); color: var(--ink);
}
.taginput input::placeholder { color: var(--ink-3); }
.taginput .tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 8px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.taginput .tag-chip button {
  border: 0; background: transparent; cursor: pointer;
  color: var(--accent); font-size: 14px; line-height: 1; padding: 0 4px;
  border-radius: 2px;
}
.taginput .tag-chip button:hover { background: rgba(184,92,0,0.20); color: var(--ink); }
.taginput:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(184,92,0,0.10);
}

/* 24h 不可用情况：摘要文字 + 小时热力图 */
.ua-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ua-summary {
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.ua-clean     { color: var(--ok); }
.ua-recovered { color: var(--accent-2); }
.ua-open      { color: var(--bad); font-weight: 500; }
.ua-cold      { color: var(--ink-4); }
.ua-heatmap { display: block; }
.v2-heatmap { vertical-align: middle; border-radius: 2px; }
.v2-heatmap .tl-seg { cursor: help; }
.v2-heatmap .tl-seg.tl-open { animation: tl-pulse 1.5s ease-in-out infinite; }

/* === label-editor 标注弹窗 === */
#label-editor-overlay.hidden { display: none; }
/* z-index 高于 channels.html 全屏详情看板（100001），确保从详情弹窗内点 ✎ 标注时能浮在最上层 */
#label-editor-overlay { position: fixed; inset: 0; z-index: 200000; }
#label-editor-overlay .le-mask {
  position: absolute; inset: 0;
  background: rgba(26,23,20,0.55); backdrop-filter: blur(2px);
}
#label-editor-overlay .le-card {
  position: relative; margin: 80px auto 0; width: 500px; max-width: 92vw;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(26,23,20,0.20);
  overflow: hidden;
}
.le-head {
  display: flex; align-items: center;
  padding: 16px 22px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hairline);
}
.le-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 17px; color: var(--ink);
  font-weight: 500; letter-spacing: -0.012em;
}
.le-close {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  color: var(--ink-3); cursor: pointer; padding: 0 4px;
  transition: color .15s;
}
.le-close:hover { color: var(--ink); }
.le-body { padding: 18px 22px; }
.le-meta { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.le-meta-source {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3); margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.le-section-title {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3); font-weight: 500;
  margin: 12px 0 8px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.le-radios { display: flex; flex-wrap: wrap; gap: 8px; }
/* 标注前的分组选择器（channels.html 多分组场景） */
.ch-group-picker { display: flex; flex-direction: column; gap: 8px; }
.ch-group-picker .ch-group-pick-btn { text-align: left; padding: 10px 14px; font-family: var(--font-body); }
.ch-group-picker .ch-group-pick-btn:hover { background: var(--paper-2); }
.le-radio {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-size: 12px; color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.le-radio:hover { background: var(--paper); border-color: var(--ink-3); }
.le-radio:has(input:checked) { background: var(--ink); color: #FAFAF6; border-color: var(--ink); }
.le-radio input { margin: 0; }
.le-note {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-size: 13px; box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--ink);
}
.le-note:focus { outline: none; border-color: var(--accent); }
.le-hint {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px; color: var(--ink-3); margin-top: 10px;
}
.le-error {
  color: var(--bad); font-size: 12px;
  margin-top: 10px; padding: 8px 12px;
  background: transparent; border-left: 2px solid var(--bad);
  font-family: var(--font-display); font-style: italic;
}
.le-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  background: var(--paper-2);
  border-top: 1px solid var(--hairline);
}
.le-cap-row { display: flex; gap: 10px; }
.le-cap-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.le-cap-label {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3); font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.le-cap-field input {
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-size: 13px; box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--ink); width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
.le-cap-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(184,92,0,0.10); }

/* ============================================================
   渠道可用性监控（channels.html）
   - 全屏详情看板：固定层、KPI 卡片、ECharts 容器、错误条形图
   - 错误规则 chip 与 user script 风格保持一致（绿/红/灰三色）
   ============================================================ */

/* filter bar 内的失败计入三档 toggle */
.af-err-toggle {
  display: inline-flex; gap: 10px; align-items: center;
  padding: 4px 8px; border: 1px solid var(--hairline); border-radius: 2px;
}
.af-err-toggle label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; cursor: pointer; margin: 0;
}

/* 列表 sparkline 占位 */
.af-spark { display: inline-block; vertical-align: middle; }

/* 全屏 overlay */
.af-chart-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(20,20,18,0.55);
  display: flex; align-items: center; justify-content: center;
}
.af-db-fullscreen {
  position: fixed; inset: 24px; z-index: 100001;
  background: var(--paper, #FAFAF6);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: auto; padding: 24px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.af-chart-close {
  position: absolute; top: 16px; right: 20px;
  background: white; border: 1px solid var(--hairline); cursor: pointer;
  padding: 6px 12px; border-radius: 2px; font-size: 12px;
  font-family: var(--font-mono);
}
.af-chart-close:hover { border-color: var(--accent); color: var(--accent); }
.af-db-head { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.af-db-head b { font-size: 16px; }
.af-db-head small { margin-left: 12px; font-family: var(--font-mono); font-size: 11px; }
.af-db-loading { padding: 60px; text-align: center; color: var(--ink-3); }

/* KPI 卡片 */
.af-db-kpis {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.af-db-kpi {
  background: white; padding: 12px; border: 1px solid var(--hairline);
  border-top: 3px solid var(--accent); border-radius: 4px;
  text-align: center;
}
.af-db-kpi-val {
  font-family: var(--font-display, var(--font-body));
  font-size: 22px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.af-db-kpi-label {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* 各 section 块（章节标题 + 内容） */
.af-db-section {
  margin: 20px 0; background: white;
  border: 1px solid var(--hairline); border-radius: 4px;
  padding: 14px 16px;
}
.af-db-section-title {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 10px;
}
.af-db-section-title small { text-transform: none; letter-spacing: 0; margin-left: 8px; }
.af-db-chart { width: 100%; height: 240px; }

/* 错误分布条形图 */
.af-db-bubble {
  position: relative; padding: 6px 10px; margin-bottom: 4px;
  background: rgba(239,68,68,0.04);
  border-left: 3px solid #ef4444;
  border-radius: 2px;
  overflow: hidden;
}
.af-db-bubble-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(239,68,68,0.08);
  z-index: 0;
}
.af-db-bubble-text {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.af-db-bubble-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.af-db-bubble-count {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.af-tag-btn {
  font-size: 10px; padding: 1px 6px;
  background: var(--accent-soft, #FCEBD2); color: var(--accent, #B85C00);
  border: 1px solid transparent;
}
.af-tag-btn:hover { border-color: var(--accent); }

/* chip 列表（详情看板内规则筛选） */
.af-chip-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.af-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: #f5f5f0; border: 1px solid var(--hairline);
  border-radius: 12px; font-size: 11px;
  cursor: pointer; user-select: none;
  font-family: var(--font-mono);
  transition: all .12s;
}
.af-chip:hover { border-color: var(--accent); }
.af-chip.sel { background: white; border-color: var(--ink-2, #555); color: var(--ink); }
.af-chip:not(.sel) { opacity: 0.5; }
.af-chip-error.sel { border-color: #ef4444; background: rgba(239,68,68,0.06); }
.af-chip-normal.sel { border-color: #22c55e; background: rgba(34,197,94,0.06); }
.af-chip-count {
  background: rgba(0,0,0,0.06); padding: 0 5px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.af-chip-tag {
  font-size: 9px; padding: 0 4px; border-radius: 2px;
  background: #ddd; color: #555; font-weight: 600;
}
.af-chip-tag.error { background: #fecaca; color: #991b1b; }
.af-chip-tag.normal { background: #bbf7d0; color: #166534; }

/* JSON 折叠区 */
.af-db-json {
  background: #1e1e1e; color: #d4d4d4;
  padding: 12px; border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.5;
  max-height: 300px; overflow: auto;
  white-space: pre;
}

/* 模型分布表 */
.af-db-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.af-db-table th {
  text-align: center; padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
}
.af-db-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
.af-db-table tr:hover td { background: var(--paper-2, #f5f5f0); }
.af-db-table .num { text-align: right; }
.af-db-table tr.af-row-no-traffic td { color: var(--ink-3, #999); background: var(--paper-2, #fafaf6); }
.af-db-table tr.af-row-no-traffic td .tag { opacity: 0.85; }
.af-db-table tr.af-row-no-traffic:hover td { background: var(--paper-3, #f0f0e8); }

@media (max-width: 1280px) {
  .af-db-kpis { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .af-db-kpis { grid-template-columns: repeat(2, 1fr); }
  .af-db-fullscreen { inset: 8px; padding: 16px; }
}

/* 详情看板：粒度切换按钮 */
.af-granularity-toggle {
  display: inline-flex; margin-left: 16px; gap: 0;
  border: 1px solid var(--hairline); border-radius: 2px; overflow: hidden;
}
.af-granularity-toggle button {
  padding: 4px 10px; font-size: 11px; font-family: var(--font-mono);
  background: white; border: 0; cursor: pointer;
  color: var(--ink-3); transition: all .12s;
}
.af-granularity-toggle button + button { border-left: 1px solid var(--hairline); }
.af-granularity-toggle button:hover { color: var(--accent); }
.af-granularity-toggle button.sel {
  background: var(--accent-soft, #FCEBD2);
  color: var(--accent, #B85C00);
  font-weight: 600;
}

/* 渠道列表：分组列多分组 chip（newapi channels.group 逗号分隔）
   - chip 间允许换行；单个分组名整体保持不换行（word-break: keep-all） */
.group-chip-wrap {
  display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px;
}
.group-chip {
  display: inline-block; padding: 2px 8px;
  background: var(--paper-2, #f5f5f0);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  white-space: nowrap;
  word-break: keep-all;
  text-decoration: none;
  cursor: pointer;
  transition: filter .12s, transform .06s;
}
a.group-chip:hover  { filter: brightness(0.96); text-decoration: none; }
a.group-chip:active { transform: translateY(0.5px); }

/* 渠道列表分组 chip 着色：按当前三档 toggle 算的 rate 决定
   - idle: 时间窗内无调用（默认灰）
   - ok:   rate >= 99% 正常
   - warn: rate >= 80% 异常
   - bad:  rate < 80%  不可用 */
.group-chip-idle { background: #f5f5f0; color: #9ca3af; border-color: #e5e7eb; }
.group-chip-ok   { background: rgba(46, 163, 79, 0.10);  color: #15803d; border-color: rgba(46, 163, 79, 0.35); }
.group-chip-warn { background: rgba(234, 179, 8, 0.12);  color: #a16207; border-color: rgba(234, 179, 8, 0.40); }
.group-chip-bad  { background: rgba(221, 58, 31, 0.10);  color: #b91c1c; border-color: rgba(221, 58, 31, 0.40); }

/* 渠道列表数值列：上方数值 + 下方 sparkline 双行布局 */
.num-cell {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  min-width: 90px;
}
.num-cell-val {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.num-cell-spark {
  display: inline-block; width: 90px; height: 22px;
}

/* 渠道列表错误/未分类/忽略数字 — 可点击查看明细 */
.num-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.num-link:hover { filter: brightness(0.85); }

/* 错误明细 + 标注弹窗 */
.af-err-modal-box {
  position: fixed; inset: 60px;
  z-index: 100001;
  background: var(--paper, #FAFAF6);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: auto; padding: 24px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.af-err-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; margin-top: 12px;
}
.af-err-table th {
  text-align: center; padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper-2, #f5f5f0);
}
.af-err-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.af-err-table tr:hover td { background: var(--paper-2, #f5f5f0); }
.af-err-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.af-err-table .error-content {
  max-width: 480px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-2);
}
.af-err-table button { margin-right: 4px; }
.af-err-table .tag-note-input {
  width: 100%; box-sizing: border-box;
  padding: 4px 8px; margin-bottom: 6px;
  border: 1px solid var(--hairline, #d8d4cc); border-radius: 2px;
  font-size: 12px; font-family: var(--font-body, sans-serif);
  color: var(--ink, #1a1714); background: transparent;
  outline: none;
  transition: border-color .18s;
}
.af-err-table .tag-note-input:focus { border-color: var(--accent, #B85C00); }
.af-err-table .tag-note-input.invalid { border-color: #ef4444; }
.af-err-table .tag-action-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.af-err-table td:nth-child(5) { min-width: 200px; }

/* 错误明细弹窗：未标注的行红色渐变（仅第一列「次数」单元格内渐变 + 左红边，不再整行染色） */
.af-err-table tr.af-err-row-untagged td:first-child {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) 0%, rgba(239, 68, 68, 0.06) 75%, transparent 100%);
  border-left: 3px solid #ef4444;
}
.af-err-table tr.af-err-row-untagged:hover td:first-child {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.30) 0%, rgba(239, 68, 68, 0.10) 75%, transparent 100%);
}

/* 错误/未分类/忽略 三行紧凑堆叠（合并到一列展示） */
.err-stack { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.err-line  { display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; font-size: 12px; }
.err-line-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }

/* 渠道状态 tag：启用为绿色（与 .group-chip-ok 同色系，避免和 .tag-available 偏灰冲突） */
.tag-on { background: rgba(46,163,79,0.10); color: #15803d; border-color: rgba(46,163,79,0.30); }

/* === Cards 紧凑变体：信息密度高一些（v2-group-detail / 详情页用） ===
   单行布局：grid-auto-flow: column 使所有卡平分剩余宽度，永远在一行 */
.cards.cards-compact {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;     /* 极窄屏幕兜底，可横向滚动而不挤变形 */
}
.cards.cards-compact .card {
  padding: 8px 10px;
  border-top-width: 2px;
  border-radius: 3px;
  min-width: 0;         /* 允许缩到比内容更窄，靠 ellipsis 防溢出 */
}
.cards.cards-compact .card-label {
  font-size: 9px;
  margin-bottom: 5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards.cards-compact .card-value {
  font-size: 16px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards.cards-compact .card-sub {
  font-size: 10px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 模型可用性列表（按家族聚合） === */
.avail-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 2px 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 12px;
}
.avail-head .avail-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.01em;
}
.avail-head .avail-stat {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.avail-head .avail-actions { margin-left: auto; display: flex; gap: 8px; }
.avail-fam {
  border-left: 2px solid var(--hairline);
  padding: 6px 0 6px 10px;
  margin-bottom: 8px;
}
.avail-fam.open { border-left-color: var(--accent); }
.avail-fam-head {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  padding: 4px 4px 4px 0;
  user-select: none;
}
.avail-fam-head .fam-toggle {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  width: 12px; display: inline-block; transition: transform .15s;
}
.avail-fam.open .avail-fam-head .fam-toggle { transform: rotate(0deg); }
.avail-fam:not(.open) .avail-fam-head .fam-toggle { transform: rotate(-90deg); }
.avail-fam-head .fam-name {
  font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--ink);
}
.avail-fam-head .fam-count {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.06em;
}
.avail-fam-head .fam-actions { margin-left: auto; }
.avail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 16px;
  padding: 6px 0 4px;
}
.avail-fam:not(.open) .avail-list { display: none; }
.avail-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 3px;
  font-size: 12px; line-height: 1.4;
}
.avail-row:hover { background: var(--paper); }
.avail-row .avail-tag { flex-shrink: 0; }
.avail-row .avail-name {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.avail-row .avail-name.dim { color: var(--ink-3); }
.avail-row .avail-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  flex-shrink: 0; letter-spacing: 0.04em;
}
.avail-row .avail-copy {
  flex-shrink: 0; opacity: 0; transition: opacity .12s;
  background: transparent; border: 1px solid var(--hairline);
  border-radius: 2px; padding: 1px 5px; cursor: pointer;
  font-family: var(--font-mono); font-size: 9px; color: var(--ink-3);
  letter-spacing: 0.10em; text-transform: uppercase;
}
.avail-row:hover .avail-copy { opacity: 1; }
.avail-row .avail-copy:hover { color: var(--accent); border-color: rgba(184,92,0,0.30); }
.btn-mini-copy {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.10em; text-transform: uppercase;
  transition: border-color .12s, color .12s;
}
.btn-mini-copy:hover { color: var(--accent); border-color: rgba(184,92,0,0.30); }
.btn-mini-copy.copied { color: var(--ok); border-color: rgba(46,163,79,0.30); }
.btn-mini-copy[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* === 模型路由透视 Modal === */
.model-routing-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px; padding: 0 4px; height: 18px;
  border: 1px solid var(--hairline); border-radius: 2px;
  background: transparent; cursor: pointer;
  font-size: 11px; line-height: 1; color: var(--ink-3);
  transition: border-color .12s, color .12s, background .12s;
  vertical-align: middle;
}
.model-routing-btn:hover { color: var(--accent); border-color: rgba(184,92,0,0.30); background: var(--paper-2); }
.model-routing-btn.rm-row-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 10px;
  font-family: var(--font-body); font-size: 12px; color: var(--ink-2);
  letter-spacing: normal; text-transform: none;
}
.model-routing-btn.rm-row-btn:hover { color: var(--accent); }

.routing-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: stretch; justify-content: stretch; }
.routing-modal.hidden { display: none; }
.routing-modal .rm-mask { position: absolute; inset: 0; background: rgba(26,23,20,0.62); backdrop-filter: blur(3px); }
.routing-modal .rm-card {
  position: relative; margin: 32px auto; width: min(1400px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: 4px; box-shadow: 0 24px 80px rgba(26,23,20,0.34);
}
.rm-head {
  display: flex; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
}
.rm-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink);
}
.rm-actions { margin-left: auto; display: flex; gap: 8px; }
.rm-tip {
  padding: 10px 20px 0; font-size: 12px; color: var(--ink-3);
}
.rm-toolbar {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px 14px; border-bottom: 1px solid var(--hairline);
}
.rm-fld { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; }
.rm-fld > span { font-family: var(--font-mono); }
.rm-fld input[type="text"], .rm-fld input:not([type]), .rm-fld select {
  padding: 7px 10px; border: 1px solid var(--hairline); border-radius: 2px;
  background: white; color: var(--ink);
  font-family: var(--font-body); font-size: 13px; min-width: 220px;
  letter-spacing: normal; text-transform: none;
}
.rm-fld input:focus, .rm-fld select:focus { outline: none; border-color: var(--accent); }
.rm-fld-grow input { min-width: 320px; }

/* 模型 combobox（输入 + 模糊匹配下拉） */
.rm-combo { position: relative; display: flex; align-items: center; }
.rm-combo input {
  flex: 1; padding-right: 28px !important;
}
.rm-combo-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-4); font-size: 16px; line-height: 1;
  border-radius: 50%;
}
.rm-combo-clear:hover { color: var(--bad); background: var(--paper-2); }
.rm-combo-dd {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto;
  background: white; border: 1px solid var(--hairline); border-radius: 3px;
  box-shadow: 0 8px 24px rgba(26,23,20,0.12);
  z-index: 10;
}
.rm-combo-dd.hidden { display: none; }
.rm-combo-item {
  padding: 7px 12px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  letter-spacing: normal; text-transform: none;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-combo-item:last-child { border-bottom: 0; }
.rm-combo-item:hover { background: var(--paper-2); }
.rm-combo-active { background: var(--paper-3) !important; }
.rm-combo-current { color: var(--accent); font-weight: 500; }
.rm-combo-current::before { content: '✓ '; }
.rm-combo-item mark { background: rgba(184,92,0,0.18); color: var(--accent-2); padding: 0; }
.rm-combo-empty {
  padding: 14px; text-align: center; font-size: 12px; color: var(--ink-3);
  font-family: var(--font-body); letter-spacing: normal; text-transform: none;
}
.rm-fld-check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; cursor: pointer; }
.rm-fld-check input { transform: translateY(1px); }
.rm-fld-check span { font-family: var(--font-body); font-size: 12px; color: var(--ink-2);
  letter-spacing: normal; text-transform: none; }

.rm-body { flex: 1 1 auto; overflow: auto; padding: 18px 20px 24px; }
.rm-loading, .rm-empty { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

.rm-graph { padding: 8px 0 16px; overflow-x: auto; }
.rm-grid {
  display: flex; flex-direction: row; align-items: stretch; gap: 28px;
  min-width: max-content; padding: 8px 4px;
}
.rm-col {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 180px;
}
.rm-col-head {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--ink-3); text-transform: uppercase; line-height: 1.4;
  white-space: nowrap;
  height: 28px;     /* 固定高度，保证所有列 inner 的起点一致 */
}
/* 节点容器层：flex:1 撑满列高，内层节点垂直居中 → 所有列中线在同一水平线 */
.rm-col-inner {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.rm-col-stack { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.rm-col-balance .rm-col-stack {
  border: 1px dashed var(--ink-4); border-radius: 4px;
  padding: 8px; background: rgba(245,230,210,0.20);
}

.rm-node {
  position: relative;
  padding: 8px 10px;
  border: 1px solid var(--hairline); border-left-width: 4px;
  border-radius: 3px; background: white;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  min-width: 200px; max-width: 280px;
}
.rm-node-id { font-weight: 500; }
.rm-node-sub { color: var(--ink-3); font-size: 11px; margin-top: 2px;
  font-family: var(--font-body); letter-spacing: normal;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-node-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 9px; padding: 1px 5px; border-radius: 2px;
  letter-spacing: 0.10em; text-transform: uppercase;
  background: var(--paper-3); color: var(--ink-2);
}
.rm-node-on { border-left-color: var(--ok); }
.rm-node-off { border-left-color: var(--bad); background: #FBF6F4; }
.rm-node-auto { border-left-color: var(--accent); background: #FBF6EE; }
.rm-node-top { display: flex; align-items: center; gap: 6px; }
.rm-node-top .rm-node-id { flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-node-w {
  flex-shrink: 0;
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: rgba(184,92,0,0.10); color: var(--accent);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}
.rm-node-entry {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink); border-left-color: var(--accent);
  text-align: center; font-weight: 500;
}

/* 列间连接线（虚线）：锚到 col-inner 中线，所有列共享同一水平线 */
.rm-col + .rm-col .rm-col-inner::before {
  content: ''; position: absolute; left: -28px; top: 50%;
  width: 28px; border-top: 1px dashed var(--ink-4);
  pointer-events: none;
}

.rm-logic {
  margin-top: 8px; padding: 10px 14px;
  background: var(--paper-2); border: 1px solid var(--hairline);
  border-radius: 3px; font-size: 12px; color: var(--ink-2);
  line-height: 1.7;
}

.rm-disabled { margin-top: 18px; }
.rm-disabled summary {
  padding: 8px 0; font-size: 13px; color: var(--ink-2);
  cursor: pointer; user-select: none; border-bottom: 1px solid var(--hairline);
}
.rm-disabled summary:hover { color: var(--ink); }
.rm-disabled-list { padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.rm-disabled-row {
  display: grid;
  /* id | name | badge | groups | reason(fill) | time */
  grid-template-columns: 56px minmax(180px, 240px) 52px minmax(120px, 200px) minmax(0, 1fr) 140px;
  align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--hairline);
}
.rm-disabled-row:hover { background: var(--paper-2); }
.rm-d-id { color: var(--ink-4); }
.rm-d-name {
  text-decoration: line-through; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rm-d-badge {
  font-size: 10px; padding: 1px 5px; border-radius: 2px;
  letter-spacing: 0.10em; text-transform: uppercase;
  text-align: center; justify-self: start;
}
.rm-d-groups {
  font-family: var(--font-body); color: var(--ink-3); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rm-d-reason {
  font-family: var(--font-body); color: var(--ink-2); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.rm-d-time {
  font-family: var(--font-mono); color: var(--ink-4); font-size: 10px;
  letter-spacing: 0.04em; text-align: right;
}
.rm-st-on { background: rgba(46,163,79,0.10); color: var(--ok); }
.rm-st-off { background: rgba(221,58,31,0.10); color: var(--bad); }
.rm-st-auto { background: rgba(184,92,0,0.10); color: var(--accent); }

@media (max-width: 900px) {
  .rm-disabled-row {
    grid-template-columns: 56px 1fr 52px;
    grid-template-areas:
      "id name badge"
      "grp grp grp"
      "reason reason reason"
      "time time time";
  }
  .rm-d-id { grid-area: id; }
  .rm-d-name { grid-area: name; }
  .rm-d-badge { grid-area: badge; }
  .rm-d-groups { grid-area: grp; }
  .rm-d-reason { grid-area: reason; white-space: normal; }
  .rm-d-time { grid-area: time; text-align: left; }
}

/* ===== 通道备注模块（/channels.html 详情看板底部） ===== */
.af-remarks-body { font-size: 13px; }
.af-remarks-section { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--hairline); }
.af-remarks-section:last-child { border-bottom: none; }
.af-remarks-sec-title {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-2); font-weight: 600;
  letter-spacing: 0.08em; margin-bottom: 6px;
}
.af-remarks-sec-title small { font-family: var(--font-base, inherit); font-weight: normal; letter-spacing: 0; margin-left: 8px; }

.af-remark-row {
  padding: 8px 10px; margin: 6px 0;
  background: #fafaf8;
  border-left: 3px solid var(--accent, #B85C00);
  border-radius: 2px;
}
.af-remark-archived {
  background: #f5f5f0;
  border-left-color: var(--ink-3, #7A736A);
  opacity: 0.92;
}
.af-remark-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-3); margin-bottom: 4px;
  flex-wrap: wrap;
}
.af-remark-meta { font-family: var(--font-mono); }
.af-remark-actions { margin-left: auto; display: flex; gap: 4px; }
.af-remark-content {
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink); font-size: 13px;
}
.af-remark-page { font-size: 11px; text-decoration: none; }
.af-remark-page:hover { color: var(--accent); }

.af-remark-edit-text { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 2px; resize: vertical; }
.af-remark-edit-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.af-remark-edit-row select { padding: 3px 6px; font-size: 12px; }
.af-remark-edit-actions { margin-left: auto; display: flex; gap: 6px; }

.af-remarks-add {
  margin-top: 12px; padding: 10px 12px;
  background: white; border: 1px dashed var(--hairline); border-radius: 4px;
}
.af-remarks-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.af-remarks-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-3); }
.af-remarks-field > span { font-family: var(--font-mono); letter-spacing: 0.05em; }
.af-remarks-field select { padding: 4px 8px; font-size: 12px; min-width: 200px; }
.af-remarks-field textarea { padding: 6px 8px; font-size: 13px; font-family: inherit; border: 1px solid var(--hairline); border-radius: 2px; resize: vertical; min-width: 320px; }
.af-remarks-field-grow { flex: 1; min-width: 320px; }
.af-remarks-field-grow textarea { width: 100%; box-sizing: border-box; }
