/* 对话制作页的增量样式。
   simple.css 一个字不改：气泡、卡片、日志沿用线上已有的 .message / .turn-card /
   .task-log，这里只补两样东西——右侧资产栏，以及把内核那套工作记录（工具调用、
   输出、待办、思考）套进我们的配色。 */

/* --------------------------------------------------- 侧栏那一组新建按钮

   四颗（贴图 / 建模 / 模型市场 / 我的资产）的样式不在这里，在 simple.css 里，搜
   「侧栏那一组新建按钮」。

   挪走的理由：这四颗按钮同时长在简洁模式（simple.html）和这一页（hx/chat.html）
   上，而 simple.css 是两边都引的唯一一张样式表——simple.html 不引 hx.css。写在
   这里就只能管到工作台，简洁模式那边只好再抄一份（当时抄在 simple.html 的行内
   <style> 里），两份一漂移就出现"同一排按钮两个页面不一样"。而且原来两份都被
   simple.css 里的 #newTexture 按 id 压住了「贴图」那一颗，谁也没真的生效。
   现在只留 simple.css 那一份，两个页面共用。 */

/* ------------------------------------------------------- 还没说话的那一屏

   一句话都没发的时候，这一列只有品牌和输入框，居中摆着（跟老站首页一个样）。
   发出第一句的瞬间：品牌区收起并淡出，对话区淡入，输入框顺势滑到底部。全程靠
   max-height / opacity 的补间，不是直接切换显示，所以看着是一次移动而不是跳变。 */

.hx-hero {
  flex: none;
  overflow: hidden;
  max-height: 0;
  padding: 0 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: max-height .42s cubic-bezier(.4, 0, .2, 1),
              opacity .26s ease, transform .42s cubic-bezier(.4, 0, .2, 1),
              padding .42s cubic-bezier(.4, 0, .2, 1);
}

.chat-column.blank { justify-content: center }

.chat-column.blank .hx-hero {
  max-height: 320px;
  padding: 24px 24px 20px;
  opacity: 1;
  transform: none;
}

/* 空白屏时对话区不占空间，输入框才能待在中间 */
.chat-column .conversation { transition: opacity .3s ease }
.chat-column.blank .conversation { flex: none; height: 0; padding: 0; opacity: 0 }

/* 空白屏上的输入框：圆角大一点、虚线边。档位得留着——第一句话就要花钱，用户
   得能在发之前就挑好用哪一档。智商、上下文、发送键等发过第一句再出现。 */
.chat-column.blank .dock { padding-inline: max(18px, calc((100% - 780px) / 2)) }
.chat-column.blank .dock::before { opacity: 0 }
.chat-column .dock::before { transition: opacity .3s ease }

.chat-column.blank .dock .composer {
  border-radius: 20px;
  border-style: dashed;
  padding: 16px 18px 10px;
}

.chat-column.blank .dock .composer textarea { min-height: 56px; font-size: 15px }

.chat-column.blank #effortSwitch,
.chat-column.blank .hx-ctx { display: none }

/* AI 构建开着时档位归弹窗管，这里灰掉但留在原位——直接藏了会让人以为按钮没了 */
.composer-model-switch.locked { opacity: .42 }
.composer-model-switch.locked .model-switch-trigger { cursor: not-allowed }

/* 空手时连发送键都不摆；一开始打字它才淡进来 */
.chat-column.blank .send { display: none }
.chat-column.blank .composer.writing .send { display: grid; animation: hx-pop .22s ease }

/* 发完第一句，这一排控件淡进来 */
.chat-column:not(.blank) .composer-model-switch,
.chat-column:not(.blank) .hx-ctx { animation: hx-pop .38s ease }

@keyframes hx-pop {
  from { opacity: 0; transform: translateY(4px) }
  to { opacity: 1; transform: none }
}

/* ------------------------------------------------------- 首次进入引导

   选择页是一整层高斯模糊；教学页拆成四块模糊幕布，围出一个真正清晰的窗口。
   原页面不搬、不复制，窗口只跟着目标区域走，所以教学结束后不会有布局跳动。 */

.hx-onboarding[hidden], .hx-tour[hidden] { display: none }
body.hx-guide-lock { overflow: hidden }
.hx-onboarding {
  position: fixed;
  inset: 0;
  z-index: 12000;
  color: #f4f7f2;
  opacity: 0;
  transition: opacity .28s ease;
}
.hx-onboarding.is-open { opacity: 1 }
.hx-onboarding-curtain,
.hx-tour-shade {
  position: fixed;
  background: rgba(8, 12, 10, .54);
  -webkit-backdrop-filter: blur(13px) saturate(.82);
  backdrop-filter: blur(13px) saturate(.82);
}
.hx-onboarding-curtain {
  inset: 0;
  opacity: 0;
  pointer-events: auto;
}
.hx-onboarding.is-role .hx-onboarding-curtain { opacity: 1 }

.hx-role-pick {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(720px, calc(100vw - 32px));
  text-align: center;
  transform: translate(-50%, -48%) scale(.97);
  opacity: 0;
  transition: opacity .28s ease, transform .38s cubic-bezier(.2, .8, .2, 1);
}
.hx-onboarding.is-role.is-open .hx-role-pick { opacity: 1; transform: translate(-50%, -50%) scale(1) }
.hx-role-kicker {
  margin: 0 0 6px;
  color: #a9b5a6;
  font-size: 12px;
}
.hx-role-pick > h2 {
  margin: 0 0 22px;
  color: #f4f7f2;
  font-size: 25px;
  font-weight: 650;
}
.hx-role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px }
.hx-role-card {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  background: rgba(20, 26, 22, .82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .34);
  color: #edf4eb;
  text-align: center;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), border-color .2s ease,
              background .2s ease, box-shadow .2s ease;
}
.hx-role-card:first-child { background: rgba(24, 31, 24, .86) }
.hx-role-card:last-child { background: rgba(22, 27, 32, .86) }
.hx-role-card img {
  display: block;
  width: 224px;
  height: 224px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .38));
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.hx-role-card b { margin-top: 4px; font-size: 17px }
.hx-role-card small { color: #aeb9ac; font-size: 12px; line-height: 1.5 }
.hx-role-card:hover,
.hx-role-card:focus-visible {
  z-index: 1;
  outline: 0;
  transform: translateY(-7px) scale(1.055);
  border-color: rgba(169, 224, 143, .7);
  background: rgba(29, 38, 30, .95);
  box-shadow: 0 26px 68px rgba(0, 0, 0, .46), 0 0 0 3px rgba(102, 186, 74, .2);
}
.hx-role-card:hover img,
.hx-role-card:focus-visible img { transform: scale(1.045) }
.hx-role-card:active { transform: translateY(-2px) scale(1.02) }

.hx-tour { position: fixed; inset: 0; pointer-events: none }
.hx-tour-shade {
  z-index: 0;
  pointer-events: auto;
  transition: top .42s cubic-bezier(.2, .8, .2, 1), left .42s cubic-bezier(.2, .8, .2, 1),
              width .42s cubic-bezier(.2, .8, .2, 1), height .42s cubic-bezier(.2, .8, .2, 1),
              opacity .2s ease;
}
.shade-top { top: 0; left: 0; width: 100%; height: var(--tour-y, 0px) }
.shade-bottom { top: calc(var(--tour-y, 0px) + var(--tour-h, 0px)); left: 0; right: 0; bottom: 0 }
.shade-left { top: var(--tour-y, 0px); left: 0; width: var(--tour-x, 0px); height: var(--tour-h, 0px) }
.shade-right { top: var(--tour-y, 0px); left: calc(var(--tour-x, 0px) + var(--tour-w, 0px)); right: 0; height: var(--tour-h, 0px) }
.hx-tour-focus {
  position: fixed;
  z-index: 1;
  top: var(--tour-y, 0px);
  left: var(--tour-x, 0px);
  width: var(--tour-w, 0px);
  height: var(--tour-h, 0px);
  border: 2px solid rgba(168, 228, 138, .92);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .24), 0 0 34px rgba(107, 196, 72, .34);
  pointer-events: none;
  transition: top .42s cubic-bezier(.2, .8, .2, 1), left .42s cubic-bezier(.2, .8, .2, 1),
              width .42s cubic-bezier(.2, .8, .2, 1), height .42s cubic-bezier(.2, .8, .2, 1);
}
.hx-tour-card {
  position: fixed;
  z-index: 3;
  width: min(360px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  background: rgba(16, 22, 18, .95);
  box-shadow: 0 20px 64px rgba(0, 0, 0, .48);
  color: #edf4eb;
  pointer-events: auto;
  transition: top .42s cubic-bezier(.2, .8, .2, 1), left .42s cubic-bezier(.2, .8, .2, 1),
              opacity .2s ease, transform .2s ease;
}
.hx-tour-card header,
.hx-tour-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.hx-tour-card header small { color: #91a18d; font-size: 11px }
.hx-tour-card header button,
.hx-tour-card footer button {
  border: 0;
  background: transparent;
  color: #aeb9ac;
  font-size: 12px;
  cursor: pointer;
}
.hx-tour-card header button:hover,
.hx-tour-card footer button:hover { color: #fff }
.hx-tour-card h2 { margin: 16px 0 7px; color: #f4f7f2; font-size: 19px }
.hx-tour-card p { min-height: 48px; margin: 0 0 18px; color: #c2cdc0; font-size: 13px; line-height: 1.65 }
.hx-tour-card footer button { min-width: 68px; padding: 8px 10px; border-radius: 6px }
.hx-tour-card footer button.primary { background: #5eae42; color: #fff; font-weight: 650 }
.hx-tour-card footer button:disabled { visibility: hidden }
.hx-tour-card footer span { display: flex; gap: 5px }
.hx-tour-card footer span i { width: 6px; height: 6px; border-radius: 50%; background: #536050 }
.hx-tour-card footer span i.on { width: 17px; border-radius: 3px; background: #8ed26f }

@property --hx-reveal {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
.hx-onboarding.is-finishing .hx-role-pick,
.hx-onboarding.is-finishing .hx-tour-focus,
.hx-onboarding.is-finishing .hx-tour-card,
.hx-onboarding.is-finishing .hx-tour-shade { opacity: 0 }
.hx-onboarding.is-finishing .hx-onboarding-curtain {
  opacity: 1;
  --hx-reveal: 0%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--hx-reveal), #000 calc(var(--hx-reveal) + .7%));
  mask-image: radial-gradient(circle at 50% 50%, transparent var(--hx-reveal), #000 calc(var(--hx-reveal) + .7%));
  animation: hx-tour-reveal .82s cubic-bezier(.5, 0, .2, 1) forwards;
}
@keyframes hx-tour-reveal {
  from { --hx-reveal: 0%; opacity: 1 }
  88% { opacity: 1 }
  to { --hx-reveal: 142%; opacity: 0 }
}

@media (max-width: 760px) {
  .hx-role-pick { width: min(560px, calc(100vw - 22px)) }
  .hx-role-pick > h2 { margin-bottom: 14px; font-size: 21px }
  .hx-role-cards { gap: 9px }
  .hx-role-card { padding: 10px 7px 12px }
  .hx-role-card img { width: min(136px, 37vw); height: min(136px, 37vw) }
  .hx-role-card b { font-size: 14px }
  .hx-role-card small { min-height: 36px; font-size: 11px }
  .hx-role-card:hover,
  .hx-role-card:focus-visible { transform: translateY(-4px) scale(1.025) }
  .hx-tour-card { padding: 15px }
  .hx-tour-card h2 { margin-top: 12px; font-size: 17px }
  .hx-tour-card p { min-height: 42px; margin-bottom: 14px; font-size: 12.5px }
}

@media (prefers-reduced-motion: reduce) {
  .hx-onboarding *, .hx-onboarding-curtain { animation-duration: .01ms !important; transition-duration: .01ms !important }
}

/* 新手走完教学之后，空白屏上的一键示例。老手不摆。 */
.chat-column.blank .hx-hero.tall {
  max-height: min(72vh, 720px);
  overflow-y: auto;
}
.chat-column .hx-hero .hx-starters { width: min(760px, 100%); margin: 8px auto 0; text-align: center }
.hx-starters > small { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 12px }
.hx-starters > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px }
.hx-starters button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.hx-starters button:hover {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--panel));
  transform: translateY(-1px);
}

/* 只出一次的提示卡：成品 jar、胶囊栏、做完一轮各一张。 */
.hx-tipcard {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px;
  margin: 8px 0;
  padding: 9px 10px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  animation: hx-pop .3s ease;
}
.hx-tipcard i { font-style: normal; font-size: 14px; line-height: 1.4 }
.hx-tipcard p { margin: 0 }
.hx-tipcard button {
  width: 22px;
  height: 22px;
  margin: -3px -3px 0 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.hx-tipcard button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text) }
.conversation > .hx-tipcard { max-width: 92%; margin-bottom: 18px }
.hx-bench > .hx-tipcard { margin: 8px 2px 0 }

@media (max-width: 760px) {
  .hx-starters button { font-size: 12px; padding: 6px 11px }
}

/* ------------------------------------------------------------ 输入栏

   默认就一行高，写长了自己长（JS 按内容改高度）。不做卡片：去掉投影、收薄边框
   和内边距，看起来只是一条线上的输入框。

   输入栏浮在对话上面，消息从它底下滚过去——所以上方压一层从透明到底色的渐变，
   靠近的那几行是柔化淡出，而不是被一条硬边界切掉。 */

/* 渐变要压在对话内容上面，所以输入栏留在流内、只做定位参照：绝对定位试过，
   窄屏那套布局给列定了最小高度，输入栏会飘到内容中间去。 */
.chat-column .dock {
  position: relative;
  border-top: 0;
  background: transparent;
}

.chat-column .dock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 64px;
  background: linear-gradient(to bottom, transparent, var(--bg) 82%);
  pointer-events: none;
}

.chat-column .dock .composer {
  border-radius: 13px;
  padding: 8px 10px 6px;
  box-shadow: none;
  background: var(--panel);
}

/* 起步给三行的地儿。一行起步太局促了——这里写的是一整段需求，不是一句聊天，
   写到第二行就开始跳高，人一边想一边看着框在动。 */
.chat-column .dock .composer textarea {
  min-height: 76px;
  font-size: 15px;
  line-height: 1.5;
}

/* 拖文件进来时给个明确落点 */
.composer.dragging {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
}

/* 底下那排按钮跟着收窄，别让一行输入配一大片留白 */
.chat-column .composer-bottom { margin-top: 4px; gap: 6px }
.chat-column .composer-bottom .hx-attach,
.chat-column .composer-bottom .hx-mic,
.chat-column .composer-bottom .send { width: 30px; height: 30px }
.chat-column .composer-bottom .model-switch-trigger { padding: 5px 8px }

/* ------------------------------------------------------- AI 构建 · 想法池

   样式照搬老站，只是从右侧栏挪进了弹窗。 */

/* 输入栏里的「AI 构建」开关，样式跟老站那颗一致 */
.ai-build-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  cursor: pointer;
  user-select: none;
}

.ai-build-toggle > input { position: absolute; opacity: 0; pointer-events: none }

.ai-build-switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border: 2px solid color-mix(in srgb, var(--muted) 75%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 14%, var(--panel));
  transition: .16s;
}

.ai-build-switch i {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: .16s;
}

.ai-build-toggle > input:checked + .ai-build-switch { border-color: #2d6d20; background: var(--green) }
.ai-build-toggle > input:checked + .ai-build-switch i { left: 17px; background: #fff }
.ai-build-toggle > input:focus-visible + .ai-build-switch {
  outline: 2px solid color-mix(in srgb, var(--green) 55%, transparent);
  outline-offset: 2px;
}

.ai-build-copy { display: grid; line-height: 1.25 }
.ai-build-copy b { font-size: 12px }
.ai-build-copy small { color: var(--muted); font-size: 9px; white-space: nowrap }
.ai-build-toggle > input:checked ~ .ai-build-copy b { color: var(--green) }

@media (max-width: 900px) { .ai-build-copy small { display: none } }

.plan-dialog section { max-width: 980px; width: min(96vw, 980px) }
.plan-ask { display: flex; gap: 10px; align-items: flex-end; padding: 4px 0 2px }
.plan-ask textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  font: 14px/1.6 inherit;
}
.plan-ask textarea:focus { border-color: var(--green) }

.plan-loading {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--panel);
}
.plan-loading i {
  width: 35px; height: 35px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: hx-spin .8s linear infinite;
}
.plan-loading b { margin-top: 13px }
.plan-loading small { color: var(--muted) }
@keyframes hx-spin { to { transform: rotate(360deg) } }

#planContent { max-height: 60vh; overflow: auto }

.plan-summary-edit {
  display: block;
  padding: 10px 14px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.plan-summary-edit > span {
  display: flex; align-items: center; gap: 8px;
  color: var(--green); font-size: 11px; font-weight: 700;
}
.plan-summary-edit > span small { color: var(--muted); font-weight: 400 }
.plan-summary-edit textarea {
  display: block; width: 100%; min-height: 52px; margin-top: 4px;
  border: 0; outline: 0; resize: vertical;
  background: transparent; color: var(--text); font: 14px/1.6 inherit;
}
.plan-summary-edit:focus-within { border-color: var(--green); box-shadow: inset 3px 0 var(--green) }

.idea-library-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 5px 1px 10px }
.idea-library-head h3 { margin: 0; font-size: 17px }
.idea-library-head small { color: var(--green) }
.idea-library-head > span { color: var(--muted); font-size: 12px }

.idea-group { margin-bottom: 13px; border: 1px solid var(--line); background: var(--panel); padding: 12px }
.idea-group > header { display: flex; align-items: center; gap: 9px; margin-bottom: 10px }
.idea-group > header > span {
  width: 25px; height: 25px; display: grid; place-items: center;
  border-radius: 50%; background: var(--soft); color: var(--green); font-weight: 700;
}
.idea-group h3, .idea-group p { margin: 0 }
.idea-group h3 { font-size: 14px }
.idea-group p { color: var(--muted); font-size: 11px }

.idea-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px }
.idea-card, .custom-idea {
  min-width: 0; min-height: 112px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 8px;
  text-align: left;
}
.idea-card { position: relative; display: flex; flex-direction: column; cursor: pointer }
.idea-card:hover { border-color: var(--green); transform: translateY(-2px) }
.idea-card.in-pool { border-color: var(--green); background: var(--soft) }
.idea-card em, .custom-idea em { color: var(--green); font-size: 10px; font-style: normal }
.idea-card b { font-size: 12px; line-height: 1.4; margin: 3px 0 }
.idea-card small { color: var(--muted); font-size: 10px; line-height: 1.35 }
.idea-card i { margin-top: auto; color: var(--green); font-size: 9px; font-style: normal }
.idea-card-remove {
  position: absolute; top: 5px; right: 6px;
  width: 17px; height: 17px; display: grid; place-items: center;
  border-radius: 50%; background: var(--green); color: var(--on-accent);
  font: 700 13px/1 sans-serif; cursor: pointer;
}

.custom-idea { display: flex; flex-direction: column; background: linear-gradient(145deg, var(--panel), var(--soft)) }
.custom-idea textarea {
  flex: 1; min-height: 48px; margin: 4px 0; padding: 5px;
  border: 0; border-bottom: 1px solid var(--line); outline: 0; resize: none;
  background: transparent; color: var(--text); font: 11px/1.4 inherit;
}
.custom-idea button { border: 0; background: transparent; color: var(--green); padding: 3px; text-align: right; cursor: pointer; font-size: 10px }

.idea-pool {
  margin: 14px 0 4px;
  border: 2px dashed color-mix(in srgb, var(--green) 55%, var(--line));
  background: linear-gradient(135deg, var(--soft), var(--panel));
  padding: 14px;
}
.idea-pool > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 11px }
.idea-pool h3 { margin: 0; font-size: 17px }
.idea-pool header small { color: var(--green) }
.idea-pool header > span { color: var(--muted); font-size: 12px }
.pool-dropzone {
  min-height: 120px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start; gap: 9px; padding: 10px;
  background: color-mix(in srgb, var(--panel) 75%, transparent);
}
.pool-empty { grid-column: 1/-1; align-self: center; text-align: center; color: var(--muted); padding: 25px }
.pool-idea {
  position: relative; min-width: 0;
  padding: 10px 32px 10px 11px;
  background: var(--panel); border: 1px solid var(--line);
  /* 原来写死 rgba(30,60,25,.07)：一抹带绿的近黑压在 7% 上，深色主题下等于没有阴影。
     --shadow-card 自己就分了深浅两套。 */
  box-shadow: var(--shadow-card);
}
.pool-idea > span, .pool-idea > b, .pool-idea > small { display: block }
.pool-idea > span { color: var(--green); font-size: 10px }
.pool-idea > b { font-size: 13px }
.pool-idea > small { color: var(--muted); font-size: 11px; margin-top: 2px }
.pool-idea > button {
  position: absolute; right: 7px; top: 7px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px;
}

