/* 第 12 轮 · 乙：主控输入框、主控底部条与右侧栏、创作页、分模页。
   只用甲在 r12-system.css 里登记的变量与类；本文件只出 r12m- 新类名。 */
/* ds-5850 全站细节补丁；@import 必须在所有规则之前，不涉及 @layer 名。 */
@import url("./r12-global-details.css");

/* 四稿令牌：:where() 零权重，甲随后在 r12-system.css 里给出同名变量时自动覆盖。 */
:where(:root[data-g20271-chulian]) {
  --r12-accent: #6AA4FF;
  --r12m-master-bg: rgba(46, 46, 54, .68);
  --r12m-master-line: rgba(255, 255, 255, .14);
  --r12m-master-placeholder: rgba(255, 255, 255, .60);
  --r12m-master-tool: rgba(255, 255, 255, .85);
  --r12m-master-blur: saturate(1.6) blur(24px);
  --r12m-user-bubble: #2B2B33;
  --r12m-send-bg: #ffffff;
  --r12m-send-ink: #0b0b0d;
}

:where(:root[data-g20271-chulian][data-mode='light']) {
  --r12-accent: #2F6FEB;
  --r12m-master-bg: rgba(255, 255, 255, .78);
  --r12m-master-line: rgba(0, 0, 0, .10);
  --r12m-master-placeholder: rgba(17, 17, 26, .60);
  --r12m-master-tool: rgba(17, 17, 26, .85);
  --r12m-master-blur: saturate(1.6) blur(24px);
  --r12m-user-bubble: #EEEEF2;
  --r12m-send-bg: #17171a;
  --r12m-send-ink: #ffffff;
}

/* ── 1. 输入框 ───────────────────────────────────────────────── */

/* 四稿 1–2：底色比画面亮一档、毛玻璃、一圈光晕；没有附件时总高 ≤ 112。 */
.r12-composer {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--r12m-master-line);
  border-radius: var(--r12-r-composer);
  background: var(--r12m-master-bg);
  -webkit-backdrop-filter: var(--r12m-master-blur);
  backdrop-filter: var(--r12m-master-blur);
  /* 十稿：外框只留 border 这一层；原来的 0 0 0 1px 阴影圈会和边框叠成双重外框。 */
  box-shadow:
    0 12px 40px rgba(0, 0, 0, .45),
    0 0 40px -8px color-mix(in srgb, var(--r12-brand) 16%, transparent);
  transition: border-color var(--r12-dur-2) var(--r12-ease);
  overflow: hidden;
}

.r12-composer *,
.r12-composer *::before,
.r12-composer *::after { box-sizing: border-box; }

/* 1106：复合主控里所有可编辑文字层统一透明、无边界、无第二圈焦点框。
   只保留浏览器原生竖线 caret；不再有任何圆形 caret/拖放点装饰。 */
.r12-composer .r12m-input,
.r12-composer .r12m-input-wrap [contenteditable],
.r12m-dock .r12m-dock-input,
.r12m-dock [contenteditable] {
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  caret-color: var(--r12-ink);
}

/* 八稿 55（0.7）：三层竖向——附件区、输入区占满剩余高度、按钮行贴底。 */
.r12m-input-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.r12m-input { flex: 1; }
.r12m-toolbar { margin-top: auto; flex: none; }
/* 九稿二轮 0.13：文字区最多 6 行（底部条 3 行），外框不出滚动条。 */
.r12m-chat .r12m-input, .r12m-side .r12m-input, .r12m-pro-composer .r12m-input { max-height: 132px; }
.r12m-input { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.r12m-input:hover, .r12m-input:focus { scrollbar-color: var(--r12-line-strong) transparent; }
.r12m-input::-webkit-scrollbar { width: 4px; }
.r12m-input::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.r12m-input:hover::-webkit-scrollbar-thumb, .r12m-input:focus::-webkit-scrollbar-thumb { background: var(--r12-line-strong); }

/* 四稿 1：输入框焦点用蓝色强调（--r12-accent 只用在这里和模式按钮上）。 */
.r12-composer:focus-within { border-color: var(--r12-accent); }

.r12m-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.r12m-body.is-top {
  flex-direction: column;
  gap: 6px;
}

.r12m-plus {
  min-width: 0;
  min-height: 0;
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  border: 1px dashed var(--r12-line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--r12-muted);
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease), border-color var(--r12-dur-2) var(--r12-ease);
}

.r12m-plus svg { width: 20px; height: 20px; }
.r12m-plus:hover { background: var(--r12-hover); border-color: var(--r12-selected-border); color: var(--r12-ink); }
.r12m-plus:active { transform: scale(.99); }

.r12m-plus.is-sm {
  width: 40px;
  height: 40px;
  border-style: solid;
  border-color: var(--r12-line);
}

.r12m-plus.is-sm svg { width: 18px; height: 18px; }

.r12m-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.r12m-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.r12m-attach {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: none;
}
.r12m-attach-row {
  flex: 0 0 100%;
  order: -1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
}
.r12m-attach-meta {
  flex: none;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-top: 5px;
  color: var(--r12-muted);
  font-size: 12px;
  line-height: 18px;
}
.r12m-attach-ref { white-space: nowrap; }

/* 四稿 8：悬停 300ms 后的放大预览，最大 320×320，圆角 12。 */
.r12m-preview {
  position: absolute;
  bottom: calc(100% + 6px);
  z-index: 5;
  max-width: 320px;
  max-height: 320px;
  padding: 4px;
  border: 1px solid var(--r12-line-strong);
  border-radius: 12px;
  background: var(--r12-pop-bg);
  box-shadow: var(--r12-shadow-pop);
  pointer-events: none;
}

.r12m-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 312px;
  max-height: 312px;
  object-fit: contain;
  border-radius: 8px;
}

.r12m-file-icon { display: inline-flex; align-items: center; color: var(--r12-muted); }
.r12m-file-icon svg { width: 14px; height: 14px; }

/* 四稿 8：图片附件是 40×40 缩略图。 */
.r12m-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
}

.r12m-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--r12-line);
}

.r12m-thumb-x {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 0;
  min-height: 0;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: var(--r12-ink);
  color: var(--r12-bg);
  opacity: 0;
  transition: opacity var(--r12-dur-2) var(--r12-ease);
}

.r12m-thumb-x svg { width: 10px; height: 10px; }
.r12m-thumb:hover .r12m-thumb-x,
.r12m-thumb:focus-within .r12m-thumb-x { opacity: 1; }

.r12-composer[data-narrow='1'] .r12m-thumb,
.r12-composer[data-narrow='1'] .r12m-thumb img { width: 40px; height: 40px; }

.r12m-chip {
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 8px;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.r12m-chip > svg { width: 14px; height: 14px; flex: none; }

.r12m-chip-x {
  min-width: 0;
  min-height: 0;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: transparent;
  color: var(--r12-muted);
}

.r12m-chip-x svg { width: 10px; height: 10px; }
.r12m-chip-x:hover { background: var(--r12-hover); color: var(--r12-ink); }

/* 1106 输入框根治：textarea 只承载文字，不画第二层输入框。
   border / outline / box-shadow / 背景 / 圆角全部归零；可见边界只由外层
   .r12-composer（或 .r12m-dock）提供。caret 固定为墨色竖线，不用强调蓝。 */
.r12m-input {
  width: 100%;
  display: block;
  min-height: 44px;
  max-height: 176px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  caret-color: var(--r12-ink);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 22px;
}

.r12-composer[data-narrow='1'] .r12m-input { min-height: 44px; font-size: 13px; line-height: 22px; }

/* 四稿 1：占位文字提亮到 60% 白（深色）。 */
.r12m-input::placeholder { color: var(--r12m-master-placeholder); }
.r12m-input:focus,
.r12m-input:focus-visible { outline: none; box-shadow: none; }

/* ── 2. 工具条与发送键 ───────────────────────────────────────── */

.r12m-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.r12m-tools {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  position: relative;
}

/* 四稿 4：放不下时最右边的参数项收进「更多」。
   1106 第三轮：宽主控只收媒体参数；右栏精简主控只收“详情”，＋/@/技能/模型始终直出。 */
.r12m-tools.is-overflow .r12m-param { display: none; }
.r12m-tools[data-tools-layer='narrow'].is-overflow .r12m-details-tool { display: none; }
.r12m-tools .r12m-tool[hidden],
.r12m-more[hidden] { display: none; }

/* 1106 工具条修复：真实溢出时“更多”固定在工具条右端，不随溢出一起被裁掉。
   被收起项让出的宽度由尾部占位保留，使工具条仍按收起前的自然宽度报告溢出。 */
.r12m-tools.is-overflow .r12m-more {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  background: var(--r12m-master-bg);
}
.r12m-more-rail { display: none; flex: none; width: 0; height: 0; }
.r12m-tools.is-overflow .r12m-more-rail { display: block; }

/* 空间偏紧的宽主控：收紧留白、收起装饰箭头，让模式/媒体参数/模型/详情/执行权限尽量同排。 */
.r12m-tools.is-tight { gap: 0; }
.r12m-tools.is-tight .r12m-tool { padding: 0 4px; font-size: 11px; }
.r12m-tools.is-tight .r12m-tool.is-icon { padding: 0; }
.r12m-tools.is-tight .r12m-chev { display: none; }
.r12m-tools.is-tight .r12m-more .r12m-more-label { display: none; }

.r12m-actions {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 四稿 4：高 30、圆角 8、左右内边距 8、项间距 2；悬停才出底色；文字一律完整显示。 */
.r12m-tool {
  min-width: 0;
  min-height: 0;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--r12m-master-tool);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease), transform var(--r12-dur-1) var(--r12-ease);
}

.r12m-tool svg { width: 14px; height: 14px; flex: none; }
.r12m-tool:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-tool:active { transform: scale(.99); }
.r12m-tool:disabled,
.r12m-tool[aria-disabled='true'] { color: var(--r12-faint); cursor: not-allowed; background: transparent; }
/* 四稿 4：＋ 和 @ 是 30×30 的正圆。 */
.r12m-tool.is-icon { width: 30px; padding: 0; border-radius: 50%; }
/* 四稿 1：模式按钮用蓝色强调。 */
.r12m-tool.is-accent { color: var(--r12-accent); }
.r12m-tool.is-accent:hover { color: var(--r12-accent); }

.r12m-chev {
  display: inline-flex;
  align-items: center;
  color: var(--r12-faint);
}

/* 窄输入框（右侧栏、分模右栏）：＋ / @ / 技能 / 模型 / 详情；详情文字收起、图标保留。 */
.r12-composer[data-narrow='1'] {
  padding: 8px;
  gap: 6px;
}

.r12-composer[data-narrow='1'] .r12m-tool {
  padding: 0 6px;
  gap: 3px;
  font-size: 12px;
}

.r12-composer[data-narrow='1'] .r12m-tools { gap: 2px; }
.r12-composer[data-narrow='1'] .r12m-chev svg { width: 12px; height: 12px; }
/* 1106：窄栏不再靠装饰箭头占宽度；溢出时“更多”只留图标，避免把模型入口挤到不可点。 */
.r12-composer[data-narrow='1'] .r12m-chev { display: none; }
.r12-composer[data-narrow='1'] .r12m-more .r12m-more-label { display: none; }
.r12-composer[data-narrow='1'] .r12m-tool.is-icon { width: 30px; }
/* 详情在窄栏只留图标（文字由补19 规则收起）；图标必须保留，否则会剩空按钮。 */
.r12-composer[data-narrow='1'] .r12m-send { font-size: 12px; gap: 4px; }

.r12m-chev svg { width: 14px; height: 14px; }

/* 四稿一·4：发送键只有一个正圆，图标在正中；深色白底黑箭头，浅色黑底白箭头；
   不可点透明度 0.35；有费用时向左伸出「约 ✦N」胶囊。 */
.r12m-send {
  min-width: 0;
  min-height: 0;
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  /* 32×32 时 16px 就是正圆；有费用拉成胶囊时也沿用 16，不写 50% 以免被老「拉伸圆」扫描误判 */
  border-radius: 16px;
  background: var(--r12m-send-bg);
  color: var(--r12m-send-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--r12-dur-2) var(--r12-ease), width var(--r12-dur-3) var(--r12-ease);
}

.r12m-send.is-empty,
.r12-composer [data-r12-send][aria-disabled='true'] { opacity: .35; }

