* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.page.active {
    display: flex;
}

/* 文件列表页面 */
.header {
    background: #1976d2;
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    margin-right: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:active {
    background: #f0f0f0;
}

.file-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 32px;
    height: 32px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 16px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 视频播放页面 */
.player-container {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s;
}

.player-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.player-title {
    flex: 1;
    color: white;
    font-size: 16px;
    margin: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-bar {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    z-index: 100;
    transition: opacity 0.3s;
}

.progress-bar.hidden {
    opacity: 0;
    pointer-events: none;
}

.progress-buffered {
    position: absolute;
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    width: 0;
}

.progress-played {
    position: absolute;
    height: 100%;
    background: #1976d2;
    border-radius: 2px;
    width: 0;
}

.progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #1976d2;
    border-radius: 50%;
    top: -4px;
    left: 0;
    transform: translateX(-50%);
}

.time-display {
    position: absolute;
    bottom: 30px;
    left: 16px;
    color: white;
    font-size: 14px;
    z-index: 100;
    transition: opacity 0.3s;
}

.time-display.hidden {
    opacity: 0;
}

.play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    transition: opacity 0.3s;
}

.play-pause-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.quality-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: rgba(0,0,0,0.9);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 101;
    min-width: 120px;
}

.quality-item {
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

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

.quality-item.active {
    color: #1976d2;
}

.subtitle-display {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 18px;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    padding: 0 20px;
    z-index: 98;
    pointer-events: none;
}

/* 全屏样式 */
.player-container:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.player-container:-webkit-full-screen #video-player {
    width: 100%;
    height: 100%;
}
