/* 1106 音频分模补件：目录、离散任务状态与自定义播放器。 */
.ft-audio-seg { width: max-content; }
.ft-audio-preview { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ft-audio-preview > .r12-btn { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; white-space: nowrap; }
.ft-audio-preview > .r12-btn svg { display: block; flex: 0 0 14px; width: 14px; height: 14px; }
.ft-audio-preview > span { flex: 1; min-width: 0; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 11px; line-height: 18px; white-space: nowrap; }

/* 音色是同一份共享资产目录：宽区自动多列，窄栏由容器查询收成小卡单列。 */
.ft-voice-catalog { container-type: inline-size; display: grid; gap: 10px; min-width: 0; }
.ft-voice-catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ft-voice-catalog-title { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.ft-voice-catalog-title > strong { flex: none; color: var(--r12-ink, var(--ink, #eceef1)); font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.ft-voice-count { flex: none; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 11px; line-height: 18px; white-space: nowrap; }
.ft-voice-demo { display: inline-flex; flex: none; align-items: center; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--r12-surface-3, var(--surface-3, #2a2f34)); color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 10px; line-height: 18px; white-space: nowrap; }
.ft-voice-catalog-head > .r12-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 4px; min-height: 30px; padding: 0 9px; white-space: nowrap; }
.ft-voice-catalog-head > .r12-btn svg { width: 14px; height: 14px; }
.ft-voice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; min-width: 0; align-items: stretch; }
.ft-voice-item { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 108px; padding: 10px; overflow: hidden; border: 1px solid var(--r12-line, var(--line-strong, #30363d)); border-radius: 10px; background: var(--r12-surface-2, var(--surface-2, #202428)); color: var(--r12-ink, var(--ink, #eceef1)); }
.ft-voice-item.is-selected { border-color: var(--r12-selected-border, var(--accent, #d9a06f)); background: var(--r12-selected-bg, var(--surface-2, #202428)); box-shadow: inset 0 0 0 1px var(--r12-selected-border, var(--accent, #d9a06f)); }
.ft-voice-item-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ft-voice-select { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--r12-ink, var(--ink, #eceef1)); text-align: left; }
button.ft-voice-select { cursor: pointer; }
button.ft-voice-select:hover strong { text-decoration: underline; text-underline-offset: 3px; }
button.ft-voice-select:focus-visible { border-radius: 4px; outline: 2px solid var(--r12-selected-border, var(--accent, #d9a06f)); outline-offset: 2px; }
.ft-voice-select > strong { min-width: 0; overflow: hidden; color: inherit; font-size: 13px; line-height: 20px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ft-voice-choice { flex: none; margin-left: auto; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 10px; line-height: 18px; }
.ft-voice-item.is-selected .ft-voice-choice { color: var(--r12-ink, var(--ink, #eceef1)); font-weight: 600; }
.ft-voice-version { display: inline-flex; flex: none; align-items: center; justify-content: center; height: 18px; min-width: 25px; padding: 0 5px; border: 1px solid var(--r12-line, var(--line-strong, #30363d)); border-radius: 999px; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 10px; line-height: 16px; font-variant-numeric: tabular-nums; }
.ft-voice-desc { margin: 4px 0 8px; overflow: hidden; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 11px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.ft-voice-item-foot { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: auto; }
.ft-voice-status { flex: none; margin-right: auto; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 10px; line-height: 18px; white-space: nowrap; }
.ft-voice-status.is-queued, .ft-voice-status.is-running { color: var(--r12-ink, var(--ink, #eceef1)); }
.ft-voice-item-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.ft-voice-item-actions .r12-btn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 26px; height: 26px; padding: 0 6px; font-size: 11px; line-height: 1; white-space: nowrap; }
.ft-voice-item-actions .r12-btn svg { flex: none; width: 12px; height: 12px; }
.ft-voice-play.is-playing { border-color: var(--r12-selected-border, var(--line-strong, #30363d)); background: var(--r12-surface-3, var(--surface-3, #2a2f34)); color: var(--r12-ink, var(--ink, #eceef1)); }
.ft-voice-progress { flex: none; height: 2px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: var(--r12-line, var(--line, #30363d)); }
.ft-voice-progress i { display: block; width: 0; height: 100%; background: var(--r12-accent-user, var(--accent, #d9a06f)); }
.ft-voice-progress.is-succeeded i { width: 100%; }
.ft-voice-progress.is-queued i, .ft-voice-progress.is-running i { width: 32%; animation: ft-voice-indeterminate 1s ease-in-out infinite alternate; }
.ft-voice-progress.is-draft i { width: 0; }
@container (max-width: 520px) {
  .ft-voice-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ft-voice-item { min-height: 104px; padding: 9px; }
}
@container (max-width: 340px) {
  .ft-voice-catalog-head { align-items: flex-start; }
  .ft-voice-catalog-title { flex-wrap: wrap; gap: 2px 6px; padding-top: 1px; }
  .ft-voice-catalog-head > .r12-btn { padding: 0 7px; }
}

.ft-voice-design { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--r12-line, var(--line-strong, #30363d)); border-radius: 10px; background: var(--r12-surface-2, var(--surface-2, #202428)); }
.ft-voice-design-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ft-voice-design-head span, .ft-voice-design p { margin: 0; color: var(--r12-muted, var(--muted, #a0a7b0)); font-size: 11px; line-height: 18px; }
.ft-voice-design label { display: grid; gap: 3px; color: var(--r12-ink, var(--ink, #eceef1)); font-size: 12px; }
/* 作用域覆盖通用 .r12-input 的 32px 单行高：默认完整显示 3 行，可纵向拉高；长文由脚本随输入增高。 */
.ft-voice-design textarea.r12-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: auto;
  min-height: 78px;
  padding: 7px 10px;
  line-height: 20px;
  white-space: pre-wrap;
  overflow-y: auto;
  resize: vertical !important;
}
.ft-voice-design-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ft-voice-design-actions .r12-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.ft-voice-design-actions .ft-voice-play { margin-right: auto; }
.ft-voice-design-actions .ft-voice-play svg { width: 14px; height: 14px; }
.ft-audio-result { min-width: 0; }
.ft-audio-text { margin: 10px 0 12px; color: var(--ink, #eceef1); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ft-audio-media { display: none; }
.ft-audio-controls { display: flex; align-items: center; gap: 8px; }
.ft-audio-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.ft-audio-seek { flex: 1; min-width: 60px; accent-color: var(--accent, #d9a06f); }
.ft-audio-time { flex: 0 0 auto; color: var(--muted, #a0a7b0); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ft-audio-rate { flex: 0 0 auto; }
/* 打开时由脚本挂到 body，用 fixed 逃出结果卡滚动容器的裁切；left/top 由碰撞计算写入。 */
.ft-audio-rate-menu { position: fixed; z-index: 12000; display: grid; max-height: calc(100dvh - 16px); overflow-y: auto; min-width: 88px; padding: 4px; border: 1px solid var(--line-strong, #30363d); border-radius: 8px; background: var(--surface-2, #202428); box-shadow: 0 8px 24px rgb(0 0 0 / .22); }
.ft-audio-rate-menu[hidden] { display: none; }
.ft-audio-rate-menu button { min-height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ink, #eceef1); text-align: left; }
.ft-audio-rate-menu button:hover, .ft-audio-rate-menu button:focus-visible { background: var(--surface-3, #2a2f34); }
.ft-audio-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 8px; color: var(--muted, #a0a7b0); font-size: 11px; }
.ft-audio-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ft-audio-actions .r12-btn { text-decoration: none; }
[data-mode="light"] .ft-voice-select, [data-mode="light"] .ft-audio-text { color: var(--r12-ink, var(--ink, #1d2025)); }
@media (max-width: 1100px) {
  .ft-audio-controls { flex-wrap: wrap; }
  .ft-audio-seek { order: 5; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ft-voice-progress.is-queued i, .ft-voice-progress.is-running i { width: 100%; animation: none; }
}
@keyframes ft-voice-indeterminate { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