.r12m-send.has-cost {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--r12-r-pill);
}

.r12m-send:active { transform: scale(.99); }

.r12m-send-cost { font-size: 12px; line-height: 18px; white-space: nowrap; }
.r12m-send-cost-unit { margin-left: 4px; font-size: 10px; line-height: 14px; color: var(--r12-muted); font-weight: 400; }

.r12m-send-arrow {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
}

.r12m-send-arrow svg { width: 18px; height: 18px; display: block; }

.r12m-create-episodes {
  min-width: 0;
  min-height: 0;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.r12m-create-episodes svg { width: 16px; height: 16px; flex: none; }
.r12m-create-episodes:hover { background: var(--r12-hover); }
.r12m-create-episodes:disabled { color: var(--r12-faint); cursor: not-allowed; }

.r12m-pill-text {
  display: inline-flex;
  align-items: center;
  line-height: 20px;
}

/* ── 3. 菜单里的补充件 ───────────────────────────────────────── */

.r12m-menu-title {
  padding: 8px 12px 6px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--r12-muted);
}

.r12m-menu-divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--r12-line);
}

.r12m-switch-row { cursor: default; }
.r12m-switch-row:hover { background: transparent; }

/* 甲提供的开关轨道是 32×18；老 r9/r10 的全局 button{min-height:24} 会把它撑成 24 高、圆球不居中 */
.r12m-switch-row .r12-switch,
.r12m-pro-switch .r12-switch {
  min-width: 0;
  min-height: 0;
  line-height: 0;
}

.r12m-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 6px 6px;
}

.r12m-ratio-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.r12m-ratio {
  min-width: 0;
  min-height: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
  color: var(--r12-muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease);
}

.r12m-ratio:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-ratio[aria-checked='true'] { background: var(--r12-selected-bg); color: var(--r12-ink); font-weight: 600; box-shadow: var(--r12-selected-shadow, none); }
.r12m-ratio.is-wide { height: 34px; font-size: 12px; }

/* 四稿 11：时长滑杆 + 数字框。 */
.r12m-duration-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 10px;
}
.r12m-duration-row input[type='range'] { flex: 1; min-width: 0; }
.r12m-duration-row input[type='number'] {
  width: 64px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: 8px;
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}
.r12m-duration-unit { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-menu-hint { margin: 0; padding: 0 12px 10px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }

/* 四稿 10：全部技能弹窗（宽 880）：左分类、右卡片网格、顶部搜索。 */
.r12m-skills-dialog {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  min-height: 380px;
}
.r12m-skills-cats { display: flex; flex-direction: column; gap: 2px; }
.r12m-skill-cat {
  min-width: 0;
  min-height: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  text-align: left;
}
.r12m-skill-cat:hover { background: var(--r12-hover); }
.r12m-skill-cat[aria-pressed='true'] { background: var(--r12-selected-bg); font-weight: 600; }
.r12m-skills-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.r12m-skill-search { width: 100%; }
.r12m-skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.r12m-skill-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--r12-line);
  border-radius: 12px;
  background: var(--r12-surface-2);
  color: var(--r12-ink);
  font-family: inherit;
  text-align: left;
}
.r12m-skill-card svg { width: 16px; height: 16px; color: var(--r12-muted); }
.r12m-skill-card b { font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-skill-card small { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-skill-card:hover { background: var(--r12-hover); }
.r12m-skill-card[hidden] { display: none; }

/* ── 4. 主控：底部条与右侧栏 ─────────────────────────────────── */

/* 四稿二：底部条不加底色带、不加挡底，只留主控本身的光晕。 */
.r12m-dock-holder {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  pointer-events: none;
}

.r12m-dock-holder > .r12m-disclaimer,
.r12m-dock-holder > .r12-disclaimer { margin: 0 auto; }


.r12m-dock {
  width: min(690px, max(560px, 40vw));
  min-height: 56px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0 8px 0 12px;
  border: 1px solid var(--r12m-master-line);
  border-radius: var(--r12-r-composer);
  background: var(--r12m-master-bg);
  -webkit-backdrop-filter: var(--r12m-master-blur);
  backdrop-filter: var(--r12m-master-blur);
  box-shadow: var(--r12-shadow-pop, 0 8px 32px rgba(0, 0, 0, .24));
  pointer-events: auto;
  view-transition-name: r12-master;
}

/* 修正单 26：附件条放进底部条圆角框内，输入行在它下面；无附件时仍是 56 高。 */
.r12m-dock-attach { flex: none; width: 100%; margin: 8px 0 0; pointer-events: auto; }
.r12m-dock-attach .r12m-attach-bar { margin-bottom: 0; }
.r12m-dock-row { flex: none; display: flex; align-items: center; gap: 10px; height: 54px; min-width: 0; }

.r12m-master-mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r12-r-pill);
  background: color-mix(in srgb, var(--r12-brand) 18%, transparent);
  color: var(--r12-brand);
}

.r12m-master-mark svg { width: 16px; height: 16px; }

.r12m-dock-guide {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--r12-faint);
  font-family: inherit;
  font-size: 14px;
  line-height: 22px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r12m-dock-guide:hover { background: var(--r12-hover); color: var(--r12-muted); }

.r12m-side {
  width: 360px;
  flex: none;
  align-self: stretch;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 0 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-panel);
  background: var(--r12-surface-2);
  box-shadow: var(--r12-glow);
  view-transition-name: r12-master;
}

.r12m-side-head {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--r12-line);
}

.r12m-side-name {
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--r12-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r12m-side-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.r12m-side-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
}

/* 四稿 6：输入卡离外层大卡片四边各 8；内外圆角平行，外 16、内 8。 */
.r12m-side-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 5px;
  overflow: visible;
}

/* 1106：右侧栏外卡片 16、foot 内边距 5，输入框内圆角 = 16 − 5 = 11。
   不再让输入框跟外层用同一个 16，避免内外两套圆角互相顶。 */
.r12m-side .r12-composer,
.r12m-side-foot .r12-composer { border-radius: max(0px, calc(var(--r12-r-panel) - 5px)); }

.r12m-side-context {
  padding: 0 12px 4px;
  font-size: 12px;
  line-height: 18px;
  color: var(--r12-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

::view-transition-old(r12-master),
::view-transition-new(r12-master) {
  animation-duration: 280ms;
  animation-timing-function: var(--r12-ease);
}

html[data-motion='reduced']::view-transition-old(r12-master),
html[data-motion='reduced']::view-transition-new(r12-master) { animation: none; }

/* ── 5. 项目页兜底骨架 ───────────────────────────────────────── */

.r12m-project {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  background: transparent;
}

.r12m-project-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: transparent;
}

.r12m-project-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.r12m-project-head h1 {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: var(--r12-ink);
}

.r12m-project-note {
  max-width: 520px;
  padding: 16px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-panel);
  color: var(--r12-muted);
  font-size: 13px;
  line-height: 20px;
}

/* ── 6. 创作页 ───────────────────────────────────────────────── */

/* 二稿约定 1：最外层不再自带外边距，四边贴着外壳给的位置。 */
/* 三稿复检：全能页最外层加 data-r12-bleed，外壳让它上下贴顶栏、贴窗口底；
   本页自己不再用负外边距。 */
.r12m-create {
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 8px;
  padding: 0;
  background: transparent;
}

/* 三稿复检 1：全能页贴边了，会话列表面板自己留 8（顶=顶栏底+8，底=窗口底−8）。 */
.r12m-history {
  width: 280px;
  flex: none;
  min-height: 0;
  margin: 8px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-panel);
  background: var(--r12-surface);
  transition: width var(--r12-dur-4) var(--r12-ease), opacity var(--r12-dur-4) var(--r12-ease);
}