@media (max-width: 1100px) { .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 760px) { .pool-dropzone { grid-template-columns: 1fr } }

/* 顶上那条"还有更早的记录" */
.hx-older {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.hx-older:hover { border-color: var(--green); color: var(--green) }

/* 标题旁的对话编号，点一下复制 */
.hx-id {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .2px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.hx-id:hover { color: var(--text); border-color: var(--text) }
/* 「已复制」原来写死 #2f9e44：这个绿不在令牌里，也没跟着主题走——浅色下压在白面板
   上只有 3.45:1（正文要 4.5:1），提示语反而是最看不清的那一下。换成 --success，
   浅色 5.28:1 / 深色 7.58:1，两边都过。 */
.hx-id.copied { color: var(--success); border-color: var(--success); font-family: inherit }

/* ---------------------------------------------------------------- 文件树

   资产栏按目录摆全部文件，默认折叠，点一层开一层，每行右边能单独下载。 */

.tree-branch { margin: 0 }

.tree-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.tree-head:hover { background: var(--soft) }
.tree-head b { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tree-head em { color: var(--muted); font-size: 10px; font-style: normal }

/* 目录名旁边那句人话：blockstates 到底是什么，看这个 */
.tree-note {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-caret { width: 10px; color: var(--muted); font-style: normal; font-size: 9px }

/* 常驻三类（模型 / 贴图 / 模组本体）：永远在最上面，跟下面那棵完整目录树分开。 */
.pinned-set {
  display: grid;
  /* 网格项默认不肯比自己的内容还窄。不压住的话，说明文字长一点就把整块撑宽，
     右边的"回到这一版"会被顶到面板外面去。 */
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0 0 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}
.pinned > .tree-head b { font-weight: 600 }
.pinned > .tree-head:hover { background: var(--panel) }
.pinned-empty { margin: 0 0 2px 22px; color: var(--muted); font-size: 10px }

/* 历史版本那几行：右边两个动作（下载那一版 / 回到那一版）。 */
.pinned-set > * { min-width: 0 }

.version-row { padding-left: 18px }
/* 说明只占一行：换行会把八九个版本撑成一整屏。 */
.version-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.version-back {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.version-back:hover {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, var(--panel));
  color: var(--green);
}

.assets-split {
  margin: 8px 6px 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
}

.tree-file {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 7px;
}

.tree-file:hover { background: var(--soft) }
.tree-file > div { flex: 1; min-width: 0 }
.tree-file b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-file small { color: var(--muted); font-size: 10px }

.tree-icon { flex: none; width: 18px; height: 18px; display: grid; place-items: center }
.tree-icon svg { width: 16px; height: 16px }
.tree-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* 对话里模型给的文件链接，看得出是能点的 */
.md-file { text-decoration: underline dotted; text-underline-offset: 3px }

/* .bbmodel 当场渲出来的立体小图。贴图那份是 pixelated（放大要看清像素格），
   这份是有明暗过渡的渲染结果，按像素放大只会毛边，得改回平滑。 */
.tree-icon img.model-thumb { image-rendering: auto }

/* 悬停预览气泡。pointer-events 关掉是故意的：它只是给人看一眼，鼠标穿过去不该被
   它挡住，点它也不该有任何反应。位置由脚本钉在那一行旁边，不跟着鼠标跑。 */
.model-peek {
  position: fixed;
  z-index: 60;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease;
}

.model-peek.on { opacity: 1 }

.model-peek canvas,
.model-peek > i {
  display: block;
  width: 208px;
  height: 208px;
}

/* 载入中那一格：占住和画布一样大的地方，气泡就不会在渲出来的瞬间跳一下 */
.model-peek > i {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.model-peek b {
  display: block;
  max-width: 208px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------- 项目行上的置顶/归档/删除

   这几条样式老站写在页面自己的 <style> 里，没进 simple.css，所以这边补一份。
   按钮平时不占位，鼠标移到那一行才出来。 */

.project-item { position: relative; display: flex; align-items: center; gap: 6px }
.project-main { min-width: 0; flex: 1 }

.project-actions { display: none; gap: 1px; flex: none }
.project-item:hover .project-actions,
.project-item:focus-within .project-actions { display: flex }

.project-actions button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.project-actions button:hover { background: var(--panel); color: var(--green) }
.project-actions button.danger:hover { color: var(--bad) }
.project-actions button:disabled { opacity: .4; cursor: default }

.pin-mark { margin-right: 4px; color: var(--green); font-size: 9px }

/* 11-26 已归档挪到列表最上面：分隔线放到下边，展开后的那一组也用一条线跟正常列表隔开 */
.archive-toggle {
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.archive-toggle:hover { color: var(--text) }
.archived-projects { opacity: .82; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line) }

/* 档位卡上的预计消耗：数字是本站真实跑出来的区间，不是拍脑袋写的 */
.model-cost {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.model-choice.selected .model-cost { color: var(--green) }

/* 配置弹窗内容变长了（名称、自定义版本、消耗），撑高就自己滚 */
#setupContent { max-height: min(64vh, 560px); overflow: auto }

/* ------------------------------------------------------------ 进度：经验条

   进度按它自己那份制作清单算：清单几步就几格，勾掉几条亮几格；右上角的 3/7 是做到
   第几步。清单还没列出来的时候没有真实进度可报，就不分格、让流光扫着，表示「在动，
   但说不准还剩多少」——比随便编一个百分比诚实。

   摆在输入栏正上方：MC 的经验条就在快捷栏上面，这里的输入栏就是快捷栏。

   方块感靠形来（直角、分格、硬阴影、等宽数字），不靠原版那身荧光绿：这里是一张浅色
   的工作台卡片，一条满格的荧光绿横在输入框上太抢眼，反倒压得用户自己的字看不进去。
   绿色一律取皮肤的 --green，跟着皮肤走才不像贴上去的。 */

.hx-xp {
  position: relative;
  margin: 0 0 10px;
}
.hx-xp[hidden] { display: none }

/* 整条都是按钮：那行字、步数、槽，点哪儿都能翻开制作清单，不用去瞄那 9px 高的槽。 */
.hx-xp-track {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.hx-xp-track:focus-visible { outline: 2px solid var(--green); outline-offset: 3px }

.hx-xp-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

/* 此刻在干什么：一行字，挤不下就省略号——它不该把输入框往下顶。 */
.hx-xp-now {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 15px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hx-xp-track:hover .hx-xp-now { color: var(--text) }
.hx-xp-now.pop { animation: hx-xp-pop .28s cubic-bezier(.2, .8, .3, 1) }
@keyframes hx-xp-pop {
  0% { opacity: 0; transform: translateY(3px) }
  100% { opacity: 1; transform: none }
}

/* 第几步：一块等宽数字的小牌子。原先是 28px 的荧光绿描边大字骑在条子正中间，
   既压着槽看不清做到哪了，浅底上那颗字也实在太吵。 */
.hx-xp-level {
  flex: none;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 11%, var(--panel));
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 14px;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.hx-xp-level:empty { display: none }

/* 槽：直角、顶边一道内陷的暗线、下沿一道硬影。方块感从这儿来。 */
.hx-xp-bar {
  position: relative;
  display: block;
  height: 9px;
  overflow: hidden;               /* 分格线画在填充上层，靠它把两端裁齐 */
  /* 空槽比 --line 再压一档：不然浅底上那几格没做到的看不出来，只剩一条淡影 */
  background: color-mix(in srgb, var(--line) 82%, var(--muted));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 62%, var(--muted)),
              0 1px 0 color-mix(in srgb, var(--panel) 86%, var(--muted));
}

/* 填充：顶上一道亮线、底下一道暗线，就是原版经验条那三层的意思，收进 9px 里。 */
.hx-xp-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(
    color-mix(in srgb, var(--green) 62%, #fff) 0 2px,
    var(--green) 2px 7px,
    color-mix(in srgb, var(--green) 74%, #000) 7px);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* 分格：按步数把槽切成等长的格，缝里露的是卡片底色，看着就是一格一格的方块。
   --steps 由脚本写；缝画在每格左端，最左那道裁掉，右端才不会多出一道压在边上。
   没写 --steps（清单还没出来）时 opacity 落到 0，整层不显示。 */
.hx-xp-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--panel) 0 3px, transparent 3px);
  background-size: calc(100% / var(--steps, 1)) 100%;
  background-repeat: repeat-x;
  clip-path: inset(0 0 0 3px);
  opacity: var(--steps, 0);
}

/* 说不准进度时：不分格、不摆步数，一段流光来回扫（附魔台那种） */
.hx-xp.unknown .hx-xp-ticks { opacity: 0 }
.hx-xp.unknown .hx-xp-bar > i {
  width: 30%;
  background: linear-gradient(90deg, transparent,
              color-mix(in srgb, var(--green) 55%, var(--panel)) 32%,
              var(--green) 50%,
              color-mix(in srgb, var(--green) 55%, var(--panel)) 68%, transparent);
  animation: hx-sweep 1.9s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes hx-sweep {
  0% { transform: translateX(-110%) }
  100% { transform: translateX(340%) }
}

/* 收场：填满、亮一下（升级那声），脚本随后把它收起来 */
.hx-xp.done .hx-xp-bar > i { width: 100% }
.hx-xp.done .hx-xp-bar { animation: hx-xp-flash .9s ease-out }
@keyframes hx-xp-flash {
  0%, 100% { filter: none }
  30% { filter: brightness(1.22) }
}

/* 关了动效的人：流光和那下闪光都停掉，进度照实显示。
   进度未知时不能拿"填满"顶替流光——那看着就是做完了。改成铺一层断续的格纹，
   一眼看得出是"在动，但说不准还剩多少"。 */
@media (prefers-reduced-motion: reduce) {
  .hx-xp-now.pop,
  .hx-xp.unknown .hx-xp-bar > i,
  .hx-xp.done .hx-xp-bar { animation: none }
  .hx-xp-bar > i { transition: none }
  .hx-xp.unknown .hx-xp-bar > i {
    width: 100%;
    background: repeating-linear-gradient(90deg,
                color-mix(in srgb, var(--green) 45%, var(--panel)) 0 4px,
                transparent 4px 9px);
  }
}

/* 点开的清单：贴在条子上方的一张小卡 */
.hx-xp-list {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  max-height: min(46vh, 340px);
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  animation: hx-xp-pop .2s ease-out;
}
.hx-xp-list > b { display: block; margin-bottom: 6px; color: var(--green); font-size: 11px }
.hx-xp-list > small { color: var(--muted); font-size: 12px }
.hx-xp-list ul { margin: 0; padding: 0; list-style: none }
.hx-xp-list li { display: flex; gap: 8px; padding: 4px 0; font-size: 12.5px; line-height: 1.5 }
.hx-xp-list li i { flex: none; width: 13px; color: var(--muted); font-style: normal }
.hx-xp-list li.done { color: var(--muted) }
.hx-xp-list li.done i,
.hx-xp-list li.doing i { color: var(--green) }
.hx-xp-list li.doing { font-weight: 600 }

/* ------------------------------------------------------------ 两侧收放

   收起来靠的是网格列宽从 316px 收到 0，宽度本身是可以做补间的，所以内容是被
   "推"出去而不是啪一下消失。列宽和面板的透明度用同一条时长，收到一半时面板已
   经淡得差不多，看不到里面的字被挤成一条。 */

.project-content.has-assets {
  position: relative;
  grid-template-columns: minmax(320px, 1fr) 316px;
  transition: grid-template-columns .26s cubic-bezier(.4, 0, .2, 1);
}

.project-content.assets-closed { grid-template-columns: minmax(320px, 1fr) 0px; }

.project-content.assets-closed .assets-panel {
  padding-left: 0;
  padding-right: 0;
  border-left-width: 0;
  opacity: 0;
  pointer-events: none;
}

.assets-panel { transition: opacity .2s ease, padding .26s cubic-bezier(.4, 0, .2, 1); }

.assets-fold, .sidebar > header .icon {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.assets-fold:hover, .sidebar > header .icon:hover { color: var(--green); border-color: var(--green) }

/* 收起后留一个贴边的小把手，别让人找不到怎么放回来 */
.assets-open {
  position: absolute;
  top: 14px;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 9px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  animation: hx-slide-in .22s ease;
  transition: color .15s ease, border-color .15s ease;
}

.assets-open:hover { color: var(--green); border-color: var(--green) }
.assets-open i { font-style: normal }

@keyframes hx-slide-in {
  from { opacity: 0; transform: translateX(14px) }
  to { opacity: 1; transform: translateX(0) }
}

.sidebar { transition: margin-left .26s cubic-bezier(.4, 0, .2, 1) }
.sidebar.closed { margin-left: -276px }
.sidebar > header { display: flex; align-items: center; gap: 8px }
.sidebar > header b { flex: 1 }

/* ---------------------------------------------------------------- 资产栏 */

.assets-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 16px 22px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, var(--line));
}

.assets-panel > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.assets-panel > header small { color: var(--green); font-size: 11px; font-weight: 700; }
.assets-panel > header h2 { margin: 2px 0 0; font-size: 19px; }
.assets-panel > header > span { color: var(--muted); font-size: 11px; white-space: nowrap; }

.asset-group { margin-bottom: 15px; }

.asset-group > h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.asset-group > h3 em { color: var(--muted); font-style: normal; font-weight: 400; }

.asset-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.asset-row:hover { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.asset-row > div { min-width: 0; }
.asset-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.asset-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }

.asset-thumb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--green);
  font-size: 15px;
  font-style: normal;
}

/* 贴图和模型缩略图必须保持像素，不能被浏览器抹平 */
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.asset-row .asset-get {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 2px;
}

.asset-row .asset-get:hover { transform: translateY(1px); }

.asset-row.primary {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: var(--soft);
  box-shadow: inset 3px 0 var(--green);
}

.asset-row.primary b { font-size: 13px; }

.assets-empty {
  padding: 22px 14px;
  border: 1px dashed var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

/* --------------------------------------------------------------- 输入区 */

/* 输入栏跟对话一样宽：站里那条居中留白是给窄阅读区用的，这里不要；
   第二列（184px）本来是放费用估算的，我们没有，留着只会把输入框挤短。 */
.chat-column > .dock {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 12px 34px 20px;
}

/* 写得开一点：站里那条 .dock .composer textarea 压到 55px，一段需求写下来就得滚 */
.dock .composer textarea { min-height: 132px; max-height: 260px }

/* 主站那条提示写的是 @ 引用，这里没这功能，换成实话 */
.composer-input .pending-files:before { content: '这一轮会连同下面的话一起交给 AI' }

.hx-attach {
  width: 34px;
  height: 38px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.hx-attach:hover,
.hx-attach[aria-expanded="true"] { border-color: var(--green); color: var(--green) }
.hx-attach[aria-expanded="true"] { background: var(--soft) }

/* ------------------------------------------------- 语音输入

   麦克风按钮跟「＋」一个尺寸一个边框；录着的时候整颗变红、外圈一下一下地涨，
   转写的时候图标转圈。录音条 .hx-voice 挂在输入框上方，跟排队牌、发件箱同一列。 */
.hx-mic {
  width: 34px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: color .15s, border-color .15s, background .15s;
}
.hx-mic:hover { border-color: var(--green); color: var(--green) }
.hx-mic:disabled { cursor: progress; opacity: .8 }
.hx-mic.recording {
  --rec: #e5484d;
  color: #fff;
  background: var(--rec);
  border-color: var(--rec);
  animation: hx-mic-pulse 1.4s ease-out infinite;
}
.hx-mic.working svg { animation: hx-spin 1s linear infinite; opacity: .7 }
@keyframes hx-mic-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, #e5484d 45%, transparent) }
  70%  { box-shadow: 0 0 0 9px color-mix(in srgb, #e5484d 0%, transparent) }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, #e5484d 0%, transparent) }
}
@keyframes hx-spin { to { transform: rotate(360deg) } }

.hx-voice {
  --rec: #e5484d;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px 8px 12px;
  border: 1px solid color-mix(in srgb, var(--rec) 40%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--rec) 7%, var(--panel));
  font-size: 12px;
  color: var(--text);
  animation: hx-pop .18s ease;
}
.hx-voice[hidden] { display: none }
.hx-voice[data-mode="working"],
.hx-voice[data-mode="result"] {
  --rec: var(--green);
}
.hx-voice-dot {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: var(--rec);
}
.hx-voice[data-mode="recording"] .hx-voice-dot { animation: hx-voice-blink 1s steps(1) infinite }
.hx-voice[data-mode="working"] .hx-voice-dot {
  border: 2px solid color-mix(in srgb, var(--green) 30%, transparent);
  border-top-color: var(--green);
  background: transparent;
  animation: hx-spin .8s linear infinite;
}
@keyframes hx-voice-blink { 50% { opacity: .25 } }
.hx-voice-state { font-weight: 700; white-space: nowrap }
.hx-voice-time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.hx-voice-time[hidden], .hx-voice-swap[hidden], .hx-voice-polish[hidden],
.hx-voice-cancel[hidden], .hx-voice-done[hidden], .hx-voice-close[hidden] { display: none }
.hx-voice-bars {
  flex: 1 1 60px;
  min-width: 40px;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.hx-voice-bars i {
  --h: 0;
  flex: 1;
  height: calc(3px + var(--h) * 19px);
  border-radius: 2px;
  background: var(--rec);
  opacity: .8;
  transition: height .08s linear;
}
.hx-voice[data-mode="working"] .hx-voice-bars,
.hx-voice[data-mode="result"] .hx-voice-bars { visibility: hidden }
.hx-voice-polish {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap; color: var(--muted);
  user-select: none;
}
.hx-voice-polish input { position: absolute; opacity: 0; width: 0; height: 0 }
.hx-voice-polish span {
  width: 26px; height: 15px; border-radius: 8px; position: relative;
  background: color-mix(in srgb, var(--muted) 35%, var(--panel));
  transition: background .15s;
}
.hx-voice-polish span:after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  transition: left .15s;
}
.hx-voice-polish input:checked + span { background: var(--green) }
.hx-voice-polish input:checked + span:after { left: 13px }
.hx-voice-polish input:checked ~ small { color: var(--text) }
.hx-voice-swap { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--soft) }
.hx-voice-swap button {
  border: 0; background: transparent; color: var(--muted);
  padding: 3px 9px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.hx-voice-swap button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08) }
.hx-voice-cancel, .hx-voice-done, .hx-voice-close {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.hx-voice-done { border-color: var(--rec); background: var(--rec); color: #fff; font-weight: 600 }
.hx-voice-close { border: 0; padding: 2px 6px; color: var(--muted); font-size: 15px; line-height: 1 }
.hx-voice-close:hover { color: var(--text) }
.plan-ask .hx-mic { height: 40px; align-self: flex-end }
.plan-dialog .hx-voice { margin: 0 0 6px }
@media (max-width: 760px) {
  .hx-voice { flex-wrap: wrap }
  .hx-voice-bars { order: 9; flex: 1 1 100%; height: 18px }
}

/* ------------------------------------------------- 输入框上的素材气泡

   浮层的外壳、行的排版、悬停底色全部来自 simple.css 的 .add-menu（简洁模式输入框
   那个加号菜单就是它），这里只补它没有的三样：搜索框、类型筛选、素材行的缩略图。
   窄屏那套（变成贴屏幕底边的操作面板、避开安全区）在 mobile.css 里已经写过，
   .add-menu 一沾就有，不必再写一遍。 */

.vault-menu { width: 330px }

.vault-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 6px 8px;
}

.vault-head b { font-size: 13px }
.vault-head small { color: var(--muted); font-size: 10px; margin-left: auto }

.vault-back {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.vault-back:hover { background: var(--soft); color: var(--green) }

.vault-find { padding: 0 4px 7px }

.vault-find input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.vault-find input:focus { border-color: var(--green) }

.vault-kinds { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px 8px }

.vault-kinds button {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.vault-kinds button:hover { border-color: var(--green); color: var(--green) }

.vault-kinds button.on {
  border-color: var(--green);
  background: var(--soft);
  color: var(--green);
  font-weight: 700;
}

/* 列表自己滚，别把整个气泡撑到屏幕外面去 */
.vault-list {
  max-height: 292px;
  overflow: auto;
  overscroll-behavior: contain;
}

.vault-note {
  margin: 6px 8px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* 素材行要跟气泡里「本机上传」那两行长得一模一样。simple.css 里那条排版规则写的是
   `.add-menu>button`，只管直接儿子；素材行套在 .vault-list 里面，一条都选不中，于是
   退回浏览器自带的按钮外观：灰底带框、文字居中，而且 <i> 还是 inline——inline 元素
   的 width/height 不生效，缩略图就按原图尺寸铺开，一行能顶掉半个气泡。
   所以这里把那条两列网格照抄一遍。 */
.vault-list .vault-pick {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
  text-shadow: none;
  cursor: pointer;
}

.vault-list .vault-pick + .vault-pick { margin-top: 2px }

.vault-list .vault-pick:hover,
.vault-list .vault-pick:focus-visible {
  outline: 0;
  background: var(--soft);
  color: var(--green);
}

/* 图标格换成缩略图：尺寸跟 .add-menu>button>i 对齐 */
.vault-pick > i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--slot);
  color: var(--muted);
  font: 700 13px/1 sans-serif;
  font-style: normal;
}

.vault-pick > i img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 贴图是 16×16 的像素画，放大要保持硬边 */
  image-rendering: pixelated;
}

.vault-pick.working { opacity: .55; cursor: progress }
.vault-pick:disabled { cursor: progress }

.vault-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 6px 2px;
}

.vault-pager span { color: var(--muted); font-size: 10px }

.vault-pager button {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.vault-pager button:hover:not(:disabled) { border-color: var(--green); color: var(--green) }
.vault-pager button:disabled { opacity: .4; cursor: default }

/* 产物栏里每个文件旁边那颗「存进我的仓库」。摆在下载键「↓」左边，箭头朝上——
   下是拿到自己电脑，上是收进自己的仓库。跟下载键一样一直看得见（藏在 hover 里
   等于没有这个功能：跨工程复用是这一版的重点，得让人看见才会用），只是平时淡
   一档，鼠标扫到这一行再亮起来。 */
.vault-save {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  opacity: .6;
  cursor: pointer;
  transition: opacity .15s ease;
}

.tree-file:hover .vault-save,
.vault-save:focus-visible { opacity: 1 }
.vault-save:hover { background: var(--soft); color: var(--green) }
.vault-save:disabled { cursor: progress }

/* 旁边那颗下载键「↓」一直没人给它写样式：hx.css 里只有 `.asset-row .asset-get`
   （产物栏顶上那条"下载模组"用的），文件树里这颗选不中，于是退回浏览器自带的按钮
   外观——浅色下是个灰框，深色下是一块白方块，箭头几乎看不见。既然「↑」摆在它旁边，
   两颗就得是一对：同一副长相，只是方向相反。 */
.tree-file .asset-get {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  opacity: .6;
  cursor: pointer;
  transition: opacity .15s ease;
}

.tree-file:hover .asset-get,
.tree-file .asset-get:focus-visible { opacity: 1 }
.tree-file .asset-get:hover { background: var(--soft); color: var(--green) }

/* 跑着的时候发送键变成停止方块，跟站里任务卡的停止一个意思 */
.send.stopping { background: var(--bad); font-size: 13px }
.send:disabled { opacity: .45; cursor: not-allowed }

/* 这一轮还没完就又发的话，贴在输入框上沿等着，能改能撤。
   注意别放到 .dock 里去：那是两列网格，多一个孩子就把输入框挤成一条。 */
.hx-pending {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 10px;
  padding: 0 0 9px;
  border-bottom: 1px dashed var(--line);
}

.hx-pending:before {
  content: '排在后面 · 这一轮做完自动接着做';
  color: var(--muted);
  font-size: 9px;
}

.hx-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
  border-radius: 9px;
  background: var(--soft);
  font-size: 12px;
}

.hx-wait i {
  width: 17px;
  height: 17px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 16%, var(--panel));
  color: var(--green);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}

.hx-wait > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.hx-wait button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 5px;
}

.hx-wait button:hover { color: var(--green) }
.hx-wait button:disabled { opacity: .45; cursor: default }

/* ---------------------------------------------------------- bf-freequeue
   免费档排队牌、选单里的红/绿小牌、"当前账户已有排队"、发件箱。
   两种颜色写死而不用 --green：红绿是拥挤度语义，跟主题色无关，换皮肤也不该变。 */
.hx-queue {
  --queue-color: #e5484d;
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--queue-color) 45%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--queue-color) 8%, var(--panel));
}
.hx-queue[hidden] { display: none }
.hx-queue[data-level="green"] { --queue-color: #22a55f }
.hx-queue[data-level="red"] { --queue-color: #e5484d }
.hx-queue-head { display: flex; align-items: center; gap: 10px }
.hx-queue-head > .grow { flex: 1 }
.hx-queue-dot {
  width: 12px; height: 12px; flex: none;
  border-radius: 50%;
  background: var(--queue-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--queue-color) 22%, transparent);
  animation: hx-queue-pulse 1.6s ease-in-out infinite;
}
.hx-queue-head > b { font-size: 22px; line-height: 1.2; letter-spacing: .04em; color: var(--text) }
.hx-queue-cancel {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.hx-queue-cancel:hover { color: var(--text); border-color: var(--muted) }
.hx-queue-line { margin: 0; font-size: 14px; color: var(--text) }
.hx-queue-note { margin: 0; font-size: 11px; color: var(--muted) }
.hx-queue-note:empty { display: none }
@keyframes hx-queue-pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.25) } }

