/* ========== 数字人总管模块样式 ========== */

/* 页面横幅 */
.dh-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 0;
}

.dh-banner h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.dh-banner p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* 主区域布局 */
.dh-manager-section {
    padding: 30px 0;
}

.dh-manager-section .container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
}

/* 左侧面板 */
.manager-left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 数字人卡片 */
.agent-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.agent-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-face {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.avatar-eyes {
    display: flex;
    gap: 12px;
    position: absolute;
    top: 22px;
}

.eye {
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    animation: blink 3s infinite;
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.avatar-mouth {
    width: 25px;
    height: 10px;
    background: #e74c3c;
    border-radius: 0 0 15px 15px;
    margin-top: 15px;
}

.agent-card h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.agent-card p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* 进度卡片 */
.progress-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.progress-card h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#progressText {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
}

/* 预警卡片 */
.alerts-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.alerts-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alerts-card h3 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.alerts-list {
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    background: #fdf2f0;
    border-left: 4px solid #e74c3c;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.alert-item.warning {
    background: #fff8e1;
    border-left-color: #f39c12;
}

.alert-item.error {
    background: #fde8e8;
    border-left-color: #e74c3c;
}

.alert-msg {
    color: #333;
    font-weight: 500;
}

.alert-suggestion {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

.no-alerts {
    text-align: center;
    color: #27ae60;
    padding: 20px;
}

/* 右侧面板 */
.manager-right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 卡片通用样式 */
.timeline-card, .tasks-card, .chat-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-reset, .btn-add, .btn-auto {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-reset {
    background: #f0f0f0;
    color: #666;
}

.btn-reset:hover {
    background: #e0e0e0;
}

.btn-add {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-auto {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-auto:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 时间线 */
.timeline-container {
    max-height: 350px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.timeline-item:hover {
    background: #f0f4ff;
}

.timeline-time {
    font-weight: bold;
    color: #667eea;
    min-width: 70px;
    font-size: 0.9rem;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ddd;
    margin-top: 3px;
    flex-shrink: 0;
}

.timeline-dot.completed {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.timeline-dot.in_progress {
    background: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    animation: pulse-dh 2s infinite;
}

@keyframes pulse-dh {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.timeline-dot.delayed {
    background: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.timeline-info {
    flex: 1;
}

.timeline-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.timeline-team {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.timeline-actions {
    display: flex;
    gap: 8px;
}

.btn-complete, .btn-delay {
    padding: 5px 14px;
    border: none;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-complete {
    background: #e8f5e9;
    color: #27ae60;
}

.btn-complete:hover {
    background: #c8e6c9;
}

.btn-delay {
    background: #fff3e0;
    color: #f39c12;
}

.btn-delay:hover {
    background: #ffe0b2;
}

/* 任务列表 */
.tasks-list {
    max-height: 250px;
    overflow-y: auto;
}

.no-tasks {
    text-align: center;
    color: #999;
    padding: 30px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.task-content {
    flex: 1;
}

.task-name {
    font-weight: 500;
    color: #333;
}

.task-meta {
    color: #888;
    font-size: 0.85rem;
    margin-top: 3px;
}

.task-priority {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-priority.high {
    background: #fde8e8;
    color: #e74c3c;
}

.task-priority.medium {
    background: #fff3e0;
    color: #f39c12;
}

.task-priority.low {
    background: #e8f5e9;
    color: #27ae60;
}

/* 聊天区域 */
.chat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    height: 200px;
    overflow-y: auto;
    background: #fafafa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.msg.user {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-left: auto;
    border-radius: 15px 15px 5px 15px;
}

.msg.agent {
    background: white;
    color: #333;
    border: 1px solid #eee;
    border-radius: 15px 15px 15px 5px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: #667eea;
}

.chat-input-area button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"] {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.team-checkboxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.team-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.form-actions button:first-child {
    background: #f0f0f0;
    color: #666;
}

.form-actions button:first-child:hover {
    background: #e0e0e0;
}

.form-actions button:last-child {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.form-actions button:last-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 自动化控制卡片 */
.automation-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.automation-card .card-header {
    margin-bottom: 20px;
}

.automation-card h3 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #999;
}

.status-indicator.running {
    background: #27ae60;
    animation: blinkGreen 1s infinite;
}

@keyframes blinkGreen {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-indicator.paused {
    background: #f39c12;
}

.status-indicator.offline {
    background: #999;
}

.auto-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.auto-stat {
    text-align: center;
}

.auto-stat .stat-num {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.auto-stat .stat-label {
    font-size: 0.75rem;
    color: #888;
}

.auto-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-auto-start, .btn-auto-pause {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-auto-start {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-auto-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-auto-pause {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-auto-pause:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .dh-manager-section .container {
        grid-template-columns: 1fr;
    }
    
    .manager-left-panel {
        order: 2;
    }
    
    .manager-right-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .dh-banner h1 {
        font-size: 1.8rem;
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .team-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-actions {
        flex-direction: column;
    }
    
    .btn-complete, .btn-delay {
        width: 100%;
    }
    
    .auto-stats {
        grid-template-columns: 1fr;
    }
}