.r12m-create.is-history-closed { gap: 0; }
/* 收起后必须真的是 0：border-box 下 1px 边框会剩 2px，边框和阴影一起摘掉 */
.r12m-create.is-history-closed .r12m-history {
  width: 0;
  border-width: 0;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.r12m-history-head {
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
}

.r12m-history-title {
  font-size: var(--r12-fs-title, 15px);
  line-height: var(--r12-lh-title, 22px);
  font-weight: 600;
  color: var(--r12-ink);
}

/* 三稿二：会话标题并进顶栏（← 创作 / 标题 ＋） */
.r12m-top-crumb {
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  color: var(--r12-muted);
  white-space: nowrap;
}

.r12m-top-sep { color: var(--r12-faint); }

.r12m-top-title {
  min-width: 0;
  max-width: 320px;
  font-size: var(--r12-fs-title, 15px);
  line-height: var(--r12-lh-title, 22px);
  font-weight: 600;
  color: var(--r12-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 三稿三 6：原型面板上的「卡片式 / 加号在上」藏起来（两个值画出来一样）
   r8.css 有 .prototype-panel .prototype-variants{display:flex}，这里用同强度以上的选择器压住。 */
.prototype-panel .prototype-variants.r12-layout-variants { display: none; }

.r12m-history-head .r12-circle-btn { margin-left: auto; }

.r12m-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.r12m-session-row { position: relative; margin: 0 8px; height: 32px; border-radius: 10px; }
.r12m-session {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.r12m-session:hover { background: var(--r12-surface-3); }
.r12m-session[aria-current='true'] { background: var(--r12-surface-3); box-shadow: none; }
.r12m-session-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--r12-surface-3); color: var(--r12-muted); }
.r12m-session-icon svg { width: 14px; height: 14px; }
.r12m-session-text { min-width: 0; height: 32px; display: flex; flex-direction: column; justify-content: center; }
.r12m-session-text b { font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r12m-session-text small { font-size: 12px; line-height: 16px; color: var(--r12-muted); }
.r12m-session-more { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; opacity: 0; }
.r12m-session-row:hover .r12m-session-more { opacity: 1; }
.r12m-session-row.is-dragging .r12m-session { opacity: .35; }
/* 九稿 61：分区里的会话缩进 16；拖动落点、闪一下选中底色。 */
.r12m-recent-drop { display: flex; flex-direction: column; gap: 8px; }
.r12m-partition-sessions .r12m-session-row { margin-left: 24px; }
.r12m-recent-title { padding: 6px 12px 4px; color: var(--r12-faint); font-size: 12px; line-height: 18px; }
.r12m-partition-row.is-drop-target { background: var(--r12-hover); border-radius: 10px; }
.r12m-session-row.is-drop-flash .r12m-session,
.r12m-partition.is-drop-flash > .r12m-partition-row { background: var(--r12-selected-bg); }

/* 三稿二：滚动区铺满整列（顶=顶栏底，底=窗口底），主控浮在上面。 */
.r12m-chat {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: transparent;
}

.r12m-chat-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: transparent;
  /* 不占滚动条宽度，正文列才能和主控左右对齐到 1px 内 */
  scrollbar-width: none;
}
.r12m-chat-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* 四稿 3 / 5 + 即梦补充 12：正文列和主控同宽、左右对齐；答→问 32，问→答 24，同一回复内 12，任何两块不重叠。 */
.r12m-chat-content {
  width: min(896px, calc(100% - 96px));
  max-width: none;
  margin: 0 auto;
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: var(--r12-fs-body, 14px);
  line-height: var(--r12-lh-body, 22px);
}

/* 补12：一问一答 32、用户到回复 24、回复内部 12；任何两块不重叠。 */
.r12m-chat-content > .message-user { margin-top: 32px; }
.r12m-chat-content > .message:first-child { margin-top: 0; }
.r12m-chat-content > .message-user + .message-assistant { margin-top: 20px; }
.r12m-chat-content > .message-assistant + .message-assistant { margin-top: 12px; }
.r12m-chat-content > .message-assistant + .message-user { margin-top: 32px; }

.r12m-chat-content > * { min-width: 0; }

/* 用户消息：实心气泡，靠右，最大宽 80%。 */
.r12m-chat-content .message { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.r12m-chat-content .message-user { justify-content: flex-end; }
.r12m-chat-content .user-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(51,119,247,.24);
  background: var(--r12-accent-user-soft, color-mix(in srgb, var(--r12-accent-user, #3377F7) 24%, transparent));
  color: var(--r12-ink);
  overflow-wrap: anywhere;
}
:root[data-mode='light'] .r12m-chat-content .user-bubble {
  background: rgba(51,119,247,.14);
  background: var(--r12-accent-user-soft, color-mix(in srgb, var(--r12-accent-user, #3377F7) 14%, transparent));
}
.r12m-chat-content .thought-block,
.r12m-side-body .thought-block,
.r12m-pro-chat .thought-block { margin: 0; }
.r12m-chat-content .thought-disclosure { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; color: var(--r12-muted); font: inherit; font-size: 12px; line-height: 18px; }
.r12m-side-body .thought-disclosure,
.r12m-pro-chat .thought-disclosure { margin: 0 0 8px; padding-left: 0; }
.r12m-side-body .message-body .message-meta,
.r12m-pro-chat .message-body .message-meta { margin: 0 0 4px; }
.r12m-chat-content .thought-details + .thought-disclosure { margin-top: 0; }

/* 回复：不用气泡，直接排在画面上；头像在正文列外侧左边，头像右边离正文 12。 */
.r12m-chat-content .message-assistant { position: relative; display: block; }
.r12m-chat-content .message-assistant > .master-avatar {
  position: absolute;
  right: calc(100% + 12px);
  top: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  flex: none;
}
.r12m-chat-content .message-assistant > .message-body {
  min-width: 0;
  padding: 0;
  background: transparent;
}
.r12m-chat-content .message-body .message-meta { margin: 0 0 4px; font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
/* 七稿：思考完成条上 ≤8、下 ≤12，左边与正文同一起点。 */
.r12m-chat-content .r12-process { margin: 0 0 8px; padding-left: 0; }
.r12m-chat-content .r12m-process-toggle,
.r12m-chat-content .r12-process-toggle { margin-left: 0; padding-left: 0; }
.r12m-chat-content .r12-process + .rich-text,
.r12m-chat-content .r12-process + .result-card,
.r12m-chat-content .r12-process + .r12m-result,
.r12m-chat-content .r12-process + .r12m-prompt-block { margin-top: 0; }

/* 系统状态：一行 12/18 弱色小字加图标，不做卡片。 */
.r12m-chat-content .process-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}
.r12m-chat-content .process-line svg { width: 14px; height: 14px; flex: none; }

.r12m-scroll-pad { flex: none; height: 120px; }

/* 三稿四：正文 14/22、标题 15/22、界面 13/20、小字 12/18（老消息样式跟着收敛） */
.r12m-chat-content .rich-text,
.r12m-chat-content .message-body,
.r12m-chat-content .user-bubble,
.r12m-chat-content .result-prompt {
  font-size: var(--r12-fs-body, 14px);
  line-height: var(--r12-lh-body, 22px);
}

.r12m-chat-content .rich-text h2 {
  font-size: var(--r12-fs-title, 15px);
  line-height: var(--r12-lh-title, 22px);
  font-weight: 600;
}

.r12m-chat-content .rich-text h3 {
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 600;
}

/* 四稿二：上一稿的挡底层、渐隐层、挡底条全部撤掉，主控背后和下方不再有通栏底色带；
   内容从主控底下穿过，靠半透明底 + 背景模糊自然透出。 */
.r12m-chat-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  padding: 0;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

/* 八稿 57（1.1）：只封顶不按比例缩——min(896px, 内容区宽 − 96)，水平居中。 */
.r12m-chat-composer {
  width: min(896px, calc(100% - 96px));
  margin: 0 auto;
  pointer-events: auto;
}

/* 四稿 12：长会话往上翻时，右下出现「回到底部」文字胶囊加向下箭头。 */
.r12m-to-bottom {
  position: absolute;
  right: 24px;
  bottom: 104px;
  z-index: 3;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: var(--r12-pop-bg);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  box-shadow: var(--r12-shadow-pop);
}
.r12m-to-bottom svg { width: 14px; height: 14px; }
.r12m-to-bottom[hidden] { display: none; }
.r12m-to-bottom:hover { background: var(--r12-hover); }

/* 四稿 12：新建会话按钮标「⌘K」。 */
.r12m-new-btn {
  min-width: 0;
  min-height: 0;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
}
.r12m-new-btn svg { width: 14px; height: 14px; }
.r12m-new-btn:hover { background: var(--r12-hover); }
.r12m-kbd {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--r12-surface);
  color: var(--r12-muted);
  font-size: 11px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.r12m-return { position: absolute; left: 8px; top: 8px; z-index: 3; }

.r12m-history .history-head { padding: 12px 12px 8px; }
.r12m-history .history-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.r12m-history .history-footer { padding: 8px 12px 12px; }

/* ── 7. 分模页：参数｜结果｜主控 ─────────────────────────────── */

.r12m-pro {
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.r12m-pro > .r12-panel { min-height: 0; }
.r12m-pro-params { width: 300px; flex: none; }
.r12m-results { flex: 1; min-width: 0; }
.r12m-pro-master { width: 360px; width: var(--r12-side-w); flex: none; }

.r12m-pro-rail {
  position: relative;
  width: 28px;
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
}

.r12m-pro-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.r12m-pro-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.r12m-pro-label {
  font-size: 12px;
  line-height: 18px;
  color: var(--r12-muted);
  text-align: left;
}

.r12m-pro-field .r12-select {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
}

.r12m-pro-field .r12-select > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.r12m-pro-field .r12-select > svg:last-child { margin-left: auto; flex: none; }

/* 四稿三·1：类型四段，四等分铺满整行。 */
.r12m-pro-params .r12-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
}

.r12m-pro-params .r12-seg .r12-seg-item {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.r12m-pro-static { height: 32px; display: flex; align-items: center; font-size: 13px; line-height: 20px; color: var(--r12-ink); }
.r12m-pro-hint { font-size: 12px; line-height: 18px; color: var(--r12-muted); }

.r12m-pro-empty {
  margin: 0;
  padding: 12px 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--r12-muted);
}

/* 四稿三·3：Seedance 时长滑杆 + 数字框。 */
.r12m-pro-range { display: flex; align-items: center; gap: 8px; height: 32px; }
.r12m-pro-range input[type='range'] { flex: 1; min-width: 0; }
.r12m-pro-range input[type='number'] {
  width: 64px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}
.r12m-pro-range > span { font-size: 12px; line-height: 18px; color: var(--r12-muted); }

.r12m-model-select { gap: 8px; }
.r12m-vendor-icon { width: 16px; height: 16px; flex: none; }
.r12m-model-pill { display: inline-flex; align-items: center; height: 28px; gap: 4px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r12-r-pill); background: var(--r12-surface-3); color: var(--r12-ink); font-family: inherit; font-size: var(--r12-fs-small); line-height: var(--r12-lh-small); font-weight: 500; white-space: nowrap; }
button.r12m-model-pill { cursor: pointer; }
button.r12m-model-pill:hover { border-color: var(--r12-line-strong); }
button.r12m-model-pill:focus-visible { outline: 2px solid var(--r12-ink); outline-offset: 2px; }
.r12m-model-pill-icon, .r12m-model-pill-lock, .r12m-model-pill-arrow { display: inline-flex; align-items: center; }
.r12m-model-pill svg { width: 14px; height: 14px; flex: none; }
.r12m-model-pill-lock svg, .r12m-model-pill-arrow svg { width: 12px; height: 12px; }
.r12m-model-pill.is-locked { cursor: default; color: var(--r12-muted); }

/* 四稿三·3：MJ 参数分常用 / 更多；更多默认收起。 */
.r12m-mj-number { height: 32px; text-align: left; }
.r12m-mj-text {
  height: auto;
  min-height: 56px;
  resize: none;
  padding: 7px 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
}
.r12m-mj-text:focus-visible { outline: none; border-color: var(--r12-selected-border); }
.r12m-mj-more { align-self: flex-start; }
.r12m-mj-advanced { display: flex; flex-direction: column; gap: 16px; }
.r12m-mj-advanced[hidden] { display: none; }

.r12m-pro-switch {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 20px;
  color: var(--r12-muted);
}

.r12m-pro-prompt-input {
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  resize: none;
}

.r12m-prompt-field { display: block; }

.r12m-pro-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--r12-line);
}

.r12m-pro-cost {
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--r12-ink);
  font-variant-numeric: tabular-nums;
}

/* 四稿 7：每张结果卡是一张大图，图下操作条要一行放得下，所以卡片最小 480 宽（窄面板自动一列）。 */
.r12m-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 10px;
}

.r12m-result-grid .r12-card-media { aspect-ratio: 16 / 9; }
.r12m-result-grid .r12-card-media img { width: 100%; height: 100%; object-fit: cover; }

.r12m-pro-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
}

/* 1106 第三轮：分模/独立图片视频右侧主控统一用项目右侧栏口径——
   外面板 16、内边距 5、输入卡内圆角 11；浅色/深色与焦点边框不受影响。 */
.r12m-pro-composer { flex: none; padding: 5px; }
.r12m-pro-composer .r12-composer { border-radius: max(0px, calc(var(--r12-r-panel) - 5px)); }

/* ── 9. 二稿：附件小卡、结果卡、搜索、高级参数、确认与提示 ───── */

/* 音频附件：高 32、圆角 10，浅色白底 / 深色面板底 */
.r12m-audio {
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: 10px;
  background: var(--r12-surface);
  color: var(--r12-ink);
  font-size: 12px;
  line-height: 18px;
}

.r12m-audio > svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12m-audio-name { white-space: nowrap; }

.r12m-audio-x {
  min-width: 0;
  min-height: 0;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: transparent;
  color: var(--r12-muted);
  line-height: 0;
}

.r12m-audio-x svg { width: 10px; height: 10px; }
.r12m-audio-x:hover { background: var(--r12-hover); color: var(--r12-ink); }

/* 四稿 7：图下常驻操作条；图上不盖任何悬停按钮。 */
.r12m-result { position: relative; padding: 6px 4px; }

.r12m-result-media {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r12-r-media);
  background: transparent;
  overflow: hidden;
  cursor: zoom-in;
}

.r12m-result-media .r12-card-media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; }

/* 四稿一·7：生成标识盖在左上角，距左、上各 8；宽度小于 160 的媒体不盖。 */
.r12-ai-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  pointer-events: none;
}

@container (max-width: 159px) {
  .r12-ai-badge { display: none; }
}

.r12m-video-media { position: relative; }
.r12m-play { position: absolute; left: 8px; bottom: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r12-r-pill); background: rgba(0,0,0,.5); color: #fff; }
.r12m-play svg { width: 14px; height: 14px; }
.r12m-duration { position: absolute; right: 8px; bottom: 8px; height: 18px; padding: 0 6px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 18px; }

/* 四稿 7：图下一条常驻操作条：重新编辑、再次生成、用作参考、下载、…，28 高紧凑按钮，左对齐；
   右端写「本次消耗 ✦N」，12/18 弱色。 */
.r12m-result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
}

.r12m-result-actions.is-static { opacity: 1; pointer-events: auto; }

.r12m-result-cost {
  margin-left: auto;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
  white-space: nowrap;
}

/* 四稿一·5：紧凑按钮 28 高、字 12/18、左右内边距 10、图标 14、图标和字间距 4。 */
.r12-btn.is-dense {
  height: 28px;
  max-height: 28px;
  gap: 4px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 18px;
}
.r12-btn.is-dense svg { width: 14px; height: 14px; }

.r12m-act {
  min-width: 0;
  min-height: 0;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.r12m-act svg { width: 14px; height: 14px; flex: none; }
.r12m-act:hover { background: var(--r12-hover); }
.r12m-act.is-more { padding: 0 8px; }

.r12m-chat-q { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--r12-ink); }
.r12m-chat-a {
  margin-top: 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--r12-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 结果搜索 */
.r12m-results-tools { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: flex-start; gap: 6px; }
.r12m-results .r12-panel-head:has(.r12-search[data-open]) > h3,
.r12m-results .r12-panel-head:has(.r12-search[data-open]) > .r12m-result-count { display: none; }
.r12m-result-count { font-size: 12px; line-height: 18px; color: var(--r12-muted); font-variant-numeric: tabular-nums; }
.r12m-search {
  width: 180px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
}
.r12m-search:focus-visible { outline: none; border-color: var(--r12-selected-border); }

/* 四稿三·4：搜索胶囊。收起是 28 圆放大镜；展开是 220×28 输入框，宽度动画 160ms，不推挤旁边元素。 */
.r12m-search-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
}

.r12m-search-open { width: 28px; height: 28px; }
.r12m-search-open[hidden] { display: none; }

