/* Claude 风格工作台 · 模型选择器
   来源：dsh-claude-style@1e7acc5b 的 features/model/model-picker.css、
   shared/popover.css 与 docs/screenshots（模型弹层）。卡片壳、行节奏、
   右侧选中勾、菜单生长动效按上游；厂商 logo 与上游描述表未使用，
   行内是 NeoBangX 自己的描述、AA 评级和免费/免码标签。
   列表按真实目录顺序平铺，不做提供方分组。 */

.model-popover {
  --menu-surface: color-mix(in srgb, var(--ink) 3.5%, var(--card));
  position: fixed;
  z-index: var(--layer-takeover);
  box-sizing: border-box;
  max-height: min(70vh / var(--zoom), 560px);
  display: flex;
  flex-direction: column;
  padding: 4px 0 6px;
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 14px;
  background: var(--menu-surface);
  box-shadow:
    0 12px 32px rgba(20, 20, 19, 0.12),
    0 2px 7px rgba(20, 20, 19, 0.06);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97) translateY(4px);
  transform-origin: bottom right;
  transition:
    opacity var(--dur-exit) var(--ease-settle),
    transform var(--dur-exit) var(--ease-settle),
    visibility 0s linear var(--dur-exit);
}
.model-popover:focus {
  outline: none;
}
.model-popover[data-open="true"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity var(--dur-open) var(--ease-settle),
    transform var(--dur-open) var(--ease-settle),
    visibility 0s;
}
html[data-agent-theme="dark"] .model-popover {
  --menu-surface: var(--card);
  border-color: color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.4);
}
.model-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px;
  scrollbar-gutter: stable;
}
.model-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color var(--dur-feedback) var(--ease-standard);
}
.model-row:hover,
.model-row[data-active] {
  background: color-mix(in srgb, var(--ink) 6.5%, transparent);
}
.model-row-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.model-row-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.model-row-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 19px;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-row-desc {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-row-tag {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
}
/* 免码沿用同一枚标签的尺寸，只换一层蓝色，和主站「免码」语义一致。 */
.model-row-tag-nocode {
  background: color-mix(in srgb, #3b82f6 12%, transparent);
  color: color-mix(in srgb, #3b82f6 68%, var(--ink));
}
/* 打击级别：颜色来自 rating.mjs 的 AA_STRIKE_LEVELS，几何尺寸与免费标签
   同一行居中；浅色下压暗、深色下提亮，保证 10px 字仍可读。 */
.model-row-rating {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--rating-color) 32%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rating-color) 12%, transparent);
  color: color-mix(in srgb, var(--rating-color) 76%, var(--ink));
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
html[data-agent-theme="dark"] .model-row-rating {
  color: color-mix(in srgb, var(--rating-color) 58%, var(--ink));
}
.model-row-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent);
  opacity: 0;
}
.model-row[data-selected="true"] .model-row-check {
  opacity: 1;
}
.model-empty {
  padding: 16px 12px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

/* 断点用 <html data-vp>（按整页缩放后的视口算，见 zoom.mjs），不用 @media。 */
:where(html[data-vp~="w767"]) .model-popover {
  max-height: min(62vh / var(--zoom), 520px);
}
:where(html[data-vp~="w767"]) .model-row {
  min-height: 46px;
  padding: 8px 10px;
}
:where(html[data-vp~="w767"]) .model-row-name {
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .model-popover,
  .model-popover:focus {
  outline: none;
}
.model-popover[data-open="true"] {
    transition: none;
  }
}
