:root {
    --primary-color: #fe2c55; /* 类似抖音红 */
    --text-color: #ffffff;
    --bg-color: #000000;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
}

.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* 启动屏幕 */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100; /* 最高层级 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.start-content {
    text-align: center;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.start-content h1 {
    margin-bottom: 30px;
    font-weight: 300;
    letter-spacing: 2px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

#start-btn {
    padding: 15px 40px;
    font-size: 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.4);
    transition: transform 0.2s, background 0.2s;
}

#start-btn:hover {
    transform: scale(1.05);
    background: #e6254a;
}

#start-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
}

#start-btn i {
    margin-right: 8px;
}

.preload-status {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    min-height: 20px;
}

/* 背景模糊层 */
.bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.6);
    z-index: 1;
    opacity: 0.5;
    transition: background-image 0.5s ease;
}

/* 媒体显示区域 */
.media-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2; /* 在背景之上 */
}

.media-wrapper video,
.media-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain; 
    display: block;
    box-shadow: 0 0 20px rgba(0,0,0,0.5); /* 阴影增加立体感 */
}

@media (max-aspect-ratio: 9/16) {
    .media-wrapper video, .media-wrapper img {
        width: 100%;
        object-fit: cover; /* 竖屏全屏模式 */
    }
}

/* 进度条 */
.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 20;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* 覆盖层：底部渐变 */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%; /* 只覆盖底部 */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none; 
    z-index: 5;
}

/* 控制面板 */
.controls-layer {
    position: absolute;
    bottom: 80px; /* 提高一点，避开进度条 */
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
    pointer-events: auto;
}

.control-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

/* 顶部选择栏 */
.top-bar {
    position: absolute;
    top: 20px;
    right: 20px; 
    z-index: 20;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

select {
    background: transparent;
    color: white;
    border: none;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    appearance: none; /* 移除默认箭头 */
    padding-right: 15px; /* 为了不遮挡自定义箭头 */
}

select option {
    background: #222;
    color: white;
}

/* 加载动画 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s ease-in-out infinite;
    z-index: 5;
    display: none; 
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 提示信息 */
.toast {
    position: absolute;
    top: 10%; /* 移到上方，不遮挡内容 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 30;
    font-size: 14px;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}

/* 键盘快捷键提示 */
.shortcuts-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