.r12m-search-pill {
  position: absolute;
  right: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: width var(--r12-dur-3) var(--r12-ease), opacity var(--r12-dur-3) var(--r12-ease);
}

.r12m-search-pill.is-open { width: 220px; opacity: 1; pointer-events: auto; }

.r12m-search-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
}

.r12m-search-input::placeholder { color: var(--r12-faint); }
.r12m-search-input::-webkit-search-cancel-button { display: none; }

.r12m-search-clear {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r12-muted);
}

.r12m-search-clear svg { width: 12px; height: 12px; }
.r12m-search-clear:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-search-clear[hidden] { display: none; }

/* 高级参数 */
/* 提示词框的圆弧把手（甲的可拉高文本框没到时用这个兜底，圆角 10 − 3 = 7） */
.r12m-textarea { position: relative; display: block; }
.r12m-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--r12-muted);
  border-bottom: 1.5px solid var(--r12-muted);
  border-bottom-right-radius: 7px;
  pointer-events: none;
}

.r12m-pro-advanced {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--r12-line);
  border-radius: 12px;
}
.r12m-pro-advanced h4 { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--r12-muted); }
.r12m-pro-advanced-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 20px; color: var(--r12-ink); }
.r12m-pro-advanced-row b { font-weight: 600; color: var(--r12-muted); font-variant-numeric: tabular-nums; }

/* 查看提示词的弹层、确认框正文、大图卡里的提示词 */
.r12m-dialog-prompt { margin: 0 0 12px; font-size: 13px; line-height: 20px; color: var(--r12-ink); white-space: pre-wrap; }
.r12m-dialog-params td { height: 32px; border-bottom: 0; }
.r12m-dialog-params td:first-child { width: 84px; color: var(--r12-muted); }
.r12m-confirm-body { margin: 0; font-size: 13px; line-height: 20px; color: var(--r12-muted); }
.r12m-lb-prompt { margin: 0; font-size: 13px; line-height: 20px; color: var(--r12-muted); }

/* 甲的模式分段不在时，本路的兜底也要反色 */
.r12m-mode-seg .r12-seg-item { gap: 6px; }
.r12m-mode-seg .r12-seg-item svg { width: 14px; height: 14px; }
.r12m-mode-seg .r12-seg-item[aria-pressed='true'] { background: var(--r12-ink); color: var(--r12-bg); }

/* ── 10. 四稿 · 即梦补充 ─────────────────────────────────────── */

