/* 主要样式文件 - 机顶盒H5适配 */
/* Main CSS for STB H5 adaptation */

/* 应用容器 */
.app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* 页面基础样式 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

/* 加载界面 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #fff;
    font-weight: 300;
}

/* 预告页样式 */
.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.3), transparent);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lion-animation {
    width: 200px;
    height: 200px;
    background: url('../images/lion.gif') center/cover no-repeat;
    animation: lionPulse 2s ease-in-out infinite;
}

@keyframes lionPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.preview-controls {
    position: absolute;
    bottom: 60px;
    right: 60px;
    z-index: 10;
}

.skip-button {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.skip-button:hover,
.skip-button.focus {
    background: #fff;
    color: #000;
    transform: scale(1.05);
}

/* 故事页样式 */
.story-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
}

.story-video-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.story-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.interaction-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 20px;
    min-height: 200px;
}

.question-display,
.answer-display {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.recording-controls {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.record-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-width: 180px;
    justify-content: center;
}

.record-button:hover,
.record-button.focus {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.record-button.recording {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.record-icon::before {
    content: '🎤';
    font-size: 20px;
}

.voice-status {
    text-align: center;
    margin-top: 15px;
}

.status-text {
    font-size: 14px;
    color: #4ecdc4;
    margin-bottom: 10px;
    font-weight: 500;
}

.voice-wave {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 4px;
    height: 30px;
}

.wave-bar {
    width: 4px;
    background: #4ecdc4;
    border-radius: 2px;
    animation: waveAnimation 1.5s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes waveAnimation {
    0%, 100% { height: 10px; }
    50% { height: 25px; }
}

/* 控制按钮 */
.story-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.control-btn {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
}

.control-btn:hover,
.control-btn.focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: scale(1.05);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 16px;
    display: inline-block;
}

/* 评分弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.rating-stars {
    margin-bottom: 30px;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.star {
    font-size: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.star:hover,
.star.active {
    opacity: 1;
    transform: scale(1.2);
    filter: brightness(1.2);
}

.rating-text {
    font-size: 18px;
    color: #ecf0f1;
    font-weight: 300;
}

.rating-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.rating-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
}

.rating-btn:hover,
.rating-btn.focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.rating-btn:nth-child(2) {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* 焦点样式 - 遥控器适配 */
.focusable:focus {
    outline: 3px solid #4ecdc4;
    outline-offset: 2px;
}

/* 响应式设计 - 适配不同屏幕比例 */
@media screen and (max-width: 1280px) {
    .preview-controls {
        bottom: 40px;
        right: 40px;
    }

    .skip-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .lion-animation {
        width: 150px;
        height: 150px;
    }
}

@media screen and (max-height: 720px) {
    .interaction-area {
        min-height: 150px;
        padding: 15px;
    }

    .record-button {
        padding: 12px 24px;
        font-size: 14px;
    }

    .story-controls {
        bottom: 15px;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 12px;
        min-width: 80px;
    }
}

/* 性能优化 - 减少重绘 */
.transform-gpu {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