/* 选单里免费档那枚小牌：绿"空闲" / 红"排队 N 人"。颜色走 --load-color 这个变量：
   底下那条选择器（.menu > button > b > .model-load）比 [data-level] 那几条重，直接在
   它们身上写 background 会被压掉，牌子永远是灰的。 */
.model-load[data-level="green"], .model-load-dot[data-level="green"] { --load-color: #22a55f }
.model-load[data-level="red"], .model-load-dot[data-level="red"] { --load-color: #e5484d }
.model-switch-menu > button > b > .model-load {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 600;
  line-height: 1.5; vertical-align: 1px; color: #fff;
  background: var(--load-color, var(--muted));
}
.model-load[hidden] { display: none }
/* 收起状态的模型按钮上那颗点（当前档是免费档才有） */
.model-switch-trigger > .model-load-dot {
  display: inline-block; width: 8px; height: 8px; margin-left: 5px; flex: none;
  border-radius: 50%; vertical-align: middle;
  background: var(--load-color, var(--muted));
}
.model-load-dot[hidden] { display: none }

/* 当前账户在别的对话上已经排着免费档 */
.hx-queue-else {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 0 0 10px; padding: 8px 12px;
  border: 1px dashed color-mix(in srgb, #e5484d 50%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #e5484d 6%, var(--panel));
  font-size: 12px; color: var(--text);
}
.hx-queue-else[hidden] { display: none }
.hx-queue-else > b { color: #e5484d; flex: none }
.hx-queue-else > span { flex: 1; min-width: 200px; color: var(--muted) }
.hx-queue-else > button {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: 12px;
}
.hx-queue-else > button:hover { border-color: var(--muted) }

/* 发件箱：没送出去、等着重发的话。复用 .hx-wait 的排版，颜色换成琥珀 */
.hx-outbox {
  display: flex; flex-direction: column; gap: 5px;
  margin: 0 0 10px; padding: 0 0 9px;
  border-bottom: 1px dashed var(--line);
}
.hx-outbox[hidden] { display: none }
.hx-outbox:before {
  content: '还没送出去 · 网络一通就自动发，刷新页面也不会丢';
  color: var(--muted); font-size: 9px;
}
.hx-wait.hx-unsent { border-color: color-mix(in srgb, #e5a33b 55%, var(--line)) }
.hx-wait.hx-unsent > i {
  color: #e5a33b; background: color-mix(in srgb, #e5a33b 16%, var(--panel));
  animation: hx-spin 1.4s linear infinite;
}
@keyframes hx-spin { to { transform: rotate(360deg) } }
/* ---------------------------------------------------------- bf-freequeue end */

/* bf-freepool：「公益模型」那张方牌不写名字首字，摆站标。原图是 88×31 的横构图
   像素画，按牌宽铺满、保持硬边；底色沿用普通方牌的浅绿。 */
.model-switch-menu > button[data-tier="fm"] > .switch-icon img,
.model-switch-menu > button[data-tier="fm42"] > .switch-icon img {
  width: 30px;
  height: 25px;
}

/* 插话那颗按钮要比"改""撤"显眼一点：它是会立刻改变这一轮走向的动作 */
.hx-steer {
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line)) !important;
  border-radius: 7px;
  color: var(--green) !important;
  font-weight: 700;
  line-height: 1;
}
.hx-steer:hover { background: color-mix(in srgb, var(--green) 14%, transparent) }
.hx-pencil { font-size: 13px }

/* 用户气泡里带上来的文件 */
.hx-bubble-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px }
.hx-bubble-files span {
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
  border-radius: 7px;
  font-size: 10px;
  color: var(--muted);
}

/* ------------------------------------------------------- 内核的工作记录 */

.hx-turn { margin: 0 0 18px }
.hx-work { margin: 0 }

.hx-work > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  list-style: none;
}

.hx-work > summary::-webkit-details-marker { display: none }
.hx-work > summary b { font-size: 12px; font-weight: 600; }
/* 想得深浅那三档换成附魔台的经验球（1/2/3 级）：站里的图标库自己的图，
   比"低中高"三个字更像 MC。底色留着，图直接压在原来那块方牌上。 */
/* 文件图标是内联图形：描边跟着主题色，咖啡杯自己带 Java 的蓝橙，不受影响 */
.asset-thumb svg { width: 21px; height: 21px }

.jar-card i svg { width: 22px; height: 22px }

.model-switch-menu > button > .switch-icon img {
  /* 原图是"经验球 + 数字"的横构图，按方牌的宽高铺满才看得清是几级 */
  width: 28px;
  height: 21px;
  object-fit: contain;
  /* 像素画放大要保持硬边，别让浏览器抹成糊的 */
  image-rendering: pixelated;
}

/* 后台停掉的档位：还看得见有这么一档，但按不动。
   这一条是兜底；真正生效的是文件末尾那组（整块压淡会把"为什么关了"那行也压淡）。 */
.model-switch-menu > button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.model-switch-menu .model-group-title {
  margin: 7px 10px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.model-grid-category {
  grid-column: 1 / -1;
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.hx-now {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.hx-now:not(:empty):before { content: '· ' }

/* 这一轮用的档位：贴在步数前面，翻旧对话时也说得清那轮花的是哪档的钱 */
.hx-run-model:not(:empty) {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.hx-work > summary small { color: var(--muted); font-size: 11px; }
.hx-work > summary .grow { flex: 1 }
.hx-work > summary:after { content: '›'; color: var(--muted); font-size: 18px; transition: transform .15s }
.hx-work[open] > summary:after { transform: rotate(90deg) }

/* 帮手名单：不点开工作记录也看得见有谁在一起做 */
.hx-crew {
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  padding: 9px 13px 11px;
}

.hx-crew-title { display: block; font-size: 11px; color: var(--muted); font-weight: 600 }

.hx-crew-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.hx-mate {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.hx-mate:hover { border-color: var(--green) }
.hx-mate-body { display: flex; flex-direction: column; gap: 1px; min-width: 0 }
.hx-mate-body b { font-size: 12px }
.hx-mate-body small,
.hx-mate-body em {
  font-size: 10px;
  color: var(--muted);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 头像用正版皮肤切出来的脸，像素放大不要模糊 */
.hx-face {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
}

.hx-face img { width: 100%; height: 100%; image-rendering: pixelated; display: block }
.hx-mate.working .hx-face { box-shadow: 0 0 0 2px var(--green) }
.hx-mate.working em { color: var(--green) }
.hx-mate.done .hx-face { box-shadow: 0 0 0 2px var(--line) }

/* 跑动中的那枚点，和线上任务卡的呼吸灯一致 */
.hx-live { width: 7px; height: 7px; flex: none; background: var(--green); animation: hx-beat 1.1s infinite }
.hx-work.settled .hx-live { background: var(--muted); animation: none }
/* 半路断掉的那一轮：灯换个颜色，标题那句话本身已经说清楚了，不用再加图标 */
.hx-work.broke .hx-live { background: var(--warn) }
@keyframes hx-beat { 50% { opacity: .25 } }

.hx-steps {
  margin: 0;
  padding: 0 13px 8px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
  list-style: none;
}

.hx-steps > li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  font-size: 12px;
  line-height: 1.55;
}

.hx-steps > li:last-child { border-bottom: 0 }
.hx-steps time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px }
.hx-steps .hx-name { color: var(--green); font-weight: 600 }
.hx-steps .hx-brief { color: var(--muted); overflow-wrap: anywhere }
.hx-steps > li.bad .hx-name { color: var(--bad) }

.hx-steps details > summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  list-style: none;
  margin-top: 3px;
}

.hx-steps details > summary::-webkit-details-marker { display: none }
.hx-steps details > summary:before { content: '查看输出'; }
.hx-steps details[open] > summary:before { content: '收起输出'; }

.hx-out {
  margin: 6px 0 2px;
  padding: 9px 10px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: 11px/1.65 ui-monospace, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 待办清单：内核自己维护的，直接照搬显示 */
.hx-todos { margin: 0 0 18px; padding: 12px 13px; border: 1px solid var(--line); background: var(--panel) }
.hx-todos > b { display: block; margin-bottom: 8px; color: var(--green); font-size: 11px }
.hx-todos ul { margin: 0; padding: 0; list-style: none }
.hx-todos li { display: flex; gap: 8px; padding: 4px 0; font-size: 12px; line-height: 1.5 }
.hx-todos li i { flex: none; width: 13px; color: var(--muted); font-style: normal }
.hx-todos li.done { color: var(--muted) }
.hx-todos li.done i { color: var(--green) }
.hx-todos li.doing i { color: var(--green) }
.hx-todos li.doing { font-weight: 600 }

/* 思考：默认折起，想看的人才看 */
.hx-think { margin: 6px 0 0 }
.hx-think > summary { color: var(--muted); cursor: pointer; font-size: 11px; list-style: none }
.hx-think > summary::-webkit-details-marker { display: none }
.hx-think > summary:before { content: '思考过程' }
.hx-think[open] > summary:before { content: '收起思考' }
.hx-think p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; white-space: pre-wrap }

/* --------------------------------------------------------------- 零碎 */

.hx-flag {
  margin-left: 10px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.hx-flag.busy { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); color: var(--green) }
.hx-hint { color: var(--muted); font-size: 11px }
.hx-free { margin-right: 4px; color: var(--muted); font-size: 11px }

/* 回旧版的路留着，但不抢眼：默认已经是新版了 */
.hx-legacy {
  margin-right: 4px;
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.hx-legacy:hover { color: var(--text); background: var(--soft) }

/* 模型答复里的 markdown */
.md-p { margin: 0 0 8px; line-height: 1.75 }
.md-p:last-child { margin-bottom: 0 }
.md-head { margin: 12px 0 6px; font-size: 13px }
.md-head:first-child { margin-top: 0 }
.md-list { margin: 0 0 8px; padding-left: 20px; line-height: 1.75 }
.md-list li { margin: 2px 0 }
.md-code { margin: 0 0 8px; padding: 9px 11px; overflow-x: auto;
  border: 1px solid var(--line); background: var(--soft);
  font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre }
.message code, .hx-report code { padding: 1px 4px; border: 1px solid var(--line);
  background: var(--soft); font: 12px ui-monospace, Menlo, Consolas, monospace }
.message a, .hx-report a { color: var(--green); word-break: break-all }
.md-table { width: 100%; margin: 0 0 10px; border-collapse: collapse; font-size: 12px }
.md-table th, .md-table td { padding: 5px 8px; border: 1px solid var(--line);
  text-align: left; vertical-align: top }
.md-table th { background: var(--soft); font-weight: 700 }

/* 助手卡：模型派出去的分身，嵌在工作记录里，各有各的步骤和回报 */
.hx-subhost { display: block !important; padding: 0 !important }
.hx-sub { margin: 4px 0 4px 6px; border-left: 2px solid
  color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 5%, transparent) }
.hx-sub > summary { display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  cursor: pointer; list-style: none; font-size: 12px }
.hx-sub > summary::-webkit-details-marker { display: none }
.hx-sub > summary i { color: var(--green); font-style: normal }
.hx-sub > summary small { color: var(--muted); font-size: 10px }
.hx-sub > summary .hx-face { width: 20px; height: 20px; font-size: 10px }
.hx-ask { margin: 0 8px 4px; color: var(--muted); font-size: 11px; line-height: 1.5 }
.hx-report { margin: 4px 8px 8px; padding: 6px 8px; background: var(--panel);
  border: 1px solid var(--line); font-size: 11px; line-height: 1.6;
  white-space: pre-wrap }

/* jar 是用户真正要带走的东西，给它整块可点的区域 */
.jar-card { display: grid; grid-template-columns: 34px 1fr auto; align-items: center;
  gap: 10px; margin-bottom: 12px; padding: 11px 12px; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--panel)) }
.jar-card:hover { background: color-mix(in srgb, var(--green) 16%, var(--panel)) }
.jar-card i { display: grid; place-items: center; width: 34px; height: 34px;
  background: color-mix(in srgb, var(--green) 20%, var(--panel));
  color: var(--green); font-style: normal; font-size: 17px }
.jar-card b { display: block; color: var(--text); font-size: 13px }
.jar-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px }
.jar-card span { color: var(--green); font-size: 17px }
.bundle-get { padding: 3px 9px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 11px; cursor: pointer }
.bundle-get:hover { border-color: var(--green); color: var(--green) }
.hx-stop { padding: 3px 9px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 11px; cursor: pointer }
.hx-stop:hover { border-color: var(--bad); color: var(--bad) }

/* 上下文占用：数字加一条细进度，逼近上限时变色——超了就得开新会话 */
.hx-ctx { display: flex; flex-direction: column; gap: 4px; min-width: 138px }
.hx-ctx b { color: var(--muted); font-size: 11px; font-weight: 500 }
.hx-ctx i { display: block; height: 3px; background: var(--line) }
.hx-ctx em { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s }
.hx-ctx em.hot { background: var(--bad) }

@media (max-width: 1050px) {
  .project-content.has-assets { grid-template-columns: 1fr; }
  .assets-panel { border-left: 0; border-top: 1px solid var(--line); min-height: 420px; }
}

/* ------------------------------------- 档位卡片上的三样新东西（2026-08-29）

   倍率标签、关闭原因/会员门槛、smod5 的金色。三样都挂在 simple.css 那套
   「35px | 1fr | auto」三列网格上（.model-switch-menu > button），**不动列定义**
   ——那张表 simple.html 也在引，改列宽会连带把旧版简洁模式一起改了。

   第三行是靠网格自动排版隐式生成的：往第 2 列再塞一个元素，它自己会落到第 3 行。
   代价是 simple.css 里给图标和右栏写的 grid-row:1/3 只盖住前两行，所以这里把它们
   改成 1/-1，让它们跟着长到第三行，不然图标会吊在卡片上半部分。 */

.model-switch-menu > button > span,
.model-switch-menu > button > em { grid-row: 1 / -1 }

.model-switch-menu > button > u,
.model-switch-menu > button > small { grid-column: 2 }

/* 名字后面那枚单价倍率。**写的是单价之比，不是每轮花费之比**——smod5 单价 ×15
   但它写得少，一轮花的钱反而可能比 hmod5 少。所以标签上"单价"两个字不能省，
   省了这张卡片自己就前后矛盾（上面写 ×15、下面的区间却和 hmod5 一样）。 */
.model-switch-menu > button > b > .model-rate {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--muted) 32%, transparent);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: 1px;
}

