* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#videoPlayer{
    mix-blend-mode: screen;
    border-radius: 10px;
}

/* 顶部视频源管理栏 */
.source-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0));
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-btn {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.source-btn:hover {
    background-color: rgba(139, 92, 246, 0.5);
    border-color: rgba(139, 92, 246, 0.8);
}

.source-btn.active {
    background-color: rgba(139, 92, 246, 0.6);
    border-color: rgba(139, 92, 246, 1);
}

.source-dropdown {
    position: absolute;
    top: 60px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 10px;
    min-width: 300px;
    display: none;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.source-dropdown.show {
    display: flex;
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.source-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.source-item.active {
    background: rgba(139, 92, 246, 0.3);
}

.source-name {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-url {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.source-delete {
    padding: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    color: #ef4444;
}

.source-item:hover .source-delete {
    opacity: 1;
}

.source-delete:hover {
    color: #f87171;
}

.source-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.add-source-input {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    margin-bottom: 5px;
}

.add-source-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.add-source-btn {
    padding: 10px;
    background: rgba(139, 92, 246, 0.6);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.add-source-btn:hover {
    background: rgba(139, 92, 246, 0.8);
}

/* 自定义模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 24px;
    min-width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    text-align: center;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.modal-btn.confirm {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
}

.modal-btn.confirm:hover {
    background: linear-gradient(135deg, #9d7bff, #7c3aed);
    transform: translateY(-1px);
}

.video-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

video {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 屏幕阅读器隐藏类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.controls {
    position: absolute;
    bottom: 20%;
    right: 20px;
    transform: translateY(25%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.btn {
    padding: 10px 10px;
    background-color: rgba(0, 0, 0, 0.1);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    min-width: 10px;
}

.hint-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    padding: 5px;
    cursor: default;
}

.btn:hover {
    background-color: rgba(236, 92, 169, 0.5);
    transform: translateY(-2px);
}

/* 加载状态容器 */
.loading-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    place-content: center;
    place-items: center;
    flex-direction: column;
    gap: 16px;
    z-index: 20;
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
    height: fit-content;
    margin: auto;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

/* 错误状态容器 */
.error-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    place-content: center;
    place-items: center;
    flex-direction: column;
    gap: 16px;
    z-index: 30;
    padding: 32px 40px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    max-width: 85%;
    text-align: center;
    width: fit-content;
    height: fit-content;
    margin: auto;
}

.error-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    font-size: 28px;
    color: #ef4444;
}

.error-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

.error-retry {
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.error-retry:hover {
    background: linear-gradient(135deg, #9d7bff, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

/* 静音提示 */
.mute-hint {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 15;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

video:-webkit-full-screen {
    background: #000;
}

video:full-screen {
    background: #000;
}

/* 全屏状态下的控件样式 */
.video-container.is-fullscreen .controls {
    position: fixed;
    right: 20px;
    bottom: 50%;
    transform: translateY(50%);
    z-index: 9999;
}

.video-container.is-fullscreen .mute-hint {
    position: fixed;
    bottom: 20%;
    z-index: 9999;
}

.video-container.is-fullscreen .source-header {
    position: fixed;
    z-index: 9999;
}

@media (max-width: 768px) {
    .source-header {
        padding: 10px 15px;
    }
    
    .source-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .source-dropdown {
        top: 50px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .controls {
        right: 15px;
        gap: 10px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 5px;
        gap: 4px;
    }
    
    .hint-text {
        font-size: 10px;
        padding: 3px;
    }
}
