/* ═══════════════════════════════════════════════════════════════════
   天讯 API · 「降智检测」标记 + 详情弹层样式 (tx-degrade.css) · 2026-10-06
   只作用于 .tx-degrade-* —— 不改任何既有选择器，删掉即完全恢复。
   颜色刻意用「青绿=通过 / 琥珀=待复检」，不用刺眼的红：这是对外页面。
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────── 卡片上的标记 ───────────── */
.tx-degrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  transition: filter .15s ease, box-shadow .15s ease;
}
.tx-degrade-badge svg { width: 11px; height: 11px; flex: none; }
.tx-degrade-badge:hover { filter: brightness(0.97); box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
.tx-degrade-badge.is-warn:hover { box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.tx-degrade-badge:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

.tx-degrade-badge.is-ok {
  color: #0f766e;
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.30);
}
.tx-degrade-badge.is-warn {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}
.tx-degrade-more {
  font-size: 10px;
  opacity: .7;
  border-left: 1px solid currentColor;
  padding-left: 5px;
  margin-left: 1px;
}

/* ───────────── 详情弹层 ───────────── */
.tx-degrade-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;              /* 压过 new-api 的弹层 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.tx-degrade-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  max-height: 84vh;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 64px rgba(2, 6, 23, .28);
  font-size: 13px;
  line-height: 1.6;
}
html.dark .tx-degrade-panel {
  background: #0f172a;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, .28);
}

.tx-degrade-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.tx-degrade-title { display: flex; flex-direction: column; gap: 2px; }
.tx-degrade-title strong { font-size: 15px; font-weight: 600; }
.tx-degrade-model { font-size: 12px; opacity: .7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tx-degrade-close {
  flex: none;
  width: 28px; height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  opacity: .65;
}
.tx-degrade-close:hover { opacity: 1; background: rgba(148, 163, 184, .16); }

.tx-degrade-verdict {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
}
.tx-degrade-verdict svg { width: 14px; height: 14px; flex: none; }
.tx-degrade-panel.is-ok .tx-degrade-verdict { color: #0f766e; background: rgba(16, 185, 129, .10); }
.tx-degrade-panel.is-warn .tx-degrade-verdict { color: #b45309; background: rgba(245, 158, 11, .12); }
html.dark .tx-degrade-panel.is-ok .tx-degrade-verdict { color: #5eead4; }
html.dark .tx-degrade-panel.is-warn .tx-degrade-verdict { color: #fcd34d; }
.tx-degrade-at { margin-left: auto; font-weight: 400; font-size: 12px; opacity: .75; }

.tx-degrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  padding: 0 16px 12px;
}
.tx-degrade-kv { display: flex; gap: 8px; min-width: 0; }
.tx-degrade-k { flex: none; width: 92px; opacity: .62; font-size: 12px; }
.tx-degrade-v { min-width: 0; word-break: break-word; font-size: 12px; }

.tx-degrade-answer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 16px;
  border: 1px solid rgba(148, 163, 184, .30);
  border-radius: 10px;
  overflow: hidden;
}
.tx-degrade-answer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(148, 163, 184, .10);
  font-size: 12px;
  font-weight: 600;
}
.tx-degrade-len { font-weight: 400; opacity: .6; }
.tx-degrade-copy {
  margin-left: auto;
  padding: 2px 10px;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
}
.tx-degrade-copy:hover { background: rgba(148, 163, 184, .18); }
.tx-degrade-text {
  margin: 0;
  padding: 12px;
  overflow: auto;
  max-height: 46vh;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  background: transparent;
}
.tx-degrade-empty { padding: 14px 12px; opacity: .6; }

.tx-degrade-foot {
  padding: 10px 16px 14px;
  font-size: 11px;
  line-height: 1.6;
  opacity: .6;
}

/* 窄屏：标记换行到模型名下方；弹层贴边 */
@media (max-width: 640px) {
  .tx-degrade-badge { margin-left: 0; margin-top: 4px; }
  .tx-degrade-modal { padding: 10px; }
  .tx-degrade-panel { max-height: 90vh; }
  .tx-degrade-grid { grid-template-columns: 1fr; }
  .tx-degrade-k { width: 80px; }
}