/* 补1 过程条 */
.r12m-process { margin-top: 0; margin-bottom: 12px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-chat-content .r12-process { margin-top: 0; margin-bottom: 8px; }
.r12m-chat-content .r12m-process-toggle { padding-left: 0; }
.r12m-process-toggle { min-width: 0; min-height: 0; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 12px; line-height: 18px; }
.r12m-process[data-state='running'] .r12m-process-toggle { font-size: 13px; line-height: 20px; }
.r12m-spin.is-title { width: 16px; height: 16px; }
.r12m-process-toggle:hover { color: var(--r12-ink); }
.r12m-process-chev { display: inline-block; transition: transform var(--r12-dur-3) var(--r12-ease); }
.r12m-process.is-open .r12m-process-chev { transform: rotate(90deg); }
.r12m-process-thought { margin: 6px 0 4px; font-size: 13px; line-height: 20px; color: var(--r12-muted); }
.r12m-process-body { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 0 20px; }
.r12m-process-body[hidden] { display: none; }
.r12m-process-step { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 18px; }
.r12m-process-step svg { width: 14px; height: 14px; flex: none; }
.r12m-spin { width: 14px; height: 14px; flex: none; border: 2px solid var(--r12-accent); border-right-color: transparent; border-radius: 50%; animation: r12m-spin 1.2s linear infinite; }
@keyframes r12m-spin { to { transform: rotate(360deg); } }

/* 补3 生成占位 */
.r12m-gen { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: linear-gradient(120deg, #34405E, #5C5470, #2B5566); background-size: 200% 200%; animation: r12m-gen-flow 6s ease-in-out infinite alternate; }
.r12m-gen[data-ratio] { aspect-ratio: 16 / 9; }
.r12m-gen[data-ratio='9:16'] { aspect-ratio: 9 / 16; width: min(100%, 280px); }
.r12m-gen[data-ratio='1:1'] { aspect-ratio: 1 / 1; width: min(100%, 420px); }
.r12m-gen[data-ratio='4:3'] { aspect-ratio: 4 / 3; width: min(100%, 480px); }
:root[data-mode='light'] .r12m-gen { background-image: linear-gradient(120deg, #CDD6E8, #DDD3E3, #C7DDE4); }
.r12m-gen.is-stopped, .r12m-gen-host.is-stopped { filter: grayscale(.7); }
.r12m-gen.is-stopped { animation: none; }
.r12m-gen-flow { position: absolute; inset: 0; background: radial-gradient(circle at 30% 40%, rgba(255,255,255,.12), transparent 45%); }
@keyframes r12m-gen-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.r12m-gen-pct { position: absolute; left: 8px; top: 8px; padding: 0 6px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 18px; }
.r12m-gen-card { position: absolute; left: 50%; bottom: calc(100% + 8px); width: 400px; max-width: calc(100vw - 32px); padding: 12px; border: 1px solid var(--r12-line-strong); border-radius: 12px; background: var(--r12-pop-bg); box-shadow: var(--r12-shadow-pop); color: var(--r12-ink); z-index: 6; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity var(--r12-dur-2) var(--r12-ease), visibility 0s linear var(--r12-dur-2); }
.r12m-gen:hover .r12m-gen-card, .r12m-gen:focus-within .r12m-gen-card { opacity: 1; visibility: visible; transition-delay: 300ms, 300ms; }
.r12m-gen-card-head .r12m-round { width: 28px; height: 28px; }
.r12m-gen-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.r12m-gen-card-head b { flex: 1; font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-gen-card p { margin: 0; font-size: 13px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.r12m-gen-card-meta { margin-top: 6px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }

/* 补4 视频控件 */
.r12m-video-media { position: relative; }
.r12m-vctl { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; display: flex; align-items: flex-end; gap: 8px; padding: 0 8px 6px; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); opacity: 0; pointer-events: none; transition: opacity var(--r12-dur-2) var(--r12-ease); color: #fff; }
.r12m-video-media:hover .r12m-vctl, .r12m-video-media:focus-within .r12m-vctl { opacity: 1; pointer-events: auto; }
.r12m-vctl-play, .r12m-vctl-full { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; }
.r12m-vctl-play svg, .r12m-vctl-full svg { width: 14px; height: 14px; }
.r12m-vctl-time { font-size: 12px; line-height: 18px; }
.r12m-vctl-line { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.3); }
.r12m-vctl-line i { display: block; width: 20%; height: 100%; background: rgba(255,255,255,.85); }
.r12m-vctl-full { margin-left: auto; }

/* 补5 / 补6 / 补7 说明行、操作条、继续建议、技能前缀 */
.r12m-notice { margin-top: 12px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-reply-actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.r12m-round { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--r12-surface-3); color: var(--r12-ink); }
.r12m-round svg { width: 14px; height: 14px; }
.r12m-round:hover { background: var(--r12-hover); }
.r12m-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 12px; font-size: 13px; line-height: 20px; }
.r12m-suggest-label { color: var(--r12-ink); }
.r12m-suggest-item { min-width: 0; min-height: 0; display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 13px; line-height: 20px; }
.r12m-suggest-item:hover { color: var(--r12-ink); }
.r12m-skill-prefix { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-skill-prefix svg { width: 14px; height: 14px; }
.r12m-skill-tip { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-link-btn { min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--r12-accent); font-family: inherit; font-size: 12px; line-height: 18px; }
.r12m-stopped-line { margin-top: 12px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-queue { display: flex; align-items: center; gap: 4px; padding: 4px 2px 0; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-cost-info { width: 16px; height: 16px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 12px; line-height: 16px; }
.r12m-stop-square { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
@media (prefers-reduced-motion: reduce) {
  .r12m-spin, .r12m-session-spin, .r12m-gen { animation: none; }
  .r12m-process-chev, .r12m-gen-card, .r12m-vctl { transition: none; }
}

/* 补9 自绘占位 */
.r12m-input-wrap { position: relative; min-width: 0; }
.r12m-placeholder { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; pointer-events: none; color: var(--r12m-master-placeholder); font-size: 14px; line-height: 22px; }
.r12m-placeholder.is-hidden { display: none; }
.r12m-ph-keys { color: var(--r12m-master-placeholder); }
.r12m-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--r12-line-strong); border-radius: 4px; font-size: 12px; line-height: 16px; }
.r12-composer[data-narrow='1'] .r12m-placeholder { font-size: 13px; line-height: 22px; }

/* 补10 比例格、模型行 */
.r12m-ratio-cells { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 6px 8px; }
.r12m-ratio-cell { box-sizing: border-box; flex: 1 1 40px; min-width: 40px; max-width: calc((100% - 28px) / 8); height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 1px solid var(--r12-line); border-radius: 8px; background: transparent; color: var(--r12-muted); font-family: inherit; }
.r12m-ratio-cell.is-selected { background: var(--r12-selected-bg); border-color: var(--r12-ink); color: var(--r12-ink); }
.r12m-ratio-cell.is-disabled, .r12m-ratio-cell:disabled { opacity: .35; cursor: not-allowed; }
.r12m-ratio-shape { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.r12m-ratio-shape i { display: block; width: 20px; height: 11px; border: 2px solid currentColor; border-radius: 2px; }
.r12m-ratio-shape[data-ratio="1-1"] i { width: 20px; height: 20px; }
.r12m-ratio-shape[data-ratio="4-3"] i { width: 20px; height: 15px; }
.r12m-ratio-shape[data-ratio="3-4"] i { width: 15px; height: 20px; }
.r12m-ratio-shape[data-ratio="16-9"] i { width: 20px; height: 11px; }
.r12m-ratio-shape[data-ratio="9-16"] i { width: 11px; height: 20px; }
.r12m-ratio-shape[data-ratio="3-2"] i { width: 20px; height: 13px; }
.r12m-ratio-shape[data-ratio="2-3"] i { width: 13px; height: 20px; }
.r12m-ratio-shape[data-ratio="21-9"] i { width: 20px; height: 9px; }
.r12m-ratio-shape[data-ratio="5-4"] i { width: 20px; height: 16px; }
.r12m-ratio-shape[data-ratio="4-5"] i { width: 16px; height: 20px; }
.r12m-ratio-shape[data-ratio="2-1"] i { width: 20px; height: 10px; }
.r12m-ratio-shape[data-ratio="1-2"] i { width: 10px; height: 20px; }
.r12m-ratio-shape[data-ratio="3-1"] i { width: 20px; height: 7px; }
.r12m-ratio-shape[data-ratio="1-3"] i { width: 7px; height: 20px; }
.r12m-ratio-shape[data-ratio="9-21"] i { width: 9px; height: 20px; }
.r12m-ratio-label { font-size: 12px; line-height: 18px; white-space: nowrap; }
.r12m-model-row { min-height: 56px; height: 56px; }
.r12m-model-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--r12-surface-3); color: var(--r12-ink); }
.r12m-model-icon svg, .r12m-model-icon .r12m-vendor-icon { width: 20px; height: 20px; }
.r12m-model-row .r12-menu-text b { font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-model-row .r12-menu-text small { font-size: 12px; line-height: 18px; }

/* 补11 会话列表 */
.r12m-session-row { position: relative; display: flex; align-items: center; }
.r12m-session-row .r12m-session-text { flex: 1; }
.r12m-session-row .r12m-session { flex: 1; min-width: 0; padding-right: 40px; }
.r12m-session-spin { box-sizing: border-box; width: 14px; height: 14px; max-width: 14px; max-height: 14px; padding: 0; margin-left: auto; flex: none; border: 2px solid var(--r12-accent); border-right-color: transparent; border-radius: 50%; animation: r12m-spin 1.2s linear infinite; }
.r12m-session-dot { width: 6px; height: 6px; margin-left: auto; flex: none; border-radius: 50%; background: var(--r12-accent); }
.r12m-session-pin { width: 14px; height: 14px; margin-left: auto; flex: none; display: grid; place-items: center; color: var(--r12-muted); }
.r12m-session-pin svg { width: 14px; height: 14px; }
.r12-dialog .r12-btn.r12m-danger { background: var(--error); border-color: var(--error); color: #fff; }
.r12m-session-more { position: absolute; right: 4px; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--r12-surface); color: var(--r12-muted); opacity: 0; pointer-events: none; }
.r12m-session-row:hover .r12m-session-more, .r12m-session-row:focus-within .r12m-session-more { opacity: 1; pointer-events: auto; }
.r12m-session-more svg { width: 14px; height: 14px; }
.r12m-session-rename { position: absolute; left: 8px; right: 36px; height: 28px; padding: 0 8px; border: 1px solid var(--r12-selected-border); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; font-size: 13px; }

/* ── 8. 减少动效 ─────────────────────────────────────────────── */

html[data-motion='reduced'] .r12m-send,
html[data-motion='reduced'] .r12m-tool,
html[data-motion='reduced'] .r12m-plus,
html[data-motion='reduced'] .r12m-thumb-x { transition: none; }

/* ── 9. 小云雀与 Kimi 补充 ───────────────────────────────────── */
.r12m-menu-empty { padding: 12px; font-size: 13px; line-height: 20px; color: var(--r12-muted); }

/* 修正单 17：会话正文里的单视频 / 生成占位最大 640，四图网格最大 720；分模页不受影响。 */
.r12m-chat-content .r12m-result-media,
.r12m-chat-content .r12m-video-media,
.r12m-chat-content .result-media.video-cover { max-width: 640px; }
.r12m-chat-content .r12-gen[data-r12-gen] { width: 100%; max-width: 640px; }
.r12m-chat-content .result-media.image-grid { max-width: 720px; }

/* 补16 用户消息上方模型签：用户消息改纵向，签靠右，和气泡距 4。 */
.r12m-chat-content .message-user { flex-direction: column; align-items: flex-end; gap: 0; }
.r12m-user-model-sign { display: inline-flex; align-items: center; gap: 4px; height: 24px; margin-bottom: 4px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 12px; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-model-sign-icon { width: 14px; height: 14px; display: grid; place-items: center; }
.r12m-model-sign-icon svg, .r12m-model-sign-icon .r12m-vendor-icon { width: 14px; height: 14px; }

/* 补13 追问卡 */
.r12m-ask-lead { margin-bottom: 12px; font-size: 14px; line-height: 22px; }
.r12m-ask { width: 100%; padding: 16px; border: 1px solid var(--r12-line); border-radius: 16px; background: var(--r12-surface); }
.r12m-ask-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r12m-ask-head h3 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.r12m-ask-pager { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; line-height: 20px; color: var(--r12-muted); }
.r12m-ask-page { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 16px; }
.r12m-ask-page:hover:not(:disabled) { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-ask-page:disabled { opacity: .35; }
.r12m-ask-required { margin: 2px 0 8px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-ask-options { display: flex; flex-direction: column; gap: 2px; }
.r12m-ask-option { width: 100%; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--r12-ink); font-family: inherit; }
.r12m-ask-option:hover { background: var(--r12-hover); }
.r12m-ask-option.is-selected { background: var(--r12-selected-bg); }
.r12m-ask-num { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 1px solid var(--r12-line-strong); border-radius: 4px; font-size: 12px; line-height: 18px; }
.r12m-ask-option.is-selected .r12m-ask-num { background: var(--r12-ink); border-color: var(--r12-ink); color: var(--r12-surface); }
.r12m-ask-copy { display: flex; flex-direction: column; min-width: 0; }
.r12m-ask-copy b { font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-ask-copy small { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-ask-add { align-self: flex-start; margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 13px; line-height: 20px; }
.r12m-ask-add:hover { color: var(--r12-ink); }
.r12m-ask-input { width: 100%; height: 36px; margin-top: 8px; padding: 0 10px; border: 1px solid var(--r12-line-strong); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; font-size: 13px; }
.r12m-ask-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.r12m-ask-next { height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--r12-ink); color: var(--r12-surface); font-family: inherit; font-size: 13px; line-height: 20px; }
.r12m-ask-next.is-disabled { opacity: .35; }
.r12m-ask-done { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }

/* 补14 产物清单 */
.r12m-products { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface); }
.r12m-products-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.r12m-products-head b { font-size: 13px; line-height: 20px; }
.r12m-prod-submit { height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--r12-ink); color: var(--r12-surface); font-family: inherit; font-size: 12px; }
.r12m-prod-submit[aria-disabled='true'] { opacity: .35; }
.r12m-product-row { display: flex; align-items: center; gap: 8px; min-height: 56px; border-top: 1px solid var(--r12-line); }
.r12m-prod-check { width: 16px; height: 16px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--r12-line-strong); border-radius: 4px; background: transparent; color: var(--r12-surface); }
.r12m-prod-check.is-on { background: var(--r12-ink); border-color: var(--r12-ink); }
.r12m-prod-check svg { width: 12px; height: 12px; }
.r12m-prod-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.r12m-prod-copy b { font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-prod-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 20px; color: var(--r12-muted); }
.r12m-prod-copy span { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-prod-price { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-prod-details { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--r12-line); font-size: 12px; line-height: 18px; }
.r12m-prod-details div { display: flex; justify-content: space-between; gap: 12px; color: var(--r12-muted); }
.r12m-products-done { font-size: 13px; line-height: 20px; }
.r12m-user-receipt { align-self: flex-end; display: inline-flex; align-items: center; height: 32px; margin-top: 8px; padding: 0 12px; border: 1px solid var(--r12-line); border-radius: 16px; font-size: 13px; line-height: 20px; color: var(--r12-ink); }

/* 补20 提示词块 */
.r12m-prompt-block { margin-top: 12px; border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface-2); overflow: hidden; }
.r12m-prompt-head { height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--r12-line); }
.r12m-prompt-head b { font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-prompt-head .r12m-round { width: 28px; height: 28px; }
.r12m-prompt-code { margin: 0; padding: 12px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 20px; white-space: pre-wrap; }

/* 补19 详情两栏 */
.r12-composer[data-narrow='1'] [data-action='r12m-open-details'] span { display: none; }
.r12m-details { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: 100%; max-height: min(560px, 60vh); overflow: hidden; }
.r12m-details.is-narrow { display: flex; flex-direction: column; max-height: min(520px, 60vh); overflow-y: auto; }
.r12m-details-models { min-width: 0; padding: 8px; border-right: 1px solid var(--r12-line); overflow-y: auto; }
.r12m-details.is-narrow .r12m-details-models { border-right: 0; border-bottom: 1px solid var(--r12-line); max-height: 260px; }
.r12m-details-params { min-width: 0; padding: 8px; overflow-y: auto; }
.r12m-details-label { margin: 4px 0; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-details-segs { display: flex; flex-wrap: wrap; gap: 4px; }
.r12m-details-seg { height: 28px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 8px; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 12px; white-space: nowrap; }
.r12m-details-seg.is-selected { background: var(--r12-selected-bg); border-color: var(--r12-ink); color: var(--r12-ink); }
.r12m-details-duration { display: flex; align-items: center; gap: 8px; }
.r12m-details-duration input[type='range'] { flex: 1; min-width: 0; }
.r12m-details-duration input[type='number'] { width: 56px; height: 28px; padding: 0 6px; border: 1px solid var(--r12-line); border-radius: 6px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; font-size: 12px; }

/* ── 10. 五稿（修正单 20）：模型浮窗、结果按组、会话结果、重命名、底部条 ── */

/* 五稿二·1：收起后在会话列表原位置左上留展开钮（不进顶栏）。 */
.r12m-history-reopen-slot { position: absolute; left: 8px; top: 8px; z-index: 5; }
.r12m-pro-params .r12-panel-head .r12-panel-toggle,
.r12m-pro-master .r12-panel-head .r12-panel-toggle { opacity: 1; }
.r12m-pro-rail .r12-panel-reopen[data-side='left'] { left: 0; }
.r12m-pro-rail .r12-panel-reopen[data-side='right'] { right: 0; }
.r12m-history-head .r12-search { margin-left: auto; }
.r12m-history-head.r12-search-row-open .r12-search { margin-left: 0; }
.r12m-history-head.r12-search-row-open [data-r12-search-keep] { margin-left: auto; }
.r12m-session-search { margin-left: auto; min-width: 0; }
.r12m-session-search .r12-search-input { width: 120px; height: 28px; }
.r12m-session-empty { padding: 10px 8px; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-no-results { padding: 24px 12px; font-size: 13px; line-height: 20px; color: var(--r12-muted); }

/* 五稿二·4：标题原地改输入框，同样字号字重、同样位置；只有 1px 焦点边。 */
.r12m-session.is-renaming { background: transparent; }
.r12m-session-text .r12m-session-rename {
  position: static;
  width: 100%;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  outline: none;
}
.r12m-session-text .r12m-session-rename:focus { border-color: var(--r12-selected-border); }

/* 五稿二·7：模型与参数浮窗，宽 720，左 260。 */
.r12m-picker-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.r12m-picker-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); pointer-events: auto; }
.r12m-model-picker {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 720px;
  max-height: min(600px, calc(100vh - 120px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--r12-line);
  border-radius: 18px;
  background: var(--r12-pop-bg);
  color: var(--r12-ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  overflow: hidden;
  pointer-events: auto;
}
.r12m-picker-head { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--r12-line); }
.r12m-picker-head b { font-size: 15px; line-height: 22px; font-weight: 600; }
.r12m-picker-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.r12m-picker-models { min-height: 0; padding: 8px; border-right: 1px solid var(--r12-line); overflow-y: auto; }
.r12m-picker-model { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--r12-ink); font-family: inherit; text-align: left; }
.r12m-picker-model:hover { background: var(--r12-hover); }
.r12m-picker-model.is-selected { background: var(--r12-selected-bg); }
.r12m-picker-model.is-disabled, .r12m-picker-model:disabled { opacity: .4; cursor: not-allowed; }
.r12m-picker-model.is-readonly-disabled { opacity: .4; cursor: default; }
.r12m-picker-model.is-readonly-disabled:hover { background: transparent; }
.r12m-picker-static.is-disabled, .r12m-pro-static.is-disabled { color: var(--r12-muted); }
.r12m-picker-model-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--r12-surface-3); }
.r12m-picker-model-icon svg, .r12m-picker-model-icon .r12m-vendor-icon { width: 20px; height: 20px; }
.r12m-picker-model-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.r12m-picker-model-copy b { font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r12m-picker-model-copy small { font-size: 12px; line-height: 18px; color: var(--r12-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r12m-picker-model > svg { width: 16px; height: 16px; flex: none; color: var(--r12-ink); }
.r12m-picker-params { min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.r12m-picker-field { display: flex; flex-direction: column; gap: 6px; }
.r12m-param-owner { display: flex; flex-direction: column; gap: 12px; }
.r12m-param-owner .r12m-picker-field { gap: 6px; }
.r12m-picker-label { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-picker-note { margin: 0; font-size: 13px; line-height: 20px; color: var(--r12-muted); }
.r12m-picker-segs { display: flex; flex-wrap: wrap; gap: 4px; }
.r12m-picker-seg { height: 28px; padding: 0 10px; border: 1px solid var(--r12-line); border-radius: 14px; background: transparent; color: var(--r12-muted); font-family: inherit; font-size: 12px; line-height: 18px; white-space: nowrap; }
.r12m-picker-seg.is-selected { border-color: var(--r12-ink); background: var(--r12-selected-bg); color: var(--r12-ink); }
.r12m-picker-seg.is-disabled, .r12m-picker-seg:disabled { opacity: .35; cursor: not-allowed; }
.r12m-mj-video-submit { width: calc(100% - 16px); margin: 10px 8px 4px; justify-content: center; background: var(--r12-surface-3, #f2f2f4); border: 1px solid var(--r12-line-strong, #d5d5dd); color: var(--r12-ink); }
.r12m-picker-input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; font-size: 13px; }
.r12m-picker-textarea { width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; font-size: 13px; line-height: 20px; resize: vertical; }
.r12m-picker-static { font-size: 13px; line-height: 20px; }
.r12m-picker-hint { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-picker-duration { display: flex; align-items: center; gap: 8px; }
.r12m-picker-duration input[type='range'] { flex: 1; min-width: 0; }
.r12m-picker-duration input[type='number'] { width: 64px; height: 32px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); font-family: inherit; }
.r12m-picker-switch { height: 32px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--r12-line); border-radius: 16px; background: transparent; color: var(--r12-ink); font-family: inherit; font-size: 12px; }
.r12m-picker-switch span { width: 28px; height: 16px; border-radius: 8px; background: var(--r12-line-strong); position: relative; }
.r12m-picker-switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--r12-surface); transition: transform .16s ease; }
.r12m-picker-switch.is-on span { background: var(--r12-ink); }
.r12m-picker-switch.is-on span::after { transform: translateX(12px); }
.r12m-picker-group { display: flex; flex-direction: column; gap: 10px; }
.r12m-picker-group + .r12m-picker-group { padding-top: 14px; border-top: 1px solid var(--r12-line); }
.r12m-picker-group h4 { margin: 0; font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-picker-group-body { display: flex; flex-direction: column; gap: 12px; }
.r12m-picker-pair { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; align-items: end; }
.r12m-picker-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r12m-picker-slot-thumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.r12m-picker-slot-thumbs img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.r12m-picker-slot-add { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px dashed var(--r12-line-strong); border-radius: 6px; background: transparent; color: var(--r12-muted); }
.r12m-picker-slot-add svg { width: 16px; height: 16px; }
.r12m-picker-slot-count { font-size: 12px; line-height: 18px; color: var(--r12-muted); font-variant-numeric: tabular-nums; }
.r12m-picker-foot { flex: none; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-top: 1px solid var(--r12-line); }
.r12m-picker-foot.is-readonly { justify-content: flex-end; }
.r12m-picker-cost-group { display: inline-flex; align-items: baseline; gap: 6px; }
.r12m-picker-cost-group .r12m-picker-cost-unit { margin-left: 0; }
.r12m-picker-cost { font-size: 13px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.r12m-picker-cost-note { font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-picker-cost-unit, .r12m-pro-cost-unit { margin-left: 6px; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--r12-muted); }

/* 五稿二·8：分模左栏 MJ 参数三组，不折叠；参考槽带 40 缩略图和计数，权重挨着槽。 */
.r12m-mj-group { display: flex; flex-direction: column; gap: 12px; }
.r12m-mj-group + .r12m-mj-group { padding-top: 12px; border-top: 1px solid var(--r12-line); }
.r12m-mj-group-title { margin: 0; font-size: 12px; line-height: 18px; font-weight: 600; color: var(--r12-muted); }
.r12m-mj-pair { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; align-items: end; }
.r12m-mj-thumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.r12m-mj-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.r12m-mj-slot { height: auto; min-height: 40px; align-items: center; padding: 4px; border: 1px dashed var(--r12-line-strong); border-radius: 8px; }
.r12m-mj-add { box-sizing: border-box; width: 40px; height: 40px; display: grid; place-items: center; border: 1px dashed var(--r12-line-strong); border-radius: 6px; color: var(--r12-muted); }
.r12m-mj-slot .r12m-mj-thumbs svg { width: 16px; height: 16px; }
.r12m-mj-count { margin-left: 6px; font-size: 12px; color: var(--r12-muted); white-space: nowrap; }

/* 五稿二·8·4：结果按组排，每组一行等高；尺寸来自原图像素，不放大。 */
.r12m-result-grid { display: flex; flex-direction: column; gap: 18px; }
.r12m-result-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; --r12m-row-h: 240px; }
@media (max-width: 1600px) { .r12m-result-group { --r12m-row-h: 220px; } }
@media (max-width: 1360px) { .r12m-result-group { --r12m-row-h: 200px; } }
.r12m-group-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-group-head b { min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--r12-ink); }
.r12m-group-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-group-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; min-width: 0; overflow: visible; }
.r12m-mj-quad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: min(100%, 720px); border-radius: 8px; overflow: hidden; }
/* 盖老规则：MJ 四宫格单元格宽度按网格走，去掉单图的固定高度 */
.r12m-mj-quad .r12m-group-image { /* 盖老规则：同上 */ width: 100%; height: auto !important; }
.r12m-group-image { position: relative; flex: none; width: auto; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: var(--r12-r-media); background: var(--r12-surface-2); overflow: hidden; cursor: zoom-in; }
.r12m-group-image .r12-card-media { position: relative; width: 100%; height: 100%; aspect-ratio: auto; container-type: inline-size; }
.r12m-group-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r12m-result-actions.is-mj { flex-wrap: wrap; }
.r12m-result-actions.is-mj .r12m-result-cost { margin-left: auto; }
.r12m-result-actions.is-mj .r12m-cost-info { width: 28px; height: 28px; line-height: 28px; }

/* 五稿二·2：会话里的结果不再撑成大卡片，按媒体宽度左对齐。 */
.r12m-chat-content .result-card,
.r12m-chat-content .r12m-result {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.r12m-chat-content .result-card { width: min(640px, 100%); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.r12m-chat-content .result-card:has(.result-media.image-grid) { width: min(720px, 100%); }
.r12m-chat-content .result-card > * { max-width: 100%; }
.r12m-chat-content .result-card .result-media.video-cover { width: 100%; }
.r12m-chat-content .result-card .result-media.image-grid { width: 100%; }
.r12m-chat-content .result-card .r12m-result-actions,
.r12m-chat-content .result-card .r12m-notice,
.r12m-chat-content .result-card .r12m-suggest { width: 100%; }
.r12m-chat-content .result-card .result-prompt { width: 100%; margin: 0; }

/* 五稿二·3：模拟完成时结果上方 12/18「视频已生成」，2 秒淡出、不占位置。 */
.r12m-chat-content .r12m-result { position: relative; }
.r12m-generated-toast {
  position: absolute;
  left: 0;
  top: -22px;
  font-size: 12px;
  line-height: 18px;
  color: var(--r12-muted);
  pointer-events: none;
  animation: r12m-generated-fade 2s ease forwards;
}
@keyframes r12m-generated-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* 五稿二·6：项目页底部条里直接打字、发送；回复第一句出现在条上方，不切右侧栏。 */
/* 1106 输入框根治：底部条输入同样只做文字层，圆角/边框/阴影/背景都由
   .r12m-dock 提供，输入本身不再画第二层圆角框。 */
.r12m-dock-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  max-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  caret-color: var(--r12-ink);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 22px;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.r12m-dock-input:focus,
.r12m-dock-input:focus-visible { outline: none; box-shadow: none; }
.r12m-dock-input::placeholder { color: var(--r12-faint); }
.r12m-dock-float {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(690px, max(560px, 40vw));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  pointer-events: none;
}
.r12m-dock-reply {
  position: static;
  width: 100%;
  min-height: 36px;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--r12-line);
  border-radius: 12px;
  background: var(--r12-pop-bg);
  color: var(--r12-muted);
  font-size: 12px;
  line-height: 18px;
  box-shadow: var(--r12-shadow-pop);
  pointer-events: auto;
}
.r12m-dock-reply.is-visible { display: flex; }
.r12m-dock-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-dock-full { flex: none; padding: 0; border: 0; background: transparent; color: var(--r12-ink); font-family: inherit; font-size: 12px; line-height: 18px; }
.r12m-dock [data-action='r12m-dock-expand'] {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  flex: none;
}

/* 修正单 24：主控附件条、消息附件卡、分模参考槽。 */
.r12m-attach-bar { position: relative; flex: 0 0 100%; order: -1; min-width: 0; display: flex; align-items: center; align-content: flex-start; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.r12m-attach-chip { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 8px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface-3); font-size: 12px; line-height: 18px; }
.r12m-attach-chip > svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12m-attach-chip b { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.r12m-attach-chip small { color: var(--r12-muted); white-space: nowrap; }
.r12m-attach-count { color: var(--r12-muted); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r12m-attach-more { position: absolute; left: 0; bottom: 0; height: 24px; padding: 0 7px; border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface-3); color: var(--r12-ink); font: inherit; font-size: 12px; line-height: 22px; cursor: pointer; }
/* 九稿二轮 75：右侧栏/创作页附件两行；计数占右侧一列，+N 留在胶囊流里，互不压字。 */
.r12m-attach-bar.is-capped { box-sizing: border-box; min-height: 43px; padding-right: 104px; }
.r12m-attach-bar.is-capped .r12m-attach-meta { position: absolute; top: 0; right: 0; }
.r12m-attach-bar.is-capped .r12m-attach-more { box-sizing: border-box; position: static; flex: none; height: 28px; padding: 0 7px; line-height: 26px; }
.r12m-attach-overflow-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 12px; border-bottom: 1px solid var(--r12-line); }
.r12m-attach-overflow-row:last-child { border-bottom: 0; }
.r12m-attach-overflow-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.r12m-attach-overflow-row small { flex: none; color: var(--r12-muted); font-size: 12px; }
.r12m-msg-attach { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.r12m-msg-attach-card { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface-3); font-size: 12px; line-height: 18px; }
.r12m-msg-attach-card > svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12m-msg-attach-card b { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.r12m-msg-attach-card small { color: var(--r12-muted); }
.r12m-mj-thumb-wrap { position: relative; display: inline-flex; flex: none; }
.r12m-mj-thumb-wrap.is-audio { height: 40px; align-items: center; gap: 4px; padding: 0 24px 0 6px; border: 1px solid var(--r12-line); border-radius: 8px; font-size: 11px; color: var(--r12-muted); }
.r12m-mj-thumb-wrap.is-audio > svg { width: 14px; height: 14px; flex: none; }
.r12m-mj-thumb-wrap.is-audio > span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-slot-pair { display: flex; gap: 8px; min-width: 0; }
.r12m-slot-one { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.r12m-slot-one > span { font-size: 11px; line-height: 16px; color: var(--r12-muted); }
.r12m-slot-x { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--r12-surface); color: var(--r12-muted); }
.r12m-slot-x svg { width: 10px; height: 10px; }
.r12-menu-item[aria-disabled='true'] { opacity: .35; cursor: not-allowed; }

/* 六稿：主控里的一键成片卡 */
.r12m-intake-card, .r12m-oneclick-ask, .r12m-plan-card, .r12m-stop-card { width: 100%; max-width: 720px; border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface); overflow: hidden; }
.r12m-intake-head, .r12m-oneclick-head, .r12m-plan-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--r12-line); }
.r12m-intake-head b, .r12m-oneclick-head b, .r12m-plan-head b { font-size: 14px; line-height: 22px; font-weight: 600; }
.r12m-oneclick-head { justify-content: space-between; }
.r12m-oneclick-head span, .r12m-plan-head span { color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-card-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--r12-surface-3); color: var(--r12-muted); }
.r12m-card-mark svg { width: 14px; height: 14px; }
.r12m-intake-rows { display: flex; flex-direction: column; }
.r12m-intake-row { display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto minmax(0, 1.5fr); gap: 8px; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--r12-line); font-size: 12px; line-height: 18px; color: var(--r12-muted); }
.r12m-intake-row:first-child { border-top: 0; }
.r12m-intake-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--r12-ink); font-weight: 500; }
.r12m-intake-action { color: var(--r12-ink); }
.r12m-intake-actions, .r12m-oneclick-foot, .r12m-plan-foot, .r12m-stop-card footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--r12-line); }
.r12m-oneclick-questions { display: flex; flex-direction: column; }
.r12m-oneclick-question { padding: 12px 14px; border-top: 1px solid var(--r12-line); }
.r12m-oneclick-question:first-child { border-top: 0; }
.r12m-oneclick-question h4 { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 600; }
.r12m-oneclick-options { display: flex; flex-wrap: wrap; gap: 6px; }
.r12m-oneclick-option { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--r12-line); border-radius: 8px; background: transparent; color: var(--r12-ink); font-family: inherit; font-size: 12px; line-height: 18px; }
.r12m-oneclick-option.is-selected { border-color: var(--r12-ink); background: var(--r12-selected-bg); }
.r12m-oneclick-option small { padding: 0 4px; border-radius: 4px; background: var(--r12-surface-3); color: var(--r12-muted); font-size: 10px; line-height: 16px; }
.r12m-oneclick-done { color: var(--r12-muted); font-size: 12px; }
.r12m-plan-settings { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--r12-line); }
.r12m-plan-settings span { padding: 4px 8px; border: 1px solid var(--r12-line); border-radius: 6px; font-size: 12px; line-height: 18px; }
.r12m-plan-stops { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 12px; font-size: 12px; line-height: 18px; }
.r12m-plan-stops > span { color: var(--r12-muted); }
.r12m-plan-stops b { font-weight: 500; }
.r12m-plan-total { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--r12-line); color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-plan-total span:first-child { color: var(--r12-ink); font-weight: 600; }
.r12m-stop-card { max-width: 520px; }
.r12m-stop-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--r12-line); }
.r12m-stop-card header b { font-size: 13px; line-height: 20px; }
.r12m-stop-card header span { color: var(--r12-muted); font-size: 11px; }
.r12m-stop-card p { margin: 8px 12px 0; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-stop-card p strong { color: var(--r12-ink); font-weight: 500; }
.r12m-stop-card footer { padding: 10px 12px; justify-content: flex-start; }
.r12m-card-frame { width: min(720px, 100%); max-width: 100%; }
.r12m-card-frame > * { width: 100%; max-width: 100%; box-sizing: border-box; }
.r12m-plan-pending { padding: 14px; border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface); color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-stop-inline { width: min(520px, 100%); height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 10px; background: var(--r12-surface); font-size: 12px; line-height: 18px; }
.r12m-stop-inline > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-stop-x { width: 24px; height: 24px; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.r12m-stop-x:hover { background: var(--r12-hover); }
.r12m-dock-reply .r12m-intake-card, .r12m-dock-reply .r12m-stop-card, .r12m-dock-reply .r12m-stop-inline { margin-bottom: 6px; background: var(--r12-surface); }

/* 七稿：会话分区、拖动、排序 */
.r12m-history-tools { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px 8px; }
.r12m-history-sort { flex: none; padding: 6px 12px 10px; border-top: 1px solid var(--r12-line); }
.r12m-recent-drop { display: flex; flex-direction: column; gap: 2px; min-height: 8px; }
.r12m-partition-children { padding-left: 12px; }
.r12m-new-partition { height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 8px; background: transparent; color: var(--r12-ink); font: inherit; font-size: 12px; }
.r12m-new-partition:hover { background: var(--r12-hover); }
.r12m-sort-btn { height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--r12-muted); font: inherit; font-size: 12px; }
.r12m-sort-btn:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-partition { margin: 0 0 4px; }
.r12m-partition-row { height: 32px; display: flex; align-items: center; gap: 4px; margin: 0 8px; padding: 0 4px; border-radius: 10px; color: var(--r12-muted); }
.r12m-partition-row:hover { background: var(--r12-hover); }
.r12m-partition-row.is-dragging { opacity: .35; }
.r12m-partition-fold { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--r12-muted); }
.r12m-partition-fold svg { width: 14px; height: 14px; }
.r12m-partition-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; border: 0; background: transparent; color: var(--r12-ink); font: inherit; font-size: 13px; font-weight: 600; }
.r12m-partition-actions { display: flex; gap: 2px; opacity: 0; }
.r12m-partition-row:hover .r12m-partition-actions,
.r12m-partition-row:focus-within .r12m-partition-actions { opacity: 1; }
.r12m-partition-action { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--r12-muted); }
.r12m-partition-action:hover { background: var(--r12-surface-3); color: var(--r12-ink); }
.r12m-partition-sessions { display: flex; flex-direction: column; gap: 8px; min-height: 4px; padding: 2px 0; }
.r12m-partition-sessions[hidden] { display: none; }
.r12m-partition-drop { min-height: 8px; }
.r12m-partition-empty { padding: 4px 34px 6px; color: var(--r12-faint); font-size: 12px; }
.r12m-partition-rename { height: 28px; min-width: 0; flex: 1; padding: 0 6px; border: 1px solid var(--r12-ink); border-radius: 6px; background: var(--r12-surface); color: var(--r12-ink); font: inherit; font-size: 13px; }
.r12m-drag-ghost { position: fixed; z-index: 20000; max-width: 220px; height: 32px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--r12-line-strong); border-radius: 10px; background: var(--r12-pop-bg); color: var(--r12-ink); font-size: 14px; box-shadow: var(--r12-shadow-pop); opacity: .78; pointer-events: none; }
/* 1106：拖动指示只留 2px 插入竖线，蓝色小圆点样式整条删除。
   生成端（r12-master.js）也只创建 .r12m-drop-line，不再创建任何圆点节点。 */
