﻿/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 10px;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
}

h3 {
    color: #444;
    margin: 20px 0 10px;
    font-size: 18px;
    font-weight: 600;
}

/* 播放器容器 */
.player-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 100%;
    min-height: 160px;
}

video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* 移动设备视频控制优化 */
video::-webkit-media-controls {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

video::-webkit-media-controls-play-button {
    width: 44px !important;
    height: 44px !important;
}

/* 修复iOS Safari中的播放按钮问题 */
@media (max-width: 768px) {
    video {
        min-height: 200px;
        background-color: #000;
    }
    
    /* 确保视频在横屏模式下有正确的显示比例 */
    @media (orientation: landscape) {
        .player-container {
            margin-bottom: 15px;
        }
        
        video {
            max-height: 65vh;
        }
    }
}

/* 输入区域样式 */
.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.input-section label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.input-section input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-section input:focus {
    outline: none;
    border-color: #667eea;
}

.input-section button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

#loadBtn {
    background: #667eea;
    color: white;
}

#loadBtn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

#resetBtn {
    background: #f56565;
    color: white;
}

#resetBtn:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

/* 示例地址区域 */
.examples {
    margin-bottom: 25px;
}

.example-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.example-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.example-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* 历史记录区域 */
.history {
    margin-bottom: 20px;
}

#historyList {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
}

#historyList li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    word-break: break-all;
}

#historyList li:hover {
    background: #e9ecef;
}

/* 错误消息 */
.error-msg {
    display: none;
    background: #fed7d7;
    color: #c53030;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #c53030;
}

.error-msg.show {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .input-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-section label {
        margin-bottom: 8px;
    }
    
    .input-section input {
        min-width: 100%;
    }
}