/* ============================================================
   voice-lab.css —— 语音通话 / 视频通话 / 声音工坊
   ------------------------------------------------------------
   通话界面由 voice-lab.js 动态创建（自注入 DOM + 本样式），
   所以这里的选择器全部以 .vl- 开头，不与站内既有类名打架。
   ============================================================ */

.vl-call {
    position: fixed;
    inset: 0;
    z-index: 95000;
    display: flex;
    flex-direction: column;
    background: radial-gradient(1000px 520px at 50% -10%, #252b3d, #111319 72%);
    color: #e8eaf0;
    overflow: hidden;
}
.vl-call[hidden] { display: none !important; }

.vl-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.vl-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #2b3040; }
.vl-head .vl-name { font-weight: 700; }
.vl-head .vl-sub { font-size: .75em; color: #9aa0ae; }
.vl-head .vl-spacer { flex: 1; }

.vl-icon-btn {
    border: 0;
    background: rgba(255, 255, 255, .07);
    color: #e8eaf0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.15em;
    display: grid;
    place-items: center;
    transition: background .15s ease, color .15s ease;
}
.vl-icon-btn:hover { background: rgba(255, 255, 255, .16); }
.vl-icon-btn.on { background: rgba(230, 199, 138, .22); color: #e6c78a; }
.vl-icon-btn.danger { background: #c04a56; color: #fff; }

.vl-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 18px; }

.vl-orb { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; }
.vl-orb img { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; background: #2b3040; }
.vl-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(230, 199, 138, .55); opacity: 0; }
.vl-call[data-state='listening'] .vl-ring { opacity: 1; animation: vl-pulse 1.6s ease-out infinite; }
.vl-call[data-state='thinking'] .vl-ring { opacity: 1; border-color: rgba(180, 140, 255, .7); animation: vl-pulse 1.9s ease-out infinite; }
.vl-call[data-state='speaking'] .vl-ring { opacity: 1; border-color: rgba(140, 200, 255, .7); animation: vl-pulse 1.1s ease-out infinite; }
@keyframes vl-pulse {
    0% { transform: scale(.92); opacity: .85; }
    100% { transform: scale(1.35); opacity: 0; }
}

.vl-video {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: min(30vw, 220px);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #000;
    transform: scaleX(-1);
}
.vl-video[hidden] { display: none !important; }

.vl-status {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .42);
    font-size: .82em;
    color: #cfd4e0;
    white-space: nowrap;
}
.vl-caption {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    max-width: min(760px, 92%);
    text-align: center;
    font-size: 1.02em;
    line-height: 1.6;
    color: #f2f4f9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}

.vl-log { max-height: 24vh; overflow-y: auto; padding: 0 18px 10px; display: flex; flex-direction: column; gap: 8px; }
.vl-line { display: flex; gap: 8px; font-size: .85em; line-height: 1.55; }
.vl-line .who { flex: none; color: #e6c78a; font-weight: 700; }
.vl-line.me .who { color: #8fd8ff; }
.vl-line .txt { color: #c8ccd8; white-space: pre-wrap; word-break: break-word; }

.vl-foot { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 18px 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.vl-mic {
    width: 64px; height: 64px; border-radius: 50%; border: 0;
    background: #e6c78a; color: #22242c; font-size: 1.6em;
    cursor: pointer; display: grid; place-items: center; transition: transform .15s ease;
}
.vl-mic:hover { transform: scale(1.05); }
.vl-mic.rec { background: #e0575f; color: #fff; animation: vl-pulse 1.4s ease-out infinite; }
.vl-foot-tip { text-align: center; font-size: .75em; color: #8d93a2; padding-bottom: 10px; min-height: 1.2em; }

/* ---------------- 声音工坊（实验室面板内） ---------------- */
.vl-hr { border: 0; border-top: 1px dashed #4a4e5c; margin: 14px 0; }
.vl-lab-title { margin: 0 0 8px; font-size: .95em; color: #e6c78a; }
.vl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.vl-field label { font-size: .85em; color: #bbb; }
.vl-field input, .vl-field textarea, .vl-field select {
    width: 100%; padding: 9px 10px; border-radius: 8px;
    border: 1px solid #4b505f; background: #20232c; color: #eee;
    font: inherit; font-size: .88em;
}
.vl-field textarea { min-height: 76px; resize: vertical; }
.vl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vl-profiles { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vl-profile {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border: 1px solid #414653; border-radius: 10px; background: rgba(255, 255, 255, .03);
}
.vl-profile.active { border-color: #e6c78a; background: rgba(230, 199, 138, .1); }
.vl-profile .meta { flex: 1; min-width: 0; }
.vl-profile b { display: block; font-size: .92em; }
.vl-profile small { display: block; color: #9198a6; font-size: .75em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .72em; color: #b9bfcd; margin-right: 6px; }
.vl-empty { color: #8d93a2; font-size: .84em; padding: 6px 0; }

body.light-theme .vl-call { background: radial-gradient(1000px 520px at 50% -10%, #f2f4fa, #dfe3ee 72%); color: #252932; }
body.light-theme .vl-log .txt, body.light-theme .vl-head .vl-sub { color: #4a5160; }
body.light-theme .vl-icon-btn { background: rgba(0, 0, 0, .06); color: #252932; }
body.light-theme .vl-status { background: rgba(255, 255, 255, .7); color: #3a4050; }

@media (max-width: 560px) {
    .vl-video { width: 38vw; right: 10px; bottom: 10px; }
    .vl-mic { width: 56px; height: 56px; }
    .vl-log { max-height: 20vh; }
}
