/* 模型选单最下面的「生图」「积分上限」（2026-11-22，见 model-extras.js）。
   外观跟「思考深度」那一行一个路数：左边小字标签，右边控件；颜色全走站里的 token。 */

/* 选单里多了两行：把高度上限放宽一点，默认状态不用滚就能看全；思考深度那一行不再吸底（它下面还有东西）。 */
@media (min-width: 821px) {
  #appView #modelSwitch .model-switch-menu.model-picker-compact,
  #modelSwitch .model-switch-menu.model-picker-compact { max-height: min(calc(100dvh - 190px), 640px); }
}
#modelSwitch .model-picker-compact > .switch-effort { position: static; background: transparent; }

.model-switch-menu > .hx-mx { margin: 0 3px 1px; padding: 0 8px 4px; border-radius: 8px; }
.model-switch-menu > .hx-mx[hidden], .hx-mx [hidden] { display: none !important; }
.hx-mx-row { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.hx-mx-label { flex: none; width: 52px; color: var(--muted); font-size: 11px; font-weight: 400; cursor: default; }
.hx-mx-note { margin: -2px 0 4px 60px; color: var(--muted); font-size: 10px; line-height: 1.45; }

/* 生图：两颗并排的选择 */
.hx-mx-seg { flex: 1; min-width: 0; display: flex; gap: 5px; justify-content: flex-end; }
.hx-mx-seg > button {
  appearance: none; display: inline-flex; align-items: center; gap: 5px; min-height: 28px; min-width: 0;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; line-height: 1.2; cursor: pointer; white-space: nowrap;
}
.hx-mx-seg > button > img { width: 16px; height: 16px; flex: none; object-fit: contain; }
.hx-mx-seg > button[data-line="advanced"] > img { image-rendering: pixelated; image-rendering: crisp-edges; }
.hx-mx-seg > button > b { font-weight: 400; }
.hx-mx-seg > button > small { font-size: 10px; opacity: .8; }
.hx-mx-seg > button:hover { border-color: var(--green, var(--accent)); color: var(--green, var(--accent)); }
.hx-mx-seg > button.on {
  border-color: var(--green, var(--accent));
  background: color-mix(in srgb, var(--green, var(--accent)) 13%, var(--panel, var(--surface)));
  color: var(--green, var(--accent));
}
.hx-mx-seg > button.on > b { font-weight: 800; }
.hx-mx-seg > button.dead { opacity: .45; cursor: not-allowed; }
.hx-mx-seg > button.dead:hover { border-color: var(--line); color: var(--muted); }
.hx-mx-seg > button.on.dead { opacity: 1; cursor: default; }
.hx-mx-img.locked .hx-mx-seg > button.on::after { content: "🔒"; font-size: 10px; }

/* 积分上限：滑块 + 右边的数 */
.hx-mx-cap > input[type="range"] {
  flex: 1; min-width: 0; height: 28px; margin: 0; padding: 0; background: transparent; cursor: pointer;
  accent-color: var(--green, var(--accent)); -webkit-appearance: none; appearance: none;
  --hx-mx-fill: 100%;
}
.hx-mx-cap > input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--green, var(--accent)) 0 var(--hx-mx-fill), var(--line) var(--hx-mx-fill) 100%);
}
.hx-mx-cap > input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 4px;
  background: var(--panel, var(--surface, #fff)); border: 2px solid var(--green, var(--accent));
  box-shadow: 0 1px 3px rgba(13, 24, 12, .25);
}
.hx-mx-cap > input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.hx-mx-cap > input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--green, var(--accent)); }
.hx-mx-cap > input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 4px; background: var(--panel, var(--surface, #fff));
  border: 2px solid var(--green, var(--accent)); box-shadow: 0 1px 3px rgba(13, 24, 12, .25);
}
.hx-mx-cap > input[type="range"]:focus-visible { outline: 2px solid var(--green, var(--accent)); outline-offset: 2px; border-radius: 6px; }
.hx-mx-value { flex: none; min-width: 58px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-mx-cap.on .hx-mx-value { color: var(--warning-text, #a05a00); font-weight: 800; }

/* 「改上限」点过来时闪一下，告诉人是这儿 */
@keyframes hx-mx-flash { 0%, 60% { background: color-mix(in srgb, var(--warning-text, #c77700) 16%, transparent); } 100% { background: transparent; } }
.hx-mx.flash { animation: hx-mx-flash 1.6s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .hx-mx.flash { animation: none; } }

/* 模型按钮上的小牌：设了上限才有 */
.model-switch-trigger > .hx-mx-badge {
  display: inline-flex; align-items: center; gap: 3px; flex: none; margin-left: 2px; padding-left: 7px;
  border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  color: var(--warning-text, #a05a00); font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.model-switch-trigger > .hx-mx-badge[hidden] { display: none; }
.model-switch-trigger > .hx-mx-badge > svg { width: 14px; height: 14px; display: block; }
/* 窄的时候只留金币 */
@media (max-width: 1180px) { .model-switch-trigger > .hx-mx-badge > span { display: none; } }

@media (max-width: 820px) {
  .hx-mx-row { min-height: 42px; }
  .hx-mx-seg > button { min-height: 34px; padding: 3px 6px; gap: 4px; }
  /* 手机样式表把选单里的 small 都收掉了：这两颗上的「100/张」「免费」是价钱，得留着 */
  .model-switch-menu .hx-mx-seg > button > small { display: inline !important; }
  .hx-mx-label { width: 48px; }
  .hx-mx-note { margin-left: 56px; }
  .hx-mx-cap > input[type="range"] { height: 36px; }
}
