.digital-human-layout {
    display: flex;
    height: 70vh;
    min-height: 520px;
    max-height: 700px;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    margin: 3px 0;
    border: 1px solid #333;
    font-size: 14px;
}

/* 左侧边栏 - 紧凑设计 */
.digital-human-sidebar {
    width: 280px;
    min-width: 280px;
    background: #2d2d2d;
    border-right: 1px solid #444;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}

.sidebar-header h3 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.new-video-btn {
    width: 100%;
    padding: 8px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.new-video-btn:hover {
    background: #0da271;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 0;
}

/* 控制组 - 紧凑间距 */
.control-group {
    margin-bottom: 16px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group h4 {
    margin: 0 0 10px 0;
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 头像网格 - 紧凑设计 */
.avatar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.avatar-item {
    padding: 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: #3a3a3a;
    text-align: center;
}

.avatar-item:hover {
    border-color: #555;
    background: #444;
}

.avatar-item.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.avatar-preview {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: #444;
    display: flex;
    align-items: center;
    justify-content: left;
    border: 2px solid #555;
    margin: 0 auto 6px;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    color: #888;
    font-size: 14px;
    font-weight: 600;
}

.avatar-item span {
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 500;
    display: block;
}

/* 预设网格 - 紧凑设计 */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.preset-btn {
    padding: 8px 4px;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #e0e0e0;
}

.preset-btn:hover {
    background: #444;
    border-color: #10b981;
}

.preset-icon {
    font-size: 14px;
}

.preset-text {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* 文本输入 - 紧凑设计 */
.text-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 6px;
    resize: vertical;
    font-size: 12px;
    line-height: 1.4;
    transition: border-color 0.2s;
    font-family: inherit;
    margin-bottom: 6px;
    background: #3a3a3a;
    color: #e0e0e0;
    min-height: 70px;
    max-height: 100px;
}

.text-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.text-input::placeholder {
    color: #666;
    font-size: 12px;
}

.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    color: #888;
    font-size: 11px;
}

.char-count.over-limit {
    color: #ef4444;
}

/* 生成按钮 - 紧凑设计 */
.generate-button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    margin-bottom: 0;
}

.generate-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #0da271 0%, #047857 100%);
}

.generate-button:disabled {
    background: #555;
    cursor: not-allowed;
    color: #999;
}

.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 右侧主内容区 */
.digital-human-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: 
        radial-gradient(circle at 20% 30%, rgba(30, 64, 175, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(5, 150, 105, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
    min-height: 0;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-badge {
    background: #10b981;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.model-status {
    color: #aaa;
    font-size: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 剩余额度 - 移到右侧 */
.usage-info {
    color: #e0e0e0;
    font-size: 11px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.usage-info strong {
    color: #10b981;
}

.action-btn {
    padding: 6px 10px;
    border: 1px solid #555;
    background: #3a3a3a;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    color: #ddd;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #444;
    border-color: #10b981;
    color: #fff;
}

/* 视频容器 */
.video-container {
    flex: 1;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.5);
    position: relative;
    min-height: 0;
}

#aiVideo {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 100%;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    max-width: 400px;
}

.placeholder-content h3 {
    margin: 12px 0 6px 0;
    color: #e0e0e0;
    font-size: 16px;
}

.placeholder-content p {
    margin: 0;
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-content {
    text-align: center;
    color: #e0e0e0;
    max-width: 280px;
}

.loading-content h4 {
    margin: 12px 0 6px 0;
    color: #e0e0e0;
    font-size: 16px;
}

.loading-content p {
    margin: 0 0 16px 0;
    color: #aaa;
    font-size: 13px;
}

.progress-bar {
    width: 180px;
    height: 3px;
    background: #444;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

.loading-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #444;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 下载按钮样式 */
#downloadVideo {
    background: #10b981;
}

#downloadVideo:hover {
    background: #0da271;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .digital-human-layout {
        height: 75vh;
    }
}

@media (max-width: 768px) {
    .digital-human-layout {
        flex-direction: column;
        height: auto;
        min-height: 500px;
        max-height: none;
    }
    
    .digital-human-sidebar {
        width: 100%;
        height: auto;
        max-height: 400px;
    }
    
    .sidebar-content {
        padding: 12px 16px;
    }
    
    .main-header {
        padding: 10px 12px;
    }
    
    .video-container {
        padding: 12px;
    }
    
    .avatar-grid,
    .preset-grid {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .digital-human-layout {
        border-radius: 6px;
        margin: 10px 0;
    }
    
    .sidebar-header {
        padding: 12px 16px;
    }
    
    .control-group {
        margin-bottom: 12px;
    }
    
    .avatar-item {
        padding: 8px;
    }
    
    .avatar-preview {
        width: 32px;
        height: 32px;
    }
    
    .preset-btn {
        padding: 6px 2px;
    }
    
    .preset-icon {
        font-size: 12px;
    }
    
    .preset-text {
        font-size: 9px;
    }
    
    .text-input {
        padding: 8px;
        min-height: 60px;
    }
    
    .main-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    
    .header-actions {
        align-self: flex-end;
    }
}