.r12m-drop-line { position: fixed; z-index: 20001; height: 2px; background: var(--r12-accent-user, #3377F7); pointer-events: none; }
.r12m-chat-new { position: absolute; z-index: 4; min-width: 0; min-height: 0; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface); color: var(--r12-ink); }
.r12m-chat-new:hover { background: var(--r12-hover); }
.r12m-chat-new svg { width: 14px; height: 14px; }
.r12m-chat-history { position: absolute; z-index: 4; border: 0; background: transparent; color: var(--r12-muted); }
.r12m-chat-history:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-disclaimer,
.r12-disclaimer {
  display: block;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 4px auto 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--r12-bg);
  color: var(--r12-muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.r12m-confirm-card { border: 1px solid var(--r12-line); border-radius: 12px; background: var(--r12-surface); padding: 12px 14px; }
.r12m-confirm-card h3 { margin: 0 0 8px; font-size: 14px; line-height: 22px; font-weight: 600; }
.r12m-confirm-card p { margin: 0; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-confirm-rows { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.r12m-confirm-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; font-size: 12px; line-height: 18px; }
.r12m-confirm-row > span { color: var(--r12-muted); }
.r12m-confirm-row > strong { color: var(--r12-ink); font-weight: 500; }
.r12m-confirm-actions { display: flex; gap: 8px; }
.r12m-confirm-card.is-done { border-color: var(--r12-line); }

/* ── 七稿 36：输入框两层、发送键、@/模型、底部条 ─────────────── */

.r12m-composer-stack { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.r12m-context {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  width: calc(100% - 40px);
  height: 32px;
  flex: none;
  margin: 0 auto -1px;
  padding: 0 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--r12m-master-line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--r12-surface-3) 82%, var(--r12-bg));
  color: var(--r12-muted);
}
.r12m-context-main {
  min-width: 0;
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  text-align: left;
}
.r12m-context-main span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-context-main svg { width: 13px; height: 13px; flex: none; }
/* 九稿二轮 0.6：上下文条三样——范围、本页、项目记忆。 */
.r12m-ctx-toggle { flex: none; height: 24px; display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border: 1px solid var(--r12-line); border-radius: 12px; background: transparent; color: var(--r12-muted); font: inherit; font-size: 11px; line-height: 16px; cursor: pointer; }
.r12m-ctx-toggle.is-on, .r12m-ctx-toggle[aria-pressed="true"] { border-color: var(--r12-selected-border); background: var(--r12-selected-bg); color: var(--r12-ink); }
.r12m-ctx-toggle svg { width: 12px; height: 12px; }
.r12m-ctx-memory { flex: none; height: 24px; display: inline-flex; align-items: center; border: 1px solid var(--r12-line); border-radius: 12px; overflow: hidden; }
.r12m-ctx-memory.is-on { border-color: var(--r12-selected-border); background: var(--r12-selected-bg); }
.r12m-ctx-memory .r12m-ctx-toggle { height: 22px; padding: 0 6px 0 2px; border: 0; border-radius: 0; background: inherit; }
.r12m-ctx-memory-open { height: 22px; padding: 0 2px 0 7px; border: 0; background: inherit; color: var(--r12-muted); font: inherit; font-size: 11px; cursor: pointer; }
.r12m-ctx-memory.is-on .r12m-ctx-memory-open { color: var(--r12-ink); }
/* 九稿二轮 75：勾那半边跟名字、跟〔本页〕同一底色，只在悬停时出灰底。 */
.r12m-ctx-toggle:hover { background: var(--r12-hover); }
.r12m-ctx-memory .r12m-ctx-toggle:hover { background: var(--r12-hover); }
.r12m-ctx-memory-open:hover { background: var(--r12-hover); }
.r12m-page-panel-group { margin-top: 6px; }
.r12m-page-panel-group b { display: block; font-size: 12px; line-height: 18px; color: var(--r12-ink); }
.r12m-page-panel-group p { margin: 0; color: var(--r12-muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.r12m-memory-panel { padding: 4px 12px 10px; }
.r12m-memory-note { margin: 0 0 8px; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-memory-group { margin-top: 8px; }
.r12m-memory-group h4 { margin: 0 0 3px; font-size: 12px; line-height: 18px; }
.r12m-memory-group p { margin: 0 0 3px; color: var(--r12-muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.r12m-context-x { width: 22px; height: 22px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); opacity: 0; }
.r12m-context:hover .r12m-context-x, .r12m-context:focus-within .r12m-context-x { opacity: 1; }
.r12m-context-x svg { width: 12px; height: 12px; }
.r12m-context-episodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px 6px 8px; }
.r12m-context-ep { height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--r12-muted); font: inherit; font-size: 12px; }
.r12m-context-ep:hover, .r12m-context-ep.is-current { background: var(--r12-selected-bg); color: var(--r12-ink); }
/* 八稿 58：悬浮条上方的小框也按卡片圆角内侧收 20，底边压住卡片的 1px 边框（holder 的 gap 是 4）。 */
.r12m-dock-holder > .r12m-context { width: calc(min(690px, max(560px, 40vw)) - 40px); margin-bottom: -5px; }

.r12-composer { min-height: 118px; }
.r12m-dock-row { min-height: 62px; height: auto; }
.r12m-dock-input { height: 50px; max-height: 50px; padding: 3px 12px; line-height: 22px; }
.r12m-dock-max, .r12m-side-min, .r12m-side-open { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid var(--r12-line); background: var(--r12-surface-3); color: var(--r12-muted); }
.r12m-dock-max svg, .r12m-side-min svg, .r12m-side-open svg { width: 14px; height: 14px; }
.r12m-dock-max:hover, .r12m-side-min:hover, .r12m-side-open:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-side-head .r12m-side-open, .r12m-side-head .r12m-side-min { border: 0; background: transparent; color: var(--r12-muted); }
.r12m-side-head .r12m-side-open:hover, .r12m-side-head .r12m-side-min:hover { color: var(--r12-ink); }

.r12-send2 {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--r12-surface-3);
  color: var(--r12-muted);
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease), opacity var(--r12-dur-2) var(--r12-ease);
}
.r12-send2 svg { width: 17px; height: 17px; display: block; }
.r12-send2.is-idle { opacity: .55; }
.r12-send2.is-ready { background: var(--r12-accent-user, #3377F7); color: #fff; }
.r12-send2.is-running { background: var(--r12-ink); color: var(--r12-bg); }
.r12-send2-stop { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.r12-send2[aria-disabled='true'] { cursor: default; }

.r12m-attach-capsule { height: 28px; max-width: 160px; display: inline-flex; flex: none; align-items: center; gap: 5px; padding: 0 4px 0 8px; border: 1px solid var(--r12-line); border-radius: 8px; background: var(--r12-surface-3); font-size: 12px; line-height: 18px; }
.r12m-attach-capsule b { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.r12m-attach-capsule[hidden] { display: none; }
.r12m-attach-capsule small { flex: none; color: var(--r12-muted); }
.r12m-attach-type { display: inline-flex; flex: none; color: var(--r12-muted); }
.r12m-attach-type svg { width: 14px; height: 14px; }
/* 九稿 68：拖进来的图片 / 视频附件用 24×24 缩略图，不再按文件名画文档图标。 */
.r12m-attach-capsule.is-thumb { padding-left: 2px; }
.r12m-attach-thumb { position: relative; width: 24px; height: 24px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--r12-surface-2); }
.r12m-attach-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.r12m-attach-play { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-40%, -50%); border-left: 7px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
.r12m-attach-preview { position: fixed; z-index: 12000; width: 320px; max-height: 300px; overflow: auto; padding: 10px; border: 1px solid var(--r12-line-strong); border-radius: 12px; background: var(--r12-pop-bg); box-shadow: var(--r12-shadow-pop); color: var(--r12-ink); }
.r12m-attach-preview header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.r12m-attach-preview header b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.r12m-attach-preview header small { color: var(--r12-muted); font-size: 11px; }
.r12m-attach-preview img, .r12m-attach-preview video { display: block; width: 100%; max-height: 230px; object-fit: contain; border-radius: 8px; background: var(--r12-surface-2); }
.r12m-attach-text { margin: 0; color: var(--r12-muted); font-family: inherit; font-size: 12px; line-height: 20px; white-space: pre-wrap; }
.r12m-attach-video span, .r12m-attach-empty { display: block; margin-top: 6px; color: var(--r12-muted); font-size: 12px; }

.r12m-menu-foot { padding: 8px 12px 10px; border-top: 1px solid var(--r12-line); color: var(--r12-faint); font-size: 12px; line-height: 18px; }
/* 修正单 40：命令菜单的 Esc 提示固定在底部，列表在它上面滚。 */
.r12m-command-menu .r12m-menu-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--r12-pop-bg);
}
/* 修正单 41：看大图遮罩从顶栏底边开始，卡片上边再留 8。 */
.r12-lightbox { top: var(--r12-lightbox-top, 0px); }
.r12-lightbox-card { max-height: calc(100vh - var(--r12-lightbox-top, 0px) - 16px); }
.r12m-command-menu { overflow-y: auto; }
.r12m-model-choice { box-sizing: border-box; height: 56px; min-height: 56px; }
.r12m-model-choice .r12m-model-icon { width: 32px; height: 32px; flex: none; }
.r12m-model-choice .r12-menu-text { min-width: 0; }
.r12m-model-choice .r12-menu-text small { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-model-choice.is-selected { background: var(--r12-selected-bg); }
/* 七稿 44：二级面板定宽，和初恋MJ 二级一样约 404；比例按 8 列排，15 个正好 8 + 7。 */
.r12m-model-submenu { box-sizing: border-box; width: 392px; max-width: calc(100vw - 24px); min-width: 0; }
.r12m-model-submenu [data-picker-seg='ratio'] {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}
.r12m-model-submenu [data-picker-seg='ratio'] .r12m-picker-seg {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}
.r12m-model-submenu .r12m-picker-field { padding: 4px 12px; }
.r12m-model-submenu .r12m-picker-label { font-size: 12px; }

.r12m-library-picker { display: flex; flex-direction: column; gap: 10px; padding: 12px; max-height: 396px; min-height: 0; overflow: hidden; }
.r12m-library-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.r12m-library-head b { font-size: 14px; line-height: 22px; }
.r12m-library-head span { color: var(--r12-muted); font-size: 12px; }
.r12m-library-search { height: 32px; }
.r12m-library-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.r12m-library-cat { height: 26px; padding: 0 9px; border: 1px solid var(--r12-line); border-radius: 13px; background: transparent; color: var(--r12-muted); font: inherit; font-size: 12px; }
.r12m-library-cat.is-current { border-color: var(--r12-accent-user, #3377F7); background: color-mix(in srgb, var(--r12-accent-user, #3377F7) 14%, transparent); color: var(--r12-ink); }
.r12m-library-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; }
.r12m-library-item { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; background: transparent; color: var(--r12-ink); font: inherit; font-size: 11px; text-align: left; }
.r12m-library-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--r12-surface-3); }
.r12m-library-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-library-item small { color: var(--r12-muted); }
.r12m-library-sources { max-height: 360px; overflow-y: auto; padding: 0 2px 6px; }
.r12m-library-source { margin-top: 8px; }
.r12m-library-source h4 { margin: 0 0 6px; padding: 0 2px; color: var(--r12-muted); font-size: 12px; line-height: 18px; font-weight: 500; }
.r12m-library-source .r12m-library-grid { padding: 0; }
.r12m-skill-settings { display: flex; flex-direction: column; gap: 12px; }
.r12m-skill-settings label { display: flex; flex-direction: column; gap: 6px; color: var(--r12-muted); font-size: 12px; line-height: 18px; }
.r12m-skill-settings input { width: 100%; }

/* ── 八稿 55：用户 10-31 晚 14 张图 ───────────────────────────── */
/* 0.3 / 1.6：只有图标的按钮，图标 16、30 正圆。 */
.r12m-tool.is-icon svg { width: 16px; height: 16px; }
/* 九稿二轮 73：底部条工具按自身宽度决定带字或收成图标。 */
.r12m-dock-tool.is-icon span,
.r12m-dock-tool.is-icon .r12m-chev { display: none; }
/* 九稿二轮 0.13：底部条单行高 56，最多 3 行文字、总高不超过 160。 */
.r12m-dock { height: auto; min-height: 56px; max-height: 160px; overflow: hidden; justify-content: flex-end; }
/* 76：行高 50，发送键居中时离条底 12；有附件时整行仍贴底。 */
.r12m-dock-row { height: auto; min-height: 50px; align-items: center; gap: 8px; }
.r12m-dock-input { flex: 1 1 200px; width: auto; min-width: 200px; height: 40px; min-height: 40px; max-height: 66px; padding: 9px 8px; line-height: 22px; resize: none; overflow-y: hidden; }
.r12m-dock-attachline { flex: none; width: 100%; min-width: 0; height: 28px; display: flex; align-items: center; gap: 6px; overflow-x: auto; overflow-y: hidden; margin: 0 0 4px; scrollbar-width: none; }
.r12m-dock-attachline::-webkit-scrollbar { width: 0; height: 0; }
.r12m-dock-attachline .r12m-attach-row { flex: 1 1 0; min-width: 0; margin: 0; order: 0; align-items: center; }
.r12m-dock-attachline .r12m-attach-bar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.r12m-dock-attachline .r12m-attach-bar::-webkit-scrollbar { width: 0; height: 0; }
.r12m-dock-attachline .r12m-attach-meta { flex-direction: row; align-items: center; gap: 4px; max-width: none; padding: 0; white-space: nowrap; }
.r12m-dock-continue { flex: none; height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--r12-line-strong); border-radius: 8px; background: var(--r12-surface-3); color: var(--r12-ink); font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.r12m-dock-continue svg { width: 14px; height: 14px; flex: none; }
.r12m-dock-continue[hidden] { display: none; }
/* 九稿二轮 73：继续钮也由底部条自己决定收不收，不再按窗口宽度写死。 */
.r12m-dock-continue.is-icon { width: 28px; padding: 0; justify-content: center; border-radius: 50%; }
.r12m-dock-continue.is-icon span { display: none; }
.r12m-dock-attachline > .r12m-page-chip { flex: none; min-width: 0; max-width: 130px; }
.r12m-dock-attachline > .r12m-page-chip .r12m-page-chip-main span { max-width: 70px; }
.r12m-dock-attach-bar {
  flex: none;
  max-width: 240px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 7px;
  border: 1px solid var(--r12-line);
  border-radius: 12px;
  color: var(--r12-muted);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.r12m-dock-attach-bar > svg { width: 14px; height: 14px; flex: none; }
.r12m-dock-attach-bar b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--r12-ink); }
.r12m-dock-attach-bar.is-thumb { padding-left: 2px; }
.r12m-dock-attach-bar .r12m-attach-thumb { width: 20px; height: 20px; border-radius: 5px; }
.r12m-dock-attach-bar .r12m-chip-x { width: 16px; height: 16px; }
.r12m-dock-attach-more { flex: none; color: var(--r12-muted); }
.r12m-dock-attach-count { flex: none; font-size: 12px; color: var(--r12-muted); }
/* 1.3：侧栏去外框投影，输入卡只留 1px 边框，圆角 8。 */
.r12m-side { box-shadow: none; }
.r12m-side .r12-composer { box-shadow: none; border: 1px solid var(--r12m-master-line); border-radius: max(0px, calc(var(--r12-r-panel) - 5px)); }
.r12m-side .r12-composer:focus-within { border-color: var(--r12-accent); }
/* 1.1：会话栏左上角两个 32 正圆；〔＋〕去方块和边框。 */
.r12m-chat-new { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); }
.r12m-chat-new:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-chat-new svg { width: 18px; height: 18px; }
/* 1.1：模式切换跟在标题右边，隔 12。 */
.r12m-top-mode { display: inline-flex; align-items: center; margin-left: 12px; }
/* 1.6：右侧栏标题行三个钮 28 正圆、图标 16、整圆浅底。 */
.r12m-side-head .r12-icon-btn { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); }
.r12m-side-head .r12-icon-btn:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-side-head .r12-icon-btn svg { width: 16px; height: 16px; }
/* 1.6：分模上传格保持方形，＋ 20。 */
.r12m-mj-slot .r12m-mj-add svg { width: 20px; height: 20px; }
.r12m-library-item[hidden] { display: none; }