/* bf-ds41：分时档的单价牌。红 = 高峰、绿 = 低峰，是这一档要让人一眼看到的事，所以做成实心
   色牌、比普通 .model-rate 大一号；两档价格和时段表在 title 里。data-window 由 paintRate 写。 */
.model-switch-menu > button > b > .model-rate[data-window] {
  display: inline-block;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset;
}
.model-switch-menu > button > b > .model-rate[data-window="peak"] {
  background: linear-gradient(135deg, #e5484d, #c62828);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 1px 4px rgba(198, 40, 40, .35);
}
.model-switch-menu > button > b > .model-rate[data-window="off"] {
  background: linear-gradient(135deg, #22a55f, #0f8a4b);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 1px 4px rgba(15, 138, 75, .35);
}
.model-switch-menu > button:disabled > b > .model-rate[data-window] { filter: grayscale(1); opacity: .7 }

/* 「消耗极高」。刻意不用 --warn：浅色主题下 --warn 和 --tier-gold 是同一个
   #8a6410，跟 smod5 的金色撞在一起就看不出这是一句提醒了。用 --danger。 */
.model-switch-menu > button > b > .model-warn {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: 1px;
}

/* bf-sm42lab：「用了返积分」。返积分的档位在名字后面挂一枚实心亮牌——这是这一档
   唯一要让人一眼看到的事，说明文字在窄卡片上会被截成一行、正好把"返 10%"吃掉。
   刻意比 .model-rate 更大更亮：那枚是给会算账的人看的，这枚是给所有人看的。 */
.model-switch-menu > button > b > .model-credit {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22a55f, #0f8a4b);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .02em;
  white-space: nowrap;
  vertical-align: 1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 1px 4px rgba(15, 138, 75, .35);
}
.model-switch-menu > button:disabled > b > .model-credit { filter: grayscale(1); opacity: .7 }

/* 第三行：点不动的写原因，能点的写这一轮大概花多少。
   两者都是 <u>，只有类名不同——不加下划线，用 <u> 纯粹因为它是个还没被这套
   样式表占用的行内标签，不用再往按钮里塞一层 div 破坏网格。 */
.model-switch-menu > button > u {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.4;
  text-decoration: none;
}
/* 关闭是"出问题了"，用 --danger；会员门槛是"你还没买这一档"，用 --tier-gold。
   两者都涂红的话，一句正常的升级提示看着像故障。--tier-gold 浅色是 #8a6410、
   深色 #f0bd4d，两边都过 4.5:1（这就是它不是"亮金"的原因，见 tokens.css 那条注释）。 */
.model-switch-menu > button > .model-why { color: var(--danger) }
.model-switch-menu > button > .model-gate { color: var(--tier-gold); font-weight: 700 }
.model-switch-menu > button > .model-cost-hint { color: var(--muted) }
.model-switch-menu > button > .model-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

/* 灰掉的那一档。simple.css 里已经有 :disabled:not(.selected){opacity:.5}，
   hx.css 上面也有一条 opacity:.45——但整块变半透明会把原因那一行也一起压淡，
   而那一行恰恰是这时候最该读清的。所以这里改成：名字和副标题压淡，原因保持不淡。 */
.model-switch-menu > button:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--surface-sunken);
}
.model-switch-menu > button:disabled > span,
.model-switch-menu > button:disabled > b,
.model-switch-menu > button:disabled > small { opacity: .45 }
/* 右栏那两个字（「已关闭」/「需会员」）跟第三行同色系，一眼能对上是哪种情况 */
.model-switch-menu > button:disabled > em { color: var(--muted); opacity: .85 }
.model-switch-menu > button[data-state="off"] > em { color: var(--danger) }
.model-switch-menu > button[data-state="locked"] > em { color: var(--tier-gold) }
/* 灰的那一档不该有 hover 反馈：给了就像还能点 */
.model-switch-menu > button:disabled:hover { background: var(--surface-sunken) }

