* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 全屏容器 */
.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

/* 画布容器 - 确保占满整个容器 */
.viewer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 保持内容比例，但填满容器 */
}

/* 加载提示 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    text-align: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 10px;
    display: none;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin-top: 15px;
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

/* 快捷键提示 */
.hotkey-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 10;
    max-width: 300px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hotkey-hint h3 {
    margin-bottom: 8px;
    color: #90caf9;
    font-size: 16px;
}

.hotkey-hint p {
    margin-bottom: 4px;
}

/* 状态指示器 */
.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    z-index: 10;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.status-label {
    color: #90caf9;
}

/* 操作提示 */
.notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 10;
    font-size: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.notification.show {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 键盘图标 */
.key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 2px 6px;
    margin: 0 2px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hotkey-hint {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 250px;
    }

    .status-indicator {
        font-size: 12px;
        padding: 6px 10px;
    }

    .notification {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-height: 600px) {
    .hotkey-hint {
        bottom: 10px;
        left: 10px;
    }

    .status-indicator {
        top: 10px;
        right: 10px;
    }
}

/* 对话面板样式 */
.chat-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 350px;
    background: rgba(20, 25, 35, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-panel.open {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header span {
    font-weight: 600;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(15, 20, 30, 0.8);
}

.message {
    margin-bottom: 15px;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: 40px;
    border-bottom-right-radius: 5px;
}

.message.ai .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    margin-right: 40px;
    border-bottom-left-radius: 5px;
}

.message.system .message-content {
    background: rgba(255, 255, 255, 0.05);
    color: #90caf9;
    font-size: 12px;
    text-align: center;
    border-radius: 10px;
}

.message.thinking .message-content {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-style: italic;
}

.timestamp {
    float: right;
    font-size: 11px;
    opacity: 0.7;
    margin-left: 10px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

#chat-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

#chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-buttons {
    display: flex;
    gap: 8px;
}

.voice-btn,
.send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
}

.voice-btn:hover,
.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 87, 108, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0);
    }
}

.voice-status {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-indicator {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.voice-bar {
    width: 3px;
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    animation: voiceBars 1s ease-in-out infinite;
}

.voice-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.voice-bar:nth-child(3) {
    animation-delay: 0.4s;
}

.voice-bar:nth-child(4) {
    animation-delay: 0.6s;
}

.voice-bar:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes voiceBars {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 100%;
    }
}

#voice-status-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-settings {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 15, 25, 0.5);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-row input[type="range"] {
    width: 80px;
}

.chat-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    z-index: 999;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.chat-toggle-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.voice-input-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2000;
    transition: transform 0.3s;
    opacity: 0;
}

.voice-input-hint.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 4px solid #667eea;
    border-radius: 50%;
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.mic-icon {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.hint-text {
    margin-top: 20px;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 更新状态指示器样式 */
.voice-status-off {
    color: #666;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.voice-status-listening {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.voice-status-speaking {
    color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 简化版对话输入框样式 */
.simple-chat-input {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 320px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.simple-chat-input.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.simple-chat-input .input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(30, 30, 30, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.simple-chat-input .input-header span {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.simple-chat-input .input-header .close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.simple-chat-input .input-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.simple-chat-input .input-group {
    display: flex;
    padding: 16px;
    gap: 8px;
}

.simple-chat-input .input-group input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.simple-chat-input .input-group input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #90caf9;
    box-shadow: 0 0 0 2px rgba(144, 202, 249, 0.2);
}

.simple-chat-input .input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.simple-chat-input .input-group .send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.simple-chat-input .input-group .send-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.simple-chat-input .input-group .send-btn:active {
    transform: translateY(0);
}

.simple-chat-input .input-group .send-btn i {
    font-size: 16px;
}

.simple-chat-input .speech-settings {
    padding: 12px 16px;
    background: rgba(20, 20, 20, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simple-chat-input .speech-settings label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    gap: 8px;
}

.simple-chat-input .speech-settings input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.simple-chat-input .speech-settings .slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.simple-chat-input .speech-settings .slider-group span:first-child {
    min-width: 36px;
}

.simple-chat-input .speech-settings input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.simple-chat-input .speech-settings input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.simple-chat-input .speech-settings input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.simple-chat-input .speech-settings #rate-value,
.simple-chat-input .speech-settings #pitch-value {
    min-width: 30px;
    text-align: right;
    font-family: monospace;
    color: #90caf9;
}

/* 调整对话按钮位置 */
.chat-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.chat-toggle-btn:active {
    transform: translateY(0) scale(1);
}

.chat-toggle-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: rotate(90deg);
}

.chat-toggle-btn.active:hover {
    transform: rotate(90deg) translateY(-2px) scale(1.05);
}

/* 输入框获得焦点时，提高层级确保在最前 */
.simple-chat-input input:focus {
    z-index: 1001;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .simple-chat-input {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 90px;
    }
    
    .chat-toggle-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* 添加预加载状态样式 */
.preload-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

/* 在style.css中添加以下样式 */
.stage-camera-indicator {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #4fc3f7;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.stage-camera-indicator .indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4fc3f7;
    animation: pulse 2s infinite;
}

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

.stage-camera-indicator.manual {
    color: #ffb74d;
    border-color: rgba(255, 183, 77, 0.3);
}

.stage-camera-indicator.manual .indicator-dot {
    background: #ffb74d;
}