/* 模型选单皮肤（2026-10-11）：像素图标 + 两组折叠。见 model-menu.js。 */

/* 像素图标：保持硬边，底色压暗一点让图标自己出彩 */
.model-switch-menu > button > .switch-icon img { image-rendering: pixelated; image-rendering: crisp-edges; }
#modelSwitch .model-picker-compact > .model-option > .switch-icon {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--text) 6%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
  opacity: 1;
}
#modelSwitch .model-picker-compact > .model-option > .switch-icon img { width: 22px; height: 22px; }
/* 公益线路原来按站标的横构图定过宽高，换成方图标后按方的来 */
.model-switch-menu > button[data-tier="fm42"] > .switch-icon img,
.model-switch-menu > button[data-tier="happyfox"] > .switch-icon img { width: 22px; height: 22px; }

/* 折叠组：领头那档价格牌后面挂一枚小钮（「＋ smod 4.2」/「收起」），被收着的那几档缩进挂在下面 */
#modelSwitch .model-picker-compact > .model-option .model-fold-chip {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  vertical-align: 1px;
  white-space: nowrap;
  cursor: pointer;
}
#modelSwitch .model-picker-compact > .model-option .model-fold-chip:hover,
#modelSwitch .model-picker-compact > .model-option .model-fold-chip:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 35%, var(--line));
  outline: none;
}
#modelSwitch .model-picker-compact > .model-option .model-fold-chip[aria-expanded="true"] {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
#modelSwitch .model-picker-compact > .model-option.model-fold-member {
  width: calc(100% - 22px);
  margin-left: 22px;
  border-left: 2px solid color-mix(in srgb, var(--text) 14%, var(--line));
  border-radius: 0 7px 7px 0;
}
#modelSwitch .model-picker-compact > .model-option.model-fold-member[hidden] { display: none !important; }

/* 输入框旁的模型按钮：当前那档的像素图标 */
#modelSwitch .model-switch-trigger > i.model-switch-art { display: inline-grid; place-items: center; font-style: normal; }
#modelSwitch .model-switch-trigger > i.model-switch-art img {
  width: 16px; height: 16px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* 帮手选择删掉（站长 10-11），固定「自动」见 model-menu.js */
#crewSwitch { display: none !important; }

/* 上下文：发送旁边一个小方块里一圈圆环；悬停只说「上下文：xx%」 */
#appView .chat-column:not(.blank) #ctxMeter.ctx-ring { display: inline-grid !important; }
#ctxMeter.ctx-ring {
  --ctx-pct: 0;
  --ctx-color: var(--green, #2f9e44);
  position: relative;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  min-width: 0;
  max-width: none;
  margin: 0 4px 0 2px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 22%, var(--line));
  border-radius: 7px;
  background: var(--panel);
  box-shadow: none;
  cursor: default;
}
#ctxMeter.ctx-ring[data-level="hot"] { --ctx-color: var(--warn, #d9a441); }
#ctxMeter.ctx-ring[data-level="full"] { --ctx-color: var(--bad, #d64545); }
#ctxMeter.ctx-ring > b, #ctxMeter.ctx-ring > i { display: none !important; }
#ctxMeter.ctx-ring::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(var(--ctx-color) calc(var(--ctx-pct) * 1%), color-mix(in srgb, var(--text) 14%, transparent) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.6px, #000 5.2px);
          mask: radial-gradient(circle, transparent 4.6px, #000 5.2px);
}
#ctxMeter.ctx-ring::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--panel);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 20;
}
#ctxMeter.ctx-ring:hover::after { opacity: 1; }

/* dsv4.1 分时价签：低谷绿、高峰红 */
#modelSwitch .model-picker-compact > .model-option > b > .model-rate.model-rate-off,
.model-switch-menu .model-rate.model-rate-off {
  color: #2f9e44;
  border-color: color-mix(in srgb, #2f9e44 50%, transparent);
  background: color-mix(in srgb, #2f9e44 10%, transparent);
}
#modelSwitch .model-picker-compact > .model-option > b > .model-rate.model-rate-peak,
.model-switch-menu .model-rate.model-rate-peak {
  color: #d64545;
  border-color: color-mix(in srgb, #d64545 50%, transparent);
  background: color-mix(in srgb, #d64545 10%, transparent);
}

/* dsv4.1：hx.js 那枚原价签留着给 paintRates 改（藏起来），我们照它出一枚当前时段的 */
#modelSwitch .model-picker-compact > .model-option > b > .model-rate[hidden],
.model-switch-menu .model-rate[data-tier][hidden] { display: none !important; }

/* 2026-10-26 dsv4.1 代号牌「1017」：实心绿底白字，跟描边的「低谷」价签分得开 */
#modelSwitch .model-code,
.model-switch-menu .model-code {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid #2f9e44;
  border-radius: 4px;
  background: #2f9e44;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: .5px;
  vertical-align: middle;
}
/* 手机上输入栏那颗按钮太窄，挂了牌子会把「dsv4.1」挤成省略号：按钮里只在宽屏挂，选单里照挂 */
@media (max-width: 760px) {
  #modelSwitch .model-switch-current .model-code { display: none; }
}

/* 2026-11-11 测试档（gemini-4-argon / gemini-4-carbon）名字后面的「测试」牌：琥珀色描边，跟绿色的代号牌、价签分得开 */
#modelSwitch .model-test,
.model-switch-menu .model-test {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, #e08a00 60%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, #e08a00 12%, transparent);
  color: #c77700;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  vertical-align: middle;
}
