/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 主应用容器 */
#app {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* 视频容器 */
#video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主视频样式 */
#main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: object-fit 0.3s ease;
}

#main-video.stretch-mode {
    object-fit: cover;
}

#main-video.fit-mode {
    object-fit: contain;
}

/* 强制横屏模式样式 */
body.landscape-mode #main-video {
    transform: rotate(90deg);
    width: 100vh;
    height: 100vw;
}

/* 新的强制横屏模式 */
.force-landscape-mode #video-container {
    transform-origin: center center;
}

.force-landscape-mode #main-video {
    transform: rotate(90deg);
    width: 100vh;
    height: 100vw;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -50vh;
    margin-top: -50vw;
    object-fit: cover;
}

.force-landscape-mode .controller-overlay {
    transform: rotate(90deg);
    width: 100vh;
    height: 100vw;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -50vh;
    margin-top: -50vw;
}

.force-landscape-mode .controller-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 强制横屏模式下的按钮位置调整 */
.force-landscape-mode .settings-btn {
    top: auto;
    bottom: 20px;
    right: 20px;
}

/* 当设备本身就是横屏时，不需要旋转 */
@media (orientation: landscape) {
    .force-landscape-mode #main-video {
        transform: none;
        width: 100%;
        height: 100%;
        position: relative;
        top: auto;
        left: auto;
        margin: 0;
    }
    
    .force-landscape-mode .controller-overlay {
        transform: none;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        margin: 0;
    }
    
    .force-landscape-mode .settings-btn {
        top: 20px;
        bottom: auto;
        right: 20px;
    }
}

/* 控制器覆盖层 */
.controller-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.controller-overlay.visible {
    opacity: 1;
}

.controller-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(128, 128, 128, 0.8);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.settings-btn:hover {
    background: rgba(128, 128, 128, 0.7);
    transform: scale(1.05);
}

.settings-btn:active {
    transform: scale(0.95);
}



/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-panel.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 设置面板头部 */
.settings-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2a2a2a;
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 设置面板主体 */
.settings-body {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #666 #333;
}

.settings-body::-webkit-scrollbar {
    width: 6px;
}

.settings-body::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.settings-body::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* 版权信息 */
.copyright-info {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    color: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.copyright-title {
    font-weight: bold;
    font-size: 16px;
    color: #1565c0;
    margin-bottom: 8px;
}

.copyright-url {
    font-size: 14px;
    color: #757575;
}

/* 设置组 */
.setting-group {
    margin-bottom: 24px;
}

.setting-group h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}

.setting-group h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #ccc;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.radio-group label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #007bff;
}

.radio-group span {
    font-size: 14px;
    color: #ddd;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.checkbox-group label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #007bff;
}

.checkbox-group span {
    font-size: 14px;
    color: #ddd;
}

/* 设置描述 */
.setting-description {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    margin-left: 25px;
    font-style: italic;
    line-height: 1.3;
}

/* LOGO设置样式 */
.logo-preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-preview {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.logo-info {
    flex: 1;
}

#logo-current-info {
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
}

.logo-upload-section {
    margin-bottom: 15px;
}

.logo-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-actions .btn-secondary {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

/* 下拉选择框 */
.select-input {
    width: 100%;
    padding: 10px 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.select-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 文件输入 */
.file-input-group {
    margin-top: 8px;
}

.file-input {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 10px 16px;
    background: #007bff;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.file-input-label:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.file-input-label:active {
    transform: translateY(0);
}

/* 选中文件信息 */
.selected-file-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    color: #87ceeb;
    word-break: break-all;
}

/* 输入组 */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.input-group label {
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
}

.number-input {
    width: 80px;
    padding: 6px 8px;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.number-input:focus {
    outline: none;
    border-color: #007bff;
}

.range-input {
    flex: 1;
    accent-color: #007bff;
}

#opacity-value {
    font-size: 14px;
    color: #ccc;
    min-width: 40px;
}

/* 操作按钮 */
.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #555;
    color: white;
}

.btn-secondary:hover {
    background: #666;
    transform: translateY(-1px);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

/* 加载覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

/* 加载动画 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    color: #fff;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: rgba(220, 53, 69, 0.9);
}

.toast.success {
    background: rgba(40, 167, 69, 0.9);
}

.toast.info {
    background: rgba(23, 162, 184, 0.9);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .settings-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .settings-header {
        padding: 16px;
    }
    
    .settings-header h2 {
        font-size: 18px;
    }
    
    .settings-body {
        padding: 16px;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .radio-group {
        gap: 6px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .settings-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .settings-content {
        width: 98%;
        border-radius: 8px;
    }
    
    .settings-header {
        padding: 12px;
    }
    
    .settings-body {
        padding: 12px;
    }
    
    .setting-group {
        margin-bottom: 20px;
    }
    
    .copyright-info {
        padding: 12px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .settings-content {
        max-height: 98vh;
        width: 85%;
    }
    
    .settings-header {
        padding: 12px 20px;
    }
    
    .settings-body {
        padding: 16px 20px;
    }
    
    .setting-group {
        margin-bottom: 16px;
    }
}

/* 暗色主题 */
@media (prefers-color-scheme: dark) {
    .copyright-info {
        background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
        color: #ccc;
    }
    
    .copyright-title {
        color: #4a9eff;
    }
    
    .copyright-url {
        color: #999;
    }
}

/* 打印样式 */
@media print {
    .settings-panel,
    .settings-btn,
    .loading-overlay,
    .toast {
        display: none !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .settings-btn:hover,
    .close-btn:hover,
    .file-input-label:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .radio-group label:hover,
    .checkbox-group label:hover {
        transform: none;
        background-color: initial;
    }
    
    .settings-btn:active {
        background: rgba(128, 128, 128, 0.8);
    }
    
    .close-btn:active {
        background: rgba(255, 255, 255, 0.3);
    }
}

/* 密码验证弹窗 */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    animation: fadeIn 0.3s ease-out;
}

.password-modal.show {
    display: flex;
}

.password-modal-content {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.password-modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.password-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.password-modal-body {
    padding: 24px;
    color: #e0e0e0;
}

.password-question {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.password-question p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.password-input-group {
    margin-bottom: 16px;
}

.password-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.password-input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.password-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.password-modal-footer {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
}

.password-submit-btn,
.password-cancel-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-submit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.password-submit-btn:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.password-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.password-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
} 