/* smod5 的金色。用 --tier-gold 而不是 --gold——后者在 tokens.css 里是
   `--gold: var(--accent)`，是**绿色**，写错了根本看不出是金的。
   浅色下 --tier-gold 是 #8a6410（暗金，当文字色才够 4.5:1 对比度）；想要"亮金"
   观感只能当背景用，所以左边那块方牌走渐变，配色跟站里 .rank-ss 那枚等级徽章一致。 */
.model-switch-menu > button[data-tone="gold"] > b { color: var(--tier-gold) }
.model-switch-menu > button[data-tone="gold"] > b > .model-rate {
  border-color: color-mix(in srgb, var(--tier-gold) 45%, transparent);
  color: var(--tier-gold);
}
.model-switch-menu > button[data-tone="gold"]:not(:disabled) > span {
  color: #4d3400;
  background: linear-gradient(135deg, #ffe58a, #d89b22);
  box-shadow: inset 0 -2px 0 rgba(117, 76, 0, .28);
}
.model-switch-menu > button[data-tone="gold"].selected {
  background: color-mix(in srgb, var(--tier-gold) 11%, var(--panel));
}
.model-switch-menu > button[data-tone="gold"].selected > em { color: var(--tier-gold) }

/* 收起来的那颗按钮上也认一下金色：挂着 smod5 的时候，不展开也看得出在用哪一档 */
.composer-model-switch[data-tone="gold"] .model-switch-trigger > small {
  color: var(--tier-gold);
  font-weight: 700;
}

/* hmod 4.5：站内主力档用翡翠绿。颜色沿用页面的自然绿，但方牌多一层矿石般的
   明暗变化，选中时只做浅色晕染，不把整张卡涂得太重。 */
.model-switch-menu > button[data-tone="emerald"] > b {
  color: color-mix(in srgb, #27924a 76%, var(--text));
}
.model-switch-menu > button[data-tone="emerald"] > b > .model-rate {
  border-color: color-mix(in srgb, #4aac65 58%, transparent);
  color: color-mix(in srgb, #238342 78%, var(--text));
  background: color-mix(in srgb, #63bd77 9%, transparent);
}
.model-switch-menu > button[data-tone="emerald"]:not(:disabled) > span {
  color: #174f2a;
  background: linear-gradient(145deg, #e8f7e8 0%, #91d394 56%, #4da966 100%);
  box-shadow: inset 0 -2px 0 rgba(25, 91, 46, .22), 0 0 12px rgba(63, 166, 87, .2);
}
.model-switch-menu > button[data-tone="emerald"].selected {
  background: color-mix(in srgb, #4aac65 13%, var(--panel));
  box-shadow: inset 3px 0 0 color-mix(in srgb, #329851 76%, transparent),
              0 0 15px rgba(63, 166, 87, .13);
}
.model-switch-menu > button[data-tone="emerald"].selected > em {
  color: color-mix(in srgb, #238342 82%, var(--text));
}
.composer-model-switch[data-tone="emerald"] .model-switch-trigger > small {
  color: color-mix(in srgb, #238342 78%, var(--text));
  font-weight: 800;
}

/* hmod5：最高 hmod 档用钻石青蓝。标题和方牌都有轻微晶体高光，和 smod 的金、银、
   炫彩保持同一种表达方式，但不抢占整张菜单的视觉重心。 */
.model-switch-menu > button[data-tone="diamond"] > b {
  background: linear-gradient(95deg, #185f88 0%, #2b91a4 48%, #286ca5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(58, 172, 194, .16);
}
.model-switch-menu > button[data-tone="diamond"] > b > .model-rate {
  border-color: color-mix(in srgb, #48b8cb 58%, transparent);
  color: #287f9c;
  background: rgba(71, 185, 204, .09);
}
.model-switch-menu > button[data-tone="diamond"]:not(:disabled) > span {
  color: #0d4a5d;
  background: linear-gradient(145deg, #e3fbfd 0%, #78d5df 54%, #3a9fc4 100%);
  box-shadow: inset 0 -2px 0 rgba(17, 92, 117, .22), 0 0 13px rgba(57, 169, 195, .25);
}
.model-switch-menu > button[data-tone="diamond"].selected {
  background: color-mix(in srgb, #45b4c7 13%, var(--panel));
  box-shadow: inset 3px 0 0 color-mix(in srgb, #328fab 78%, transparent),
              0 0 16px rgba(57, 169, 195, .15);
}
.model-switch-menu > button[data-tone="diamond"].selected > em { color: #287f9c }
.composer-model-switch[data-tone="diamond"] .model-switch-trigger > small {
  background: linear-gradient(90deg, #185f88, #2b91a4, #286ca5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 8px rgba(58, 172, 194, .25);
  font-weight: 800;
}

/* bf-rocket：ds41「急速火箭版」的橙红火箭主题。方牌里画的是 🚀（hx.js 的 TIER_GLYPH），
   底色像喷口的火：亮黄到橙红；标题橙红。单价那枚红/绿分时牌不在这里动——它自己按
   data-window 涂色，红绿本来就是这一档最要紧的信息。选中时方牌里的火箭微微抬头。 */
.model-switch-menu > button[data-tone="rocket"] > b { color: #c2410c }
.model-switch-menu > button[data-tone="rocket"]:not(:disabled) > span {
  color: #4a1500;
  font-size: 19px;
  line-height: 1;
  background: linear-gradient(160deg, #fff3d6 0%, #ffb547 48%, #f4511e 100%);
  box-shadow: inset 0 -2px 0 rgba(160, 60, 0, .26), 0 0 13px rgba(244, 81, 30, .28);
  transition: transform .18s ease;
}
.model-switch-menu > button[data-tone="rocket"]:not(:disabled):hover > span,
.model-switch-menu > button[data-tone="rocket"].selected > span {
  transform: translateY(-2px) rotate(-8deg);
}
.model-switch-menu > button[data-tone="rocket"].selected {
  background: color-mix(in srgb, #f4511e 10%, var(--panel));
  box-shadow: inset 3px 0 0 color-mix(in srgb, #f4511e 80%, transparent),
              0 0 16px rgba(244, 81, 30, .14);
}
.model-switch-menu > button[data-tone="rocket"].selected > em { color: #c2410c }
.composer-model-switch[data-tone="rocket"] .model-switch-trigger > small {
  color: #c2410c;
  font-weight: 800;
}

/* smod 4.2 的银色发光主题。冷银渐变只用于该档位的识别，不改变文字语义；
   深色和浅色背景都保留足够对比，选中时用柔和外发光提示当前档位。 */
.model-switch-menu > button[data-tone="silver"] > b {
  background: linear-gradient(100deg, #596875 0%, #eaf3ff 42%, #8fa2b5 68%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(190, 219, 244, .35);
}
.model-switch-menu > button[data-tone="silver"] > b > .model-rate {
  border-color: color-mix(in srgb, #a9c8e3 65%, transparent);
  color: #7091ac;
  background: rgba(190, 219, 244, .12);
}
.model-switch-menu > button[data-tone="silver"]:not(:disabled) > span {
  color: #344452;
  background: linear-gradient(145deg, #f7fbff, #b8c9d8 58%, #879aab);
  box-shadow: inset 0 -2px 0 rgba(58, 78, 95, .22), 0 0 12px rgba(169, 203, 232, .32);
}
.model-switch-menu > button[data-tone="silver"].selected {
  background: color-mix(in srgb, #a9c8e3 16%, var(--panel));
  box-shadow: 0 0 16px rgba(169, 203, 232, .18);
}
.model-switch-menu > button[data-tone="silver"].selected > em {
  color: #6f91ad;
}
.composer-model-switch[data-tone="silver"] .model-switch-trigger > small {
  color: #7898b3;
  text-shadow: 0 0 8px rgba(169, 203, 232, .45);
  font-weight: 800;
}

/* smod6 的倍率徽标：名称保持简洁，×30 单独用炫彩色提示。颜色使用高对比的
   彩虹渐变，文字仍保留清晰的「单价」说明，不把倍率伪装成免费或等级权益。 */
.model-switch-menu > button[data-tone="rainbow"] > b {
  background: linear-gradient(90deg, #d33b6a 0%, #db7b27 25%, #4b9d5b 50%, #3d74c9 75%, #8954b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.model-switch-menu > button[data-tone="rainbow"] > b > .model-rate {
  border-color: color-mix(in srgb, #6876d8 55%, transparent);
  background: linear-gradient(90deg, #d33b6a, #db7b27, #4b9d5b, #3d74c9, #8954b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.model-switch-menu > button[data-tone="rainbow"]:not(:disabled) > span {
  color: #fff;
  background: linear-gradient(135deg, #d33b6a, #db7b27 28%, #4b9d5b 52%, #3d74c9 76%, #8954b8);
  box-shadow: inset 0 -2px 0 rgba(30, 35, 90, .2);
}
.model-switch-menu > button[data-tone="rainbow"].selected {
  background: color-mix(in srgb, #6876d8 11%, var(--panel));
}
.model-switch-menu > button[data-tone="rainbow"].selected > em {
  color: #6876d8;
}
.composer-model-switch[data-tone="rainbow"] .model-switch-trigger > small {
  background: linear-gradient(90deg, #d33b6a, #db7b27, #4b9d5b, #3d74c9, #8954b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

/* 选单底部那一段说明（2026-08-29）。目前只有上下文长度那个选单用它：
   「选长的会更贵，但没有固定倍数」这句话一行 note 放不下，而塞进条目里会把
   条目撑成三行、挤掉真正要读的门槛提示。 */
.model-switch-menu > .switch-foot {
  margin: 8px 3px 1px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

/* 上下文那颗按钮跟旁边的占用条挨着，中间不要再留一道缝 */
.composer-bottom #ctxSwitch { margin-right: 6px }

/* 上下文这颗按钮上只留一个数字：没有图标、没有「长度」二字。
   simple.css 给 .model-switch-trigger>small 写了「左边一道竖线 + 内边距」，那是
   用来跟前面的标签分隔的；这里没有标签可分隔，竖线要去掉，不然按钮左侧会挂一根
   孤零零的竖线。同理 @media(max-width:600px) 那条会把 small 整个藏掉——对模型和
   智商那两颗只是少显示个副标题，对这一颗等于整个按钮变空，所以要显式放开。 */
#ctxSwitch .model-switch-trigger > small {
  padding-left: 0;
  border-left: 0;
  display: inline !important;
  font-size: 12px;
  font-weight: 800;
}

/* 条目里不摆方牌之后，第一列那 35px 要收掉，否则左边空一大块 */
#ctxSwitch .model-switch-menu > button {
  grid-template-columns: minmax(0, 1fr) auto;
}
#ctxSwitch .model-switch-menu > button > b,
#ctxSwitch .model-switch-menu > button > small,
#ctxSwitch .model-switch-menu > button > u { grid-column: 1 }
#ctxSwitch .model-switch-menu > button > em { grid-column: 2 }

/* 思考深度那一行：并进模型选单之后，工具条上少一颗按钮。做成分段控件，
   三个选项摊开摆着，不用再点进去一层。 */
.model-switch-menu > .switch-effort {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 3px 1px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.model-switch-menu > .switch-effort > span {
  flex: 1;
  color: var(--muted);
  font-size: 10px;
}
.model-switch-menu > .switch-effort > button {
  appearance: none;
  min-width: 34px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.model-switch-menu > .switch-effort > button:hover {
  border-color: var(--green);
  color: var(--green);
}
.model-switch-menu > .switch-effort > button.on {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 13%, var(--panel));
  color: var(--green);
  font-weight: 800;
}

/* ---------------------------------------------- 老工程改 mod 标识
   资产栏里那一行入口只在"标识还是平台默认名"的工程上出现（服务端 renamable 说了
   算）。用户自己起过名的工程不给这个东西看：他没有要解决的冲突，改名只会白毁一次
   存档。 */
.modid-row{display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:10px 12px;
  border:1px solid var(--line);border-radius:12px;background:var(--soft)}
.modid-row>div{flex:1;min-width:0}
.modid-row small{display:block;color:var(--muted);font-size:11px;line-height:1.5}
.modid-row b{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:13px;word-break:break-all}
.modid-row button{border:1px solid var(--line);background:var(--panel);border-radius:9px;
  padding:6px 12px;cursor:pointer;white-space:nowrap;font-size:12px}
.modid-row button:hover{border-color:var(--green);color:var(--green)}
.rename-dialog>section{width:min(580px,100%)}
.rename-field{display:block;margin:0 0 14px}
.rename-field>span{display:block;font-size:12px;color:var(--muted);margin-bottom:5px}
.rename-field input{width:100%;box-sizing:border-box;border:1px solid var(--line);
  border-radius:9px;padding:9px 11px;background:var(--panel);color:var(--text);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}
.rename-field small{display:block;color:var(--muted);font-size:11px;line-height:1.6;
  margin-top:6px}
.rename-warn{border:1px solid var(--line);border-left:3px solid #d9822b;
  border-radius:10px;padding:12px 14px;background:var(--soft);font-size:12px;
  line-height:1.7}
.rename-warn ul{margin:8px 0 8px;padding-left:18px}
.rename-warn li{margin:0 0 7px}
.rename-warn p{margin:8px 0 0;color:var(--muted)}
.rename-ack{display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;font-size:12px;
  line-height:1.6;cursor:pointer}
.rename-ack input{margin-top:2px}
.rename-live{margin:14px 0 0;padding:11px 13px;border:1px solid var(--line);
  border-radius:10px;background:var(--soft);font-size:12px;line-height:1.7;
  white-space:pre-wrap;max-height:220px;overflow:auto}
.rename-live b{display:block;margin-bottom:4px}


/* ------------------------------------------------ 集群滑块
   长在 .model-switch-menu 里面，沿用「思考深度」那一行的骨架（分隔线 +
   左边一个灰标题 + 右边控件），只把分段按钮换成滑块。控件本身不写说明文字：
   要回答的只有「几路、贵几倍」，数字自己答完了。 */
.model-switch-menu > .switch-slide {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 3px 1px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.model-switch-menu > .switch-slide > span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.model-switch-menu > .switch-slide > input[type="range"] {
  flex: 1;
  min-width: 96px;
  accent-color: var(--green);
  cursor: pointer;
}
/* 右边那个读数：数字 + 倍率。等宽字体，拖滑块时不会左右跳。 */
.model-switch-menu > .switch-slide > b {
  min-width: 54px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.model-switch-menu > .switch-slide > b > i {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
}
.model-switch-menu > .switch-slide > b.over { color: var(--warn, #d08700) }
.model-switch-menu > .switch-slide > b.over > i { color: inherit }

/* 够不着的档位：滑块还能拖过去，但下面写一行为什么——直接把滑块截短的话，
   用户根本不知道还有更高的档存在。 */
.model-switch-menu > .switch-note {
  margin: 4px 3px 1px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.model-switch-menu > .switch-note.gate { color: var(--gold, #b8860b) }

/* 集群那颗按钮跟 272k 那颗同样待遇：挨着邻居，中间不留多余的缝。 */
.composer-bottom #crewSwitch { margin-left: 6px }

/* ------------------------------------------- 模型 / 物品 / 配方（工作台）

   输入栏正上方那一排胶囊和它展开的面板。整块都是 .dock 的子节点、留在文档流里：
   展开时对话区变短，但一条消息都不会被盖住。绝对定位试过——盖住的正好是最新
   那几条，那是用户最想看的几条。

   .dock 自己是 grid 且带 gap，所以这里只放一个容器进去（空的时候 hidden，
   直接从网格里消失，不会白占一条 gap）。 */

.hx-bench[hidden] { display: none }
.hx-bench-panel-host:empty { display: none }
.hx-bench { margin: 0 0 6px }
.hx-bench-chips[hidden] { display: none }
/* 四颗收成输入框里一行字，不是灰底整条，也不是浮在外面的子菜单。 */
.composer > .hx-bench-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  width: auto;
  max-width: none;
  gap: 2px 14px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.hx-bench-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: none;
}

.hx-bench-chip b { font-weight: 600 }
.hx-bench-chip small { color: inherit; font-size: 11px; font-variant-numeric: tabular-nums; opacity: .72 }
.hx-bench-chip:hover { color: var(--text); background: transparent }

.hx-bench-chip.on {
  background: transparent;
  color: var(--green);
}
.hx-bench-chip.on small { opacity: .8 }

/* 这一格还没有东西时不消失、也不装作能点：位置钉住，产物一出现就自己亮起来 */
.hx-bench-chip[disabled] { opacity: .38; cursor: default }
.hx-bench-chip[disabled]:hover { border-color: var(--line) }

.hx-bench-panel {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  overflow: hidden;
  animation: hx-bench-in .18s ease;
}

@keyframes hx-bench-in {
  from { opacity: 0; transform: translateY(6px) }
  to { opacity: 1; transform: none }
}

.hx-bench-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 13px;
  border-bottom: 1px solid var(--line);
}
.hx-bench-head > b { font-size: 13px; font-weight: 600 }
.hx-bench-head > small { color: var(--text-muted); font-size: 12px }
.hx-bench-head .grow { flex: 1 }
.hx-bench-tabs { display: flex; gap: 2px }

.hx-bench-tab {
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.hx-bench-tab.on { border-color: var(--line); color: var(--text); background: var(--bg) }

.hx-bench-close {
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.hx-bench-close:hover { background: var(--bg); color: var(--text) }

.hx-bench-body { max-height: 292px; overflow: auto; padding: 11px 13px 13px }

.hx-bench-empty {
  margin: 0;
  padding: 30px 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
}

/* --------------------------------------------------------------- 背包网格 */

.hx-inv {
  display: grid;
  grid-template-columns: repeat(auto-fill, 42px);
  gap: 4px;
  justify-content: start;
}

/* 原版背包那种内凹格子：靠 inset 阴影压出层次，深浅两套主题都跟着底色走 */
.hx-slot {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
  box-shadow: inset 1px 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
  cursor: default;
}
.hx-slot img { width: 32px; height: 32px; image-rendering: pixelated }
.hx-slot.has-recipe { cursor: pointer }
.hx-slot:hover { border-color: color-mix(in srgb, var(--green) 55%, var(--line)) }

/* 这一条已经注册了，但工程里还没写出它的贴图（生物尤其常见）。原版那张紫黑棋盘
   在游戏里合适，一屏摆二十几个就只剩噪音，所以压成一层很淡的斜纹：看得出是
   "还没有图"，又不抢真有图的那些格子。 */
.hx-slot.blank::after,
.hx-craft-grid div.blank::after,
.hx-recipe-index button.blank::after {
  content: "";
  width: 66%;
  height: 66%;
  border-radius: 3px;
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--text) 13%, transparent) 0 3px,
    transparent 3px 6px);
}

/* ------------------------------------------------------ 物品信息（游戏内那种） */

.hx-tip {
  position: fixed;
  z-index: 60;
  max-width: 268px;
  padding: 5px 7px;
  border: 2px solid transparent;
  border-radius: 3px;
  background:
    linear-gradient(#100010f2, #100010f2) padding-box,
    linear-gradient(#2b0b5e, #5028b4 50%, #2b0b5e) border-box;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: none;
}
.hx-tip b { display: block; font-weight: 400 }
.hx-tip .tip-id { color: #575757; font-size: 11.5px; word-break: break-all }
.hx-tip .tip-lore { color: #a8a8a8 }
.hx-tip .tip-meta { margin-top: 3px; color: #6a6aff; font-size: 11.5px }

/* -------------------------------------------------------------- 合成配方 */

.hx-recipe { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 12px }

.hx-recipe-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  gap: 3px;
  align-content: start;
  max-height: 244px;
  overflow: auto;
}
.hx-recipe-index button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
  cursor: pointer;
}
.hx-recipe-index button.on {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 13%, var(--bg));
}
.hx-recipe-index img { width: 26px; height: 26px; image-rendering: pixelated }

.hx-craft { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 }
.hx-craft-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 3px }
.hx-craft-grid div {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
}
.hx-craft-grid div.empty { background: transparent; border-style: dashed; opacity: .45 }
.hx-craft-grid img { width: 30px; height: 30px; image-rendering: pixelated }
.hx-craft-tag { color: var(--text-muted); font-size: 15px }
.hx-craft-arrow { color: var(--text-muted); font-size: 17px }

.hx-craft-out {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--green) 8%, var(--bg));
}
.hx-craft-out img { width: 38px; height: 38px; image-rendering: pixelated }

.hx-craft-name { display: grid; gap: 2px; min-width: 0 }
.hx-craft-name b { font-size: 13px; font-weight: 600 }
.hx-craft-name small { color: var(--text-muted); font-size: 12px }
.hx-recipe-source { margin: 8px 0 0; color: var(--text-muted); font-size: 11.5px }

/* ------------------------------------------------------------------ 窄屏

   mobile.css 里那颗 .m-assets 胶囊是 `position:absolute; bottom:100%`，量的是
   .dock 的上沿——多了这一块之后它跟着往上走，两者不会撞。剩下的就是别让面板
   把输入框顶出屏幕：高度按视口给，超了自己滚。 */

@media (max-width: 760px) {
  .hx-bench-chips { padding: 0; gap: 2px 12px }
  .hx-bench-chip { padding: 0 }
  .hx-bench-body { max-height: min(38vh, 240px); padding: 9px 10px 11px }
  .hx-recipe { grid-template-columns: minmax(0, 1fr); gap: 9px }
  .hx-recipe-index { max-height: 76px }
  .hx-craft { gap: 10px }
  .hx-tip { max-width: min(268px, calc(100vw - 24px)) }
}

/* ------------------------------------------- 第二批：九宫格看得出是九格 + 立体图标

   原来空位是虚线 + 半透明，浅色底下几乎看不见：五个材料浮在那儿，不像工作台，
   用户报的「合成有问题不是九格」就是这么来的。现在空位跟实位长一个样，只是里面
   没东西，外面再套一圈框——跟游戏里那张工作台界面对上。 */

.hx-craft-grid {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--text) 3%, var(--panel));
}

.hx-craft-grid div.empty {
  border-style: solid;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
  opacity: 1;
}

/* 立体图标是渲出来导成的 PNG（72px 缩到 32px），按像素放大会糊成锯齿，
   这一类不要 pixelated；平面贴图那一类还是要，不然 16×16 会被抹平。 */
.hx-slot img.is-3d,
.hx-craft-grid img.is-3d,
.hx-recipe-index img.is-3d,
.hx-craft-out img.is-3d { image-rendering: auto }

.hx-slot img.is-3d { width: 36px; height: 36px }
.hx-craft-grid img.is-3d { width: 34px; height: 34px }
.hx-recipe-index img.is-3d { width: 30px; height: 30px }
.hx-craft-out img.is-3d { width: 42px; height: 42px }

/* ------------------------------------------ 配方：熔炉/锻造台那几种画法的槽位

   九宫格之外还有三种形态（烧炼、锻造、加工），它们是一排槽而不是一张网格。
   槽的长相跟九宫格里那些一样，只是底下多一行小字写它在游戏里叫什么位置。 */

.hx-craft-row { display: flex; align-items: flex-start; gap: 6px }
.hx-craft-in { display: grid; justify-items: center; gap: 3px }
.hx-craft-in small { color: var(--text-muted); font-size: 11px; line-height: 1.2 }

.hx-craft-row .hx-cell {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
}
.hx-craft-row .hx-cell img { width: 30px; height: 30px; image-rendering: pixelated }
.hx-craft-row .hx-cell img.is-3d { width: 34px; height: 34px; image-rendering: auto }
.hx-craft-row .hx-cell.empty { border-style: dashed; opacity: .45 }

.hx-craft-note { color: var(--text-muted); font-size: 12px; line-height: 1.45 }

/* 模组自己定义的配方类型，原样写出来 */
.hx-craft-type {
  margin-top: 2px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  justify-self: start;
  word-break: break-all;
}

/* ---------------------------------------------------------- 消息一键复制

   高度为 0：按钮落在两条消息之间那 18px 的空当里（.message 的 margin-bottom），
   不占布局、不挤正文。不悬停时 pointer-events 关着，框选整段文字不会被它截住。

   淡出留 200ms 再走，跟站里别处的悬停节奏一致；淡入不留延迟——一颗按钮等三分之一
   秒才出来，读起来是卡顿不是克制。 */

.hx-msg-tools {
  height: 0;
  position: relative;
  top: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity .14s ease .2s;
}

/* 用户那条是有底色的气泡，按钮往下让一点，落在气泡外面而不是压在它边上 */
.message.user .hx-msg-tools { justify-content: flex-end; top: 5px; margin: 0 -4px }
/* 助手那条是整幅的纯文本，按钮贴着正文起始的那一边 */
.message.assistant .hx-msg-tools { justify-content: flex-start }

.message:hover > .hx-msg-tools,
.message.tools-on > .hx-msg-tools {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.hx-msg-copy {
  width: 24px;
  /* 18 而不是 20：两条消息之间只有 18px 的空当，按钮再高一点，
     底边离下一条第一行的字就只剩 1px 了 */
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
}

.hx-msg-copy svg { width: 13px; height: 13px; display: block }
.hx-msg-copy:hover {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  color: var(--green);
}
.hx-msg-copy:active { transform: translateY(1px) }

/* 窄屏：没有 hover，按钮靠点一下气泡叫出来，手指点得到才行 */
@media (max-width: 760px) {
  .hx-msg-copy { width: 32px; height: 26px }
  .hx-msg-copy svg { width: 15px; height: 15px }
  .message.user .hx-msg-tools { top: 8px }
}

/* ------------------------------------------------ 工作台第三、四页：模型监视器 / 说明书

   原来顶栏那颗「预览模式」跳去的整页，收进输入框上面这块面板里。监视器左边是模型
   清单、右边是真的 WebGL 舞台（BlockForgeViewer.render，拖动旋转、滚轮缩放、有动画
   的带播放条）；说明书是有什么 / 怎么玩 / 怎么装三段。 */

.hx-bench-body.hx-monitor { max-height: none; padding: 8px }
.hx-monitor { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 8px }
.hx-monitor-list {
  display: grid;
  gap: 4px;
  align-content: start;
  max-height: 272px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.hx-monitor-tile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.hx-monitor-tile:hover { border-color: color-mix(in srgb, var(--green) 55%, var(--line)) }
.hx-monitor-tile.on { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--panel)) }
.hx-monitor-tile b, .hx-monitor-tile small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hx-monitor-tile b { font-size: 12px; font-weight: 600 }
.hx-monitor-tile small { color: var(--text-muted); font-size: 10.5px }
.hx-monitor-thumb {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 5px; background: color-mix(in srgb, var(--text) 5%, var(--bg));
}
.hx-monitor-thumb img { width: 28px; height: 28px; image-rendering: pixelated }
.hx-monitor-thumb .mc-ico { width: 24px; height: 24px }

.hx-monitor-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 272px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--stage);
  background-image:
    linear-gradient(var(--stage-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}
.hx-monitor-canvas { position: relative; min-height: 232px }
.hx-monitor-canvas canvas { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important }
.hx-monitor-canvas iframe.bb-preview-frame, .hx-monitor-canvas iframe.bb-ai-frame { position: absolute; inset: 0 }
.hx-monitor-flat {
  position: absolute; inset: 0; margin: auto; width: 56%; height: 56%;
  object-fit: contain; image-rendering: pixelated;
}
.hx-monitor-note {
  position: absolute; left: 10px; bottom: 8px; margin: 0;
  padding: 2px 7px; border-radius: 5px;
  background: color-mix(in srgb, var(--stage) 70%, transparent);
  color: var(--stage-text); font-size: 11.5px; pointer-events: none;
}
.hx-monitor-stage:has(.hx-monitor-bar:not([hidden])) .hx-monitor-note { bottom: 46px }
.hx-monitor-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-top: 1px solid var(--line); background: var(--panel);
}
.hx-monitor-bar input[type="range"] { flex: 1; min-width: 60px; accent-color: var(--green) }
.hx-monitor-bar small { color: var(--text-muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums }
.hx-monitor-bar select { max-width: 130px; font-size: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text) }

.hx-bench-body.hx-guide { max-height: 360px }
.hx-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px }
.hx-guide h4 { margin: 0 0 6px; font-size: 13px }
.hx-guide p, .hx-guide li { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.6 }
.hx-guide ol { margin: 0; padding-left: 18px; display: grid; gap: 4px }
.hx-guide-names { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px !important }
.hx-guide-names > span { color: var(--text-muted); font-size: 11.5px; align-self: center }
.hx-guide-chip {
  padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); font-size: 11.5px; cursor: pointer;
}
.hx-guide-chip:hover { border-color: var(--green); color: var(--green) }
.hx-guide-link { color: var(--green); font-weight: 600 }

@media (max-width: 760px) {
  .hx-monitor { grid-template-columns: 1fr }
  .hx-monitor-list {
    grid-auto-flow: column; grid-auto-columns: 156px; max-height: none;
    overflow-x: auto; overflow-y: hidden; padding-bottom: 3px;
  }
  .hx-monitor-stage { min-height: 220px }
  .hx-monitor-canvas { min-height: 180px }
  .hx-bench-body.hx-monitor, .hx-bench-body.hx-guide { max-height: min(60vh, 420px) }
}

/* ------------------------------------------------------------------ 站内问卷
   一题一屏的全屏问卷。结构在 chat.html，逻辑在 hx.js 尾部的 quiz*。

   z-index 12500 压过新手引导那层 12000：引导要是没收干净，问卷不该被埋在底下
   点不着。颜色一律走 token（--green/--panel/--line/--muted），六种明暗×皮肤
   组合都得能看——写死一个绿会在 pixel 皮肤和深色下同时翻车。*/
.hx-survey[hidden] { display: none }

.hx-survey {
  position: fixed;
  inset: 0;
  z-index: 12500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 10, 13, .74);
  -webkit-backdrop-filter: blur(14px) saturate(.85);
  backdrop-filter: blur(14px) saturate(.85);
  opacity: 0;
  transition: opacity .28s ease;
}

.hx-survey.is-open { opacity: 1 }
body.hx-survey-lock { overflow: hidden }

/* 背后三坨慢慢飘的彩光。纯装饰，pointer-events 关掉免得挡点击。 */
.hx-survey-aura {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hx-survey-aura i {
  position: absolute;
  width: 46vmin;
  height: 46vmin;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  animation: hx-survey-drift 17s ease-in-out infinite;
}

.hx-survey-aura i:nth-child(1) { top: -12%; left: -6%; background: #4fbf3a }
.hx-survey-aura i:nth-child(2) { right: -10%; bottom: -14%; background: #3f7fd6; animation-delay: -6s }
.hx-survey-aura i:nth-child(3) { top: 34%; left: 52%; background: #d6a13f; animation-delay: -11s; opacity: .34 }

@keyframes hx-survey-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1) }
  33% { transform: translate3d(5vmin, -4vmin, 0) scale(1.12) }
  66% { transform: translate3d(-4vmin, 5vmin, 0) scale(.93) }
}

.hx-survey-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(640px, 94vw);
  max-height: min(88vh, 780px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 34px 110px rgba(0, 0, 0, .46);
  transform: translateY(14px) scale(.975);
  opacity: 0;
  transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
}

.hx-survey.is-open .hx-survey-card { transform: none; opacity: 1 }

/* 顶上那道彩条，整张卡的调子由它定 */
.hx-survey-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), #6fc8e8 46%, var(--tier-gold));
}

.hx-survey-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.hx-survey-close:hover {
  background: color-mix(in srgb, var(--text) 9%, transparent);
  color: var(--text);
  transform: rotate(90deg);
}

.hx-survey-quiz { display: flex; flex-direction: column; min-height: 0 }
.hx-survey-quiz[hidden] { display: none }

.hx-survey-head {
  flex: none;
  padding: 22px 26px 14px;
  background: linear-gradient(color-mix(in srgb, var(--green) 7%, var(--panel)), var(--panel));
}

.hx-survey-gift {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border: 1px solid color-mix(in srgb, var(--tier-gold) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tier-gold) 13%, var(--panel));
  color: var(--tier-gold);
  font-size: 11.5px;
  font-weight: 700;
}

.hx-survey-gift em { font-style: normal; font-size: 14px; font-variant-numeric: tabular-nums }
.hx-survey-head h2 { margin: 9px 0 6px; font-size: 22px; letter-spacing: .01em }
.hx-survey-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65 }

.hx-survey-rail {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px 14px;
}

.hx-survey-track {
  position: relative;
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
}

.hx-survey-track > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #7ad45c);
  transition: width .42s cubic-bezier(.2, .8, .2, 1);
}

/* 填充条上来回扫的一道高光，进度不动的时候也有活气 */
.hx-survey-track > i::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: hx-survey-sweep 2.4s cubic-bezier(.5, 0, .5, 1) infinite;
}

@keyframes hx-survey-sweep {
  from { transform: translateX(-120%) }
  to { transform: translateX(340%) }
}

.hx-survey-rail small {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.hx-survey-body {
  flex: 1;
  min-height: 0;
  padding: 4px 26px 6px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* 翻页时整块推一下。方向靠 hx.js 加的 is-next / is-back 决定。 */
.hx-survey-body.is-next .hx-survey-q { animation: hx-survey-slide-next .3s cubic-bezier(.2, .8, .2, 1) }
.hx-survey-body.is-back .hx-survey-q { animation: hx-survey-slide-back .3s cubic-bezier(.2, .8, .2, 1) }

@keyframes hx-survey-slide-next {
  from { opacity: 0; transform: translateX(26px) }
  to { opacity: 1; transform: none }
}

@keyframes hx-survey-slide-back {
  from { opacity: 0; transform: translateX(-26px) }
  to { opacity: 1; transform: none }
}

.hx-survey-q h3 {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.hx-survey-hint {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hx-survey-opts {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.hx-survey-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  /* --i 是选项序号，让它们一个接一个落下来而不是整块闪出来 */
  animation: hx-survey-opt-in .34s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 38ms);
  transition: border-color .15s ease, background .15s ease, transform .15s ease,
              box-shadow .15s ease;
}

@keyframes hx-survey-opt-in {
  from { opacity: 0; transform: translateY(9px) }
  to { opacity: 1; transform: none }
}

.hx-survey-opt:hover {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--green) 70%, transparent);
}

.hx-survey-opt:active { transform: translateY(0) }

.hx-survey-opt.on {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 13%, var(--panel));
  box-shadow: inset 3px 0 var(--green);
  font-weight: 600;
}

/* 左边那个勾选圈：没选是空心，选中填绿并画一个勾 */
.hx-survey-tick {
  position: relative;
  flex: none;
  width: 17px;
  height: 17px;
  border: 2px solid color-mix(in srgb, var(--muted) 52%, transparent);
  border-radius: 50%;
  transition: border-color .15s ease, background .15s ease;
}

.hx-survey-opt.on .hx-survey-tick { border-color: var(--green); background: var(--green) }

.hx-survey-tick::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.4);
  transition: opacity .15s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}

.hx-survey-opt.on .hx-survey-tick::after { opacity: 1; transform: rotate(45deg) scale(1) }

.hx-survey-other { margin-top: 8px }

.hx-survey-other input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  animation: hx-survey-opt-in .26s ease both;
}

.hx-survey-other input:focus { border-color: var(--green) }

.hx-survey-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.65 inherit;
}

.hx-survey-text:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* 1-5 评分。两端是「很差 / 很好」，中间五个方块。 */
.hx-survey-scale {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
}

.hx-survey-scale > small { flex: none; color: var(--muted); font-size: 11.5px }
.hx-survey-nums { display: flex; flex: 1; gap: 7px }

.hx-survey-num {
  flex: 1;
  justify-content: center;
  padding: 15px 0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hx-survey-num.on { transform: translateY(-3px) scale(1.05) }

.hx-survey-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px 20px;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.hx-survey-dots { display: flex; gap: 5px }

.hx-survey-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 38%, transparent);
  transition: width .24s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}

.hx-survey-dots i.did { background: color-mix(in srgb, var(--green) 62%, transparent) }
.hx-survey-dots i.on { width: 18px; border-radius: 3px; background: var(--green) }

.hx-survey-ghost {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.hx-survey-ghost:hover { border-color: var(--muted); color: var(--text) }
.hx-survey-ghost[hidden] { display: none }
.hx-survey-foot .primary:disabled { filter: grayscale(.6); opacity: .45; cursor: not-allowed }

/* 点了右上角 × 之后从卡片底下升起来的挽留条 */
.hx-survey-bye[hidden] { display: none }

.hx-survey-bye {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -18px 40px -18px rgba(0, 0, 0, .4);
  animation: hx-survey-rise .26s cubic-bezier(.2, .8, .2, 1);
}

@keyframes hx-survey-rise {
  from { opacity: 0; transform: translateY(100%) }
  to { opacity: 1; transform: none }
}

.hx-survey-bye p { margin: 0 0 13px; font-size: 13.5px; line-height: 1.65 }
.hx-survey-bye b { color: var(--tier-gold) }
.hx-survey-bye > div { display: flex; justify-content: flex-end; gap: 9px }

/* 交完卷那一屏 */
.hx-survey-done[hidden] { display: none }

.hx-survey-done {
  position: relative;
  padding: 44px 30px 34px;
  text-align: center;
  animation: hx-survey-opt-in .34s cubic-bezier(.2, .8, .2, 1);
}

.hx-survey-coin {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%,
              color-mix(in srgb, var(--tier-gold) 34%, var(--panel)),
              color-mix(in srgb, var(--tier-gold) 15%, var(--panel)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier-gold) 40%, transparent),
              0 0 40px -6px color-mix(in srgb, var(--tier-gold) 55%, transparent);
  font-size: 34px;
  animation: hx-survey-bob 2.6s ease-in-out infinite;
}

@keyframes hx-survey-bob {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-7px) }
}

.hx-survey-done h2 { margin: 0 0 8px; font-size: 21px }

.hx-survey-gain {
  margin: 0;
  color: var(--green);
  font-size: 27px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hx-survey-gain b { font-size: 34px }

.hx-survey-balance {
  min-height: 19px;
  margin: 7px 0 22px;
  color: var(--muted);
  font-size: 12.5px;
}

/* 撒花。粒子由 hx.js 生成，落点和旋转写在每个 i 的 --x/--y/--r/--d 上。 */
.hx-survey-burst {
  position: absolute;
  top: 60px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.hx-survey-burst i {
  position: absolute;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  opacity: 0;
  animation: hx-survey-bit 1.35s cubic-bezier(.16, .7, .32, 1) var(--d, 0ms) forwards;
}

@keyframes hx-survey-bit {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) }
  /* 先炸开，再落下去一点，像真纸片 */
  55% { opacity: 1 }
  100% { opacity: 0; transform: translate3d(var(--x, 0), calc(var(--y, 0px) + 230px), 0) rotate(var(--r, 0)) }
}

@media (max-width: 760px) {
  .hx-survey { padding: 0; place-items: end stretch }
  .hx-survey-card {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
  }
  .hx-survey-head { padding: 20px 18px 12px }
  .hx-survey-head h2 { font-size: 19px }
  .hx-survey-rail { padding: 0 18px 12px }
  .hx-survey-body { padding: 4px 18px 6px }
  .hx-survey-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px)) }
  .hx-survey-foot button { min-height: 44px }
  .hx-survey-opt { padding: 13px }
  .hx-survey-num { padding: 13px 0 }
  /* 竖屏太窄，「很差/很好」压到数字底下去 */
  .hx-survey-scale { flex-wrap: wrap; justify-content: space-between }
  .hx-survey-nums { flex-basis: 100%; order: -1 }
  .hx-survey-done { padding: 34px 20px 26px }
}

@media (prefers-reduced-motion: reduce) {
  .hx-survey, .hx-survey-card, .hx-survey-aura i, .hx-survey-opt, .hx-survey-coin,
  .hx-survey-burst i, .hx-survey-bye, .hx-survey-done, .hx-survey-track > i::after,
  .hx-survey-body.is-next .hx-survey-q, .hx-survey-body.is-back .hx-survey-q {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .hx-survey-burst { display: none }
}

/* Name-update badge only; independent of rate, lock and queue badges. */
.model-switch .model-new,
.model-switch-current .model-new,
.model-switch-menu .model-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid #87b798;
  border-radius: 4px;
  background: #e2f4e7;
  color: #236038;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  vertical-align: middle;
}

/* Compact model picker only: context/crew menus keep their existing layout. */
#modelSwitch .model-picker-compact {
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  min-width: 0;
  padding: 8px;
  max-height: min(65dvh, 510px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 12px;
}
#modelSwitch .model-picker-compact > header { padding: 6px 8px 10px; margin: 0; }
#modelSwitch .model-picker-compact > header b { font-size: 14px; }
#modelSwitch .model-picker-compact > header small { font-size: 11px; }
#modelSwitch .model-picker-compact > .model-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 9px;
  width: 100%;
  min-height: 54px;
  margin: 0 0 2px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  background: transparent;
}
#modelSwitch .model-picker-compact > .model-option[hidden] { display: none !important; }
#modelSwitch .model-picker-compact > .model-option > span {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 28px; height: 28px;
  min-width: 0;
  font-size: 15px;
  border-radius: 7px;
  box-shadow: none;
  opacity: .85;
}
#modelSwitch .model-picker-compact > .model-option > .switch-icon img { width: 23px; height: 23px; }
#modelSwitch .model-picker-compact > .model-option > b {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  white-space: normal;
  text-shadow: none;
  background: none;
  -webkit-text-fill-color: currentColor;
}
#modelSwitch .model-picker-compact > .model-option > b > .model-rate {
  display: inline-block;
  padding: 0 4px;
  font-size: 10px;
  line-height: 15px;
  margin-left: 5px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
#modelSwitch .model-picker-compact > .model-option > .model-note {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
  color: var(--muted);
}
#modelSwitch .model-picker-compact > .model-option > em {
  grid-column: 3;
  grid-row: 1 / 3;
  font-size: 11px;
  min-width: 12px;
}
#modelSwitch .model-picker-compact > .model-option > u { grid-column: 2 / 4; font-size: 10px; line-height: 1.4; }
#modelSwitch .model-picker-compact > .model-option.selected {
  background: var(--surface-sunken);
  box-shadow: inset 2px 0 var(--accent, #367b2a);
}
#modelSwitch .model-picker-compact > .model-option.selected > em { color: var(--accent, #367b2a); font-size: 15px; }
#modelSwitch .model-picker-compact > .model-option:not(:disabled):hover { background: var(--surface-sunken); }
#modelSwitch .model-picker-compact > .model-more {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 7px 8px;
  margin: 3px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}
#modelSwitch .model-picker-compact > .switch-effort {
  position: sticky;
  bottom: -8px;
  z-index: 1;
  background: var(--surface, #fff);
  margin-top: 6px;
  padding: 8px;
  gap: 6px;
}
#modelSwitch .model-picker-compact > .switch-effort > span { font-size: 11px; }
#modelSwitch .model-picker-compact > .switch-effort > button { padding: 3px 9px; min-height: 28px; font-size: 12px; }

/* GPT-6 fast is visually blue; pricing and execution use hm5 unchanged. */
#modelSwitch .model-picker-compact > .model-option[data-tone="blue"] > span {
  color: #164a92;
  background: linear-gradient(145deg, #dcecff, #84b7ee);
}
#modelSwitch .model-picker-compact > .model-option[data-tone="blue"] > b { color: #2469ad; }
#modelSwitch .model-picker-compact > .model-option[data-tone="blue"] > b > .model-rate {
  color: #2469ad; border-color: #8ab9e0; background: #ecf5ff;
}
#modelSwitch[data-tone="blue"] .model-switch-current { color: #2469ad; }
html[data-theme="dark"] #modelSwitch .model-picker-compact > .model-option[data-tone="blue"] > b,
html[data-theme="dark"] #modelSwitch[data-tone="blue"] .model-switch-current { color: #8dc5ff; }
