* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ffffff;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.player-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #ffffff;
    text-align: center;
}

.controls-wrapper {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    transition: all 0.3s ease;
}

.progress-bar-container {
    margin-bottom: 15px;
    cursor: pointer;
    padding: 5px 0;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar:hover .progress-handle {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.control-btn:hover .icon {
    transform: scale(1.1);
}

.time-display {
    font-size: 14px;
    color: #ffffff;
    font-family: monospace;
    min-width: 100px;
}

.time-separator {
    margin: 0 5px;
    opacity: 0.7;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider-container {
    width: 100px;
    transition: all 0.3s ease;
}

.volume-control:hover .volume-slider-container {
    width: 120px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    transition: all 0.2s ease;
}

input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.5);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #667eea;
}

input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #667eea;
}

.settings-menu {
    position: relative;
}

.settings-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 20;
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-section {
    margin-bottom: 15px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-weight: 500;
}

.speed-options, .quality-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.speed-btn, .quality-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.speed-btn:hover, .quality-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.speed-btn.active, .quality-btn.active {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .control-group {
        justify-content: space-between;
    }
    
    .time-display {
        font-size: 13px;
    }
    
    .volume-slider-container {
        width: 80px;
    }
    
    .volume-control:hover .volume-slider-container {
        width: 100px;
    }
    
    .speed-options, .quality-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-panel {
        right: 50%;
        transform: translateX(50%) translateY(10px);
    }
    
    .settings-panel.active {
        transform: translateX(50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .controls-wrapper {
        padding: 10px;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .icon {
        width: 18px;
        height: 18px;
    }
    
    .time-display {
        font-size: 12px;
        min-width: 80px;
    }
    
    .speed-options, .quality-options {
        grid-template-columns: 1fr;
    }
}

/* 全屏样式 */
.player-wrapper:-webkit-full-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.player-wrapper:-moz-full-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.player-wrapper:-ms-fullscreen {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.player-wrapper:fullscreen {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* 触摸设备适配 */
@media (hover: none) and (pointer: coarse) {
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .icon {
        width: 22px;
        height: 22px;
    }
    
    .progress-handle {
        opacity: 1;
    }
    
    .volume-slider-container {
        width: 100px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}