/* ── 九稿 60：参数栏上传格、完整设置、结果更多、拖动进主控 ───────── */
.r12m-group-slots { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; }
.r12m-group-slots .r12m-slot-one { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r12m-slot-menu-thumb { width: 32px; height: 32px; flex: none; object-fit: cover; border-radius: 6px; }

.r12m-settings { max-height: 480px; min-width: 0; overflow-y: auto; overflow-x: hidden; }
.r12m-settings-row { box-sizing: border-box; width: 100%; min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--r12-line); background: transparent; color: var(--r12-ink); font: inherit; font-size: 12px; line-height: 18px; text-align: left; }
.r12m-settings-row:last-child { border-bottom: 0; }
.r12m-settings-row:hover { background: var(--r12-hover); }
.r12m-settings-row > span:first-child { flex: none; color: var(--r12-muted); }
/* 九稿 68：长值最多 3 行、末尾省略，悬停 title 看全文；不许横向散出面板。 */
.r12m-settings-row > b { flex: 1 1 0; min-width: 0; max-width: 100%; font-weight: 500; text-align: right; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.r12m-settings-model { flex: 1 1 0; min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.r12m-settings-model b, .r12m-settings-model small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: right; }
.r12m-settings-model b { font-weight: 500; }
.r12m-settings-model small { color: var(--r12-muted); font-size: 12px; line-height: 18px; }

.r12m-result-more { width: 28px; height: 28px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--r12-muted); }
.r12m-result-more svg { width: 16px; height: 16px; display: block; }
.r12m-result-more:hover { background: var(--r12-hover); color: var(--r12-ink); }

