/* 数字人对话卡：打开时与人物画面并排（窄屏放到下方）。只作用于 #voice 模块。 */
#voice [hidden] { display:none !important; }
#voice .voice-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 16px; }
#voice .voice-toolbar p { margin:0; color:#39485d; font-size:13px; font-weight:550; }
#voice button { font-family:var(--ui-font); cursor:pointer; }
#voice button:disabled { cursor:default; opacity:.45; }
#voice #vi-open { flex-shrink:0; display:flex; align-items:center; gap:14px; padding:10px 17px; border:1px solid #dce6f6; border-radius:999px; color:#375e99; background:var(--ui-glass); font-size:12px; box-shadow:var(--ui-shadow); }
#voice #voice-scene { position:relative; isolation:isolate; display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
#voice #voice-scene.vi-with-chat { grid-template-columns:minmax(0,1fr) 360px; }
#voice #voice-conversation { overflow:hidden; border-radius:25px; background:#eef2f9; box-shadow:var(--ui-shadow); }
.ui-workspace #voice #voice-conversation iframe { display:block; width:100%; height:clamp(600px,calc(100dvh - 178px),820px); min-height:0 !important; border:0 !important; border-radius:0; box-shadow:none; }

#voice #voice-interaction { display:flex; flex-direction:column; height:clamp(600px,calc(100dvh - 178px),820px); border:1px solid #e3e9f3; border-radius:25px; background:#fbfcfe; box-shadow:var(--ui-shadow); color:#25364d; overflow:hidden; }
#voice .vi-card-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 14px 10px 18px; }
#voice .vi-card-heading h2 { margin:0; font-size:15px; font-weight:600; }
#voice .vi-window-actions { display:flex; gap:2px; }
#voice .vi-window-actions button { display:grid; place-items:center; width:28px; height:28px; padding:0; font-size:17px; line-height:1; border:0; border-radius:8px; background:transparent; color:#8490a0; }
#voice .vi-window-actions button:not(:disabled):hover { background:#e8edf6; color:#314e77; }

#voice .vi-scenes { display:flex; flex-wrap:wrap; gap:6px; padding:0 18px 12px; border-bottom:1px solid #8098b81b; }
#voice .vi-scenes button { padding:6px 12px; border:1px solid #d6e0ef; border-radius:999px; background:#fff; color:#4d5f78; font-size:12px; }
#voice .vi-scenes button:not(:disabled):hover { border-color:#9fb8e2; color:#2f5aa0; }
#voice .vi-scenes button[aria-pressed="true"] { border-color:transparent; background:#3169d5; color:#fff; }

#voice .vi-chat { flex:1; min-height:160px; margin:0; padding:14px 18px; list-style:none; overflow-y:auto; scrollbar-width:thin; display:flex; flex-direction:column; gap:10px; }
#voice .vi-empty { margin:auto 0; text-align:center; color:#94a0b2; font-size:12px; }
#voice .vi-msg { display:flex; flex-direction:column; max-width:86%; }
#voice .vi-msg p { margin:0; padding:9px 12px; border-radius:14px; font-size:13px; line-height:1.65; overflow-wrap:anywhere; white-space:pre-wrap; }
#voice .vi-msg-avatar { align-self:flex-start; }
#voice .vi-msg-avatar p { background:#fff; border:1px solid #e3e9f3; border-top-left-radius:4px; color:#25364d; }
#voice .vi-msg-learner { align-self:flex-end; }
#voice .vi-msg-learner p { background:#3169d5; border-top-right-radius:4px; color:#fff; }
#voice .vi-speaking { display:inline-flex; align-items:center; gap:5px; margin:4px 0 0 4px; color:#3169d5; font-size:11px; }
#voice .vi-speaking::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; animation:vi-pulse 1s ease-in-out infinite; }
#voice-interaction.vi-thinking .vi-chat::after { content:'···'; align-self:flex-start; padding:4px 12px; border-radius:14px; background:#fff; border:1px solid #e3e9f3; color:#8a97aa; font-size:18px; letter-spacing:2px; animation:vi-pulse 1.2s ease-in-out infinite; }
@keyframes vi-pulse { 50% { opacity:.35; } }

#voice .vi-notice { margin:0 18px 10px; padding:9px 12px; border:1px solid #ebdfc8; border-radius:10px; background:#fffaf1; color:#896b3c; font-size:12px; line-height:1.6; }
#voice .vi-notice a { margin-left:6px; color:#416bad; }
#voice .vi-composer { display:flex; align-items:flex-end; gap:8px; padding:12px 14px 14px; border-top:1px solid #8098b81b; }
#voice #vi-text { flex:1; min-height:40px; max-height:110px; padding:10px 12px; border:1px solid #d3dceb; border-radius:12px; color:#25364d; background:#fff; font-family:var(--ui-font); font-size:13px; line-height:1.5; resize:none; field-sizing:content; }
#voice #vi-text:focus { outline:2px solid #99b7ed; outline-offset:1px; }
#voice .vi-composer button { flex-shrink:0; height:40px; padding:0 16px; border-radius:12px; font-size:13px; }
#voice .vi-composer .vi-primary { border:0; background:linear-gradient(150deg,#4e82ec,#3169d5); color:#fff; box-shadow:0 3px 10px #2e67c929; }
#voice #vi-stop { border:1px solid #e5c9c9; background:#fff6f6; color:#b04848; }

@media(max-width:1100px) { #voice #voice-scene.vi-with-chat { grid-template-columns:minmax(0,1fr) 320px; } }
@media(max-width:900px) {
  #voice #voice-scene.vi-with-chat { grid-template-columns:minmax(0,1fr); }
  #voice #voice-interaction { height:460px; }
  .ui-workspace #voice #voice-conversation iframe { height:clamp(440px,65dvh,610px); }
}
@media(prefers-reduced-motion:reduce) { #voice .vi-speaking::before, #voice-interaction.vi-thinking .vi-chat::after { animation:none; } }
