/* Unity数字人聊天组件样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.unity-chat-widget {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 9999;
}

.unity-container {
    width: 390px;
    height: 710px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 
                0 12px 25px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    bottom: 20px;
    right: 20px;
    backdrop-filter: blur(10px);
    transform: translateZ(0);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
               height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
               box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top left;
}

.unity-container:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.3), 
                0 18px 35px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.unity-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #343a40;
    padding: 20px 25px;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 1px solid rgba(233, 236, 239, 0.5);
    text-align: center;
    cursor: move;
    user-select: none;
    position: relative;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.unity-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #28a745;
    border-radius: 50%;
    box-shadow: 12px 0 0 #ffc107, 24px 0 0 #dc3545;
}

.header-title {
    flex: 1;
    text-align: center;
    cursor: move;
    padding: 0 10px;
}

.header-controls {
    position: absolute;
    right: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    user-select: none;
}

.hide-button {
    background: #dc3545;
    color: #fff;
}

.hide-button:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 隐藏状态样式 */
.unity-container.hidden {
    display: none;
}

/* 恢复按钮样式 */
.restore-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.restore-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.restore-button.show {
    display: flex;
}

.unity-iframe-container {
    flex: 1;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unity-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

.unity-status {
    padding: 12px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid rgba(233, 236, 239, 0.5);
    font-size: 11px;
    color: #495057;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.microphone-controls {
    padding: 20px 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid rgba(233, 236, 239, 0.5);
    display: flex;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(5px);
}

.mic-button {
    padding: 12px 20px;
    border: 2px solid #007bff;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #007bff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    backdrop-filter: blur(10px);
}

.mic-button:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.mic-button.active {
    background: #28a745;
    border-color: #28a745;
    color: white;
    animation: pulse 2s infinite;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.stop-button {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2) !important;
}

.stop-button:hover {
    background: #dc3545 !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4) !important;
}

.copy-button {
    border-color: #17a2b8 !important;
    color: #17a2b8 !important;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.2) !important;
}

.copy-button:hover {
    background: #17a2b8 !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4) !important;
}

.copy-button.copying {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    animation: pulse 1s ease;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 600px) {
    .unity-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        border-radius: 15px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                    0 8px 20px rgba(0, 0, 0, 0.2);
    }
    
    .unity-container:hover {
        transform: translateY(-2px) translateZ(0);
    }
    
    .unity-header {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .microphone-controls {
        padding: 12px 15px;
    }
    
    .mic-button {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .unity-iframe-container {
        min-height: 300px;
    }
}

@media (max-width: 560px) {
    .unity-container {
        width: 95vw;
        height: 95vh;
        border-radius: 12px;
    }
    
    .unity-header {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}
