/* SoftIP · 轻量数字人（英语舱旅客） */

.lite-dh {
    margin: 0 0 14px;
    padding: 14px 14px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(165deg, color-mix(in srgb, var(--primary-light) 70%, #fff) 0%, var(--surface) 55%);
    box-shadow: var(--shadow-md);
    transition: opacity var(--transition), transform var(--transition), border-color var(--transition);
}

/* Collapsed: keep a clear restore chip — never display:none the whole panel */
.lite-dh.is-collapsed,
.lite-dh.is-hidden {
    padding: 8px 10px;
    margin-bottom: 10px;
}

.lite-dh.is-collapsed .lite-dh-body,
.lite-dh.is-hidden .lite-dh-body {
    display: none;
}

.lite-dh.is-collapsed .lite-dh-head,
.lite-dh.is-hidden .lite-dh-head {
    margin-bottom: 0;
    display: none;
}

.lite-dh-restore {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
    background: var(--primary-light);
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.lite-dh-restore:hover {
    background: color-mix(in srgb, var(--primary-light) 70%, #fff);
    border-style: solid;
}

.lite-dh.is-collapsed .lite-dh-restore,
.lite-dh.is-hidden .lite-dh-restore {
    display: inline-flex;
}

.lite-dh.is-talking {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: var(--shadow-lg);
}

.lite-dh.is-class-stage {
    margin: 0;
    height: 100%;
}

.lite-dh.is-class-stage .lite-dh-head,
.lite-dh.is-class-stage .lite-dh-modes,
.lite-dh.is-class-stage .lite-dh-live-bar,
.lite-dh.is-class-stage .lite-dh-tip,
.lite-dh.is-class-stage .lite-dh-toggle,
.lite-dh.is-class-stage .lite-dh-restore {
    display: none;
}

.lite-dh.is-class-stage .lite-dh-body {
    display: block;
}

.lite-dh.is-class-stage .lite-dh-caption {
    display: none;
}

.lite-dh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.lite-dh-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lite-dh-title strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}

.lite-dh-title span {
    font-size: 11px;
    color: var(--text-muted);
}

.lite-dh-toggle {
    min-width: 36px;
    height: 30px;
    padding: 0 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.lite-dh-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.lite-dh-modes {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.lite-dh-mode {
    flex: 1;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.lite-dh-mode[data-dh-mode="off"] {
    display: none !important;
}

.lite-dh-mode.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.lite-dh-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lite-dh-stage canvas {
    width: min(100%, 300px);
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 0 1px rgba(26, 75, 140, 0.08);
    background: var(--bg);
}

.lite-dh-caption {
    margin: 0;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: var(--ai-bg);
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.lite-dh-video {
    display: none;
    width: min(100%, 300px);
    max-height: 340px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: #0f172a;
}

.lite-dh.mode-lite .lite-dh-video,
.lite-dh.mode-lite .lite-dh-live-bar {
    display: none !important;
}

.lite-dh.mode-lite #liteDhCanvas {
    display: block;
}

.lite-dh.mode-live .lite-dh-video {
    display: block;
}

.lite-dh.mode-live #liteDhCanvas {
    display: none;
}

.lite-dh.mode-off .lite-dh-stage {
    opacity: 0.45;
}

.lite-dh-live-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.lite-dh:not(.mode-live) .lite-dh-live-bar {
    display: none;
}

.lite-dh-live-btn {
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.lite-dh-live-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.lite-dh-tip {
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

@media (min-width: 980px) {
    .english-cabin-root.has-lite-dh .cabin-workspace {
        align-items: start;
    }
}

@media (max-width: 720px) {
    .lite-dh-stage canvas,
    .lite-dh-video {
        width: min(100%, 240px);
    }
}