.r12-composer.is-ref-over, .r12m-composer.is-ref-over, .r12m-dock.is-ref-over { position: relative; }
.r12-composer.is-ref-over::after,
.r12m-composer.is-ref-over::after,
.r12m-dock.is-ref-over::after {
  content: attr(data-r12-ref-hint);
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  border: 1px solid var(--r12-accent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--r12-accent) 14%, var(--r12-surface));
  color: var(--r12-ink);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  pointer-events: none;
}

/* ── 九稿 61：读取本页、本页胶囊、拖动落点 ─────────────────────── */
.r12m-read-page { height: 24px; flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--r12-line); border-radius: 999px; background: var(--r12-surface-3); color: var(--r12-muted); font: inherit; font-size: 12px; line-height: 18px; white-space: nowrap; }
.r12m-read-page:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12m-read-page svg { width: 14px; height: 14px; flex: none; }
.r12m-page-chip { height: 26px; max-width: 100%; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 8px; border: 1px solid var(--r12-line); border-radius: 13px; background: var(--r12-surface-3); color: var(--r12-ink); font-size: 12px; line-height: 18px; }
.r12m-page-chip-main { min-width: 0; height: 24px; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; }
.r12m-page-chip-main span { min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r12m-page-chip-main svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12m-page-chip .r12m-chip-x { width: 18px; height: 18px; }
.r12m-page-panel { padding: 10px 12px; font-size: 12px; line-height: 18px; color: var(--r12-ink); }
.r12m-page-panel-title { margin-bottom: 6px; font-weight: 600; }
.r12m-page-panel p { margin: 0 0 3px; color: var(--r12-muted); overflow-wrap: anywhere; }
.r12m-chat-content .message-user, .r12m-side-body .message-user { flex-wrap: wrap; }
.r12m-side-body .message-user { row-gap: 0; }
.r12m-page-attached { flex-basis: 100%; width: 100%; margin: 4px 12px 0 auto; color: var(--r12-muted); font-size: 12px; line-height: 18px; text-align: right; }
/* 九稿 69：右侧栏里单独占一行、贴气泡右边，不再把用户气泡挤到左边。 */
.r12m-side-body .r12m-page-attached { flex: 0 0 100%; width: auto; margin: 4px 0 0; }
/* 九稿二轮 75：详情二级菜单最后一级的未选中项留空位，不再画「›」。 */
.r12-menu .r12m-menu-check-slot { width: 14px; height: 14px; flex: none; display: inline-block; }

/* 悬浮主控遮住的次级按钮暂不呈现为可点；滚出遮挡后由原状态恢复。
   visibility 不改变布局，不制造底部预留；主操作永不套用此类。 */
.r12f-content .r12m-under-dock { visibility: hidden !important; pointer-events: none !important; }

