.chat-artifact { padding:16px 0; border-top:1px solid var(--border,#dce1eb); display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.chat-artifact>video { width:100%; max-height:min(440px,40dvh); background:#101722; border-radius:12px; object-fit:contain; scroll-margin-block:96px 180px; }
.chat-artifact>b,.chat-artifact>details,.chat-artifact>ul { width:100%; }
.chat-artifact details label { display:inline-block; margin:8px 14px 8px 0; }
.chat-quality { display:flex; flex-wrap:wrap; gap:8px 16px; font-size:12px; }
.chat-quality .q-passed { color: var(--ok, #1a7f37); } .chat-quality .q-failed { color: var(--danger, #c62828); font-weight: 600; } .chat-quality .q-not_reviewed { color: var(--muted, #888); }
.chat-history { max-height:65vh; overflow:auto; }
.chat-history>div { display:flex; gap:8px; margin:12px 0; }
.chat-history>div>button:first-child { flex:1; text-align:left; }
.chat-params { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-height:60vh; overflow:auto; }
.chat-params label { display:flex; flex-direction:column; gap:6px; }
.chat-params label:has(textarea) { grid-column:1/-1; }
.chat-visual-scenes details { margin:12px 0; padding:12px; background:var(--surface,#f4f6fa); border-radius:10px; }
.chat-visual-scenes input,.chat-visual-scenes textarea,[data-chat-visual-script] { width:100%; }
.chat-log pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:400px; overflow:auto; }
@media(max-width:640px){.chat-params{grid-template-columns:1fr}.chat-history>div{flex-wrap:wrap}}

.chat-layer{border-top:1px solid var(--border,#ddd);margin-top:14px;padding-top:12px}.chat-layer-geometry{display:flex;gap:10px}.chat-layer-geometry input{max-width:90px}.chat-timing-row{display:grid!important;grid-template-columns:2fr 1fr 1fr;gap:8px}

/* 会话历史（v2）：单行标题 + 时间，操作按钮悬停出现 */
.ch-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.ch-head h3{margin:0}
.seg{display:inline-flex;background:var(--bg-3);border-radius:9px;padding:3px}
.seg button{border:0;background:none;color:var(--muted);padding:4px 12px;border-radius:7px;cursor:pointer;font:inherit;font-size:12.5px}
.seg button.on{background:var(--bg-2);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.chat-history .ch-row{display:flex;align-items:center;gap:2px;margin:0 0 2px;padding:2px;border-radius:10px}
.chat-history .ch-row:hover,.chat-history .ch-row.cur{background:var(--bg-3)}
.ch-open{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;border:0;background:none;color:var(--ink);text-align:left;padding:8px 10px;cursor:pointer;font:inherit;border-radius:8px}
.ch-open b{font-weight:500;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-open span{font-size:12px;color:var(--dim)}
.ch-row .ch-act{flex:none;width:30px;height:30px;border-radius:8px;opacity:0;transition:opacity .15s,background .15s,color .15s}
.ch-row .ch-act .ic{width:16px;height:16px}
.ch-row:hover .ch-act,.ch-row.cur .ch-act,.ch-row .ch-act:focus-visible{opacity:1}
.ch-row .ch-act:hover{background:var(--line);color:var(--ink)}
.ch-row .ch-act:last-child{margin-right:4px}
@media(hover:none){.ch-row .ch-act{opacity:1}}
.ch-empty{padding:28px;text-align:center}
/* 会话历史弹窗加宽：长标题少截断，操作图标不挤 */
.modal .box:has(.chat-history){width:min(760px,calc(100vw - 32px))}
.modal .box:has(.chat-history) .chat-history{max-height:min(65vh,640px);margin:0 -6px;padding:0 6px}
.chat-history .ch-row{flex-wrap:nowrap}
.ch-open b{font-size:14px}
.chat-confirm{display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%}.chat-confirm .hint{margin:0;font-size:12px}
.chat-quality .q-note { font-style: normal; margin-left: 4px; color: var(--warn, #b26a00); }
.q-notes { font-size: 12px; margin-top: 4px; } .q-notes ul { margin: 4px 0 0 18px; padding: 0; }
.vc-card { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 10px 12px; margin-top: 6px; display: grid; gap: 6px; }
.vc-phrase { margin: 4px 0; padding: 8px 10px; border-left: 3px solid var(--accent, #6b5cff); background: var(--soft, rgba(127,127,127,.08)); font-size: 15px; }
.vc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.long-draft { margin-top: 6px; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 6px 10px; }
.long-draft pre { white-space: pre-wrap; max-height: 360px; overflow: auto; font-size: 13px; }

/* PG-11 收尾：配音 / 多语言确认卡 */
.ac-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; display: grid; gap: 8px; }
.ac-card.done { padding: 6px 12px; font-size: 13px; }
.ac-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ac-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.ac-row > span:first-child { color: var(--muted); min-width: 3em; }

/* T7：执行过程（每条助手回复下可展开） */
.exec-proc { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.exec-proc > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; list-style: none; padding: 2px 6px; border-radius: 6px; }
.exec-proc > summary::-webkit-details-marker { display: none; }
.exec-proc > summary:hover, .exec-proc[open] > summary { background: var(--bg-2); color: var(--ink); }
.exec-proc > summary .ic { width: 14px; height: 14px; }
.exec-proc ul { margin: 6px 0 2px; padding: 8px 10px; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); display: grid; gap: 5px; }
.exec-proc li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.45; }
.exec-proc li .ic { width: 13px; height: 13px; flex: none; position: relative; top: 2px; color: var(--accent); }
.exec-proc li.wait .ic { color: var(--warn); }
.exec-proc li b { color: var(--ink); font-weight: 600; }
.exec-proc li .dim { color: var(--dim); overflow-wrap: anywhere; }
