/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== App容器 ========== */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f7;
    position: relative;
}

/* ========== 顶部导航 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.5px;
}

/* ========== 视频容器 ========== */
#video-container {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    margin-top: 56px;
}

/* ========== 视频项 ========== */
.video-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    background: #ffffff;
    overflow: hidden;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

/* ========== 视频信息覆盖层 ========== */
.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
    color: #fff;
    pointer-events: none;
}

.video-info .video-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ========== 播放/暂停按钮 ========== */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.play-overlay.show {
    opacity: 1;
}

.play-overlay svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    margin-left: 3px;
}

/* ========== 首次播放按钮 ========== */
.play-overlay.start-btn {
    width: 80px;
    height: 80px;
    background: rgba(0, 122, 255, 0.25);
    animation: pulse-btn 2s ease-in-out infinite;
    pointer-events: auto;
    cursor: pointer;
}

.play-overlay.start-btn svg {
    width: 36px;
    height: 36px;
}

@keyframes pulse-btn {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 0 12px rgba(0, 122, 255, 0);
    }
}

/* ========== 切换按钮 ========== */
.nav-btn {
    position: fixed;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #1d1d1f;
}

.nav-btn:active {
    transform: scale(0.92);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.nav-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.nav-btn-prev {
    bottom: 80px;
}

.nav-btn-next {
    bottom: 20px;
}

/* ========== 加载动画 ========== */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 200;
    display: none;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8ed;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 13px;
    color: #86868b;
}

/* ========== 错误提示 ========== */
.error-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 59, 48, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.error-toast.show {
    opacity: 1;
}

/* ========== 无视频提示 ========== */
.empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #86868b;
    gap: 12px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: #c7c7cc;
}

.empty-state p {
    font-size: 16px;
}

/* ========== 进度指示器 ========== */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.progress-bar .progress-fill {
    height: 100%;
    background: #007aff;
    width: 0%;
    transition: width 0.1s linear;
}

/* ========== 页码文字 ========== */
.page-text {
    position: fixed;
    right: 70px;
    bottom: 130px;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    user-select: none;
}

/* ========== 响应式适配 ========== */
@media (min-width: 768px) {
    #video-container {
        max-width: 480px;
        margin: 56px auto 0;
    }

    .header h1 {
        font-size: 20px;
    }

    .nav-btn {
        right: calc(50% - 240px - 16px);
    }

    .page-text {
        right: calc(50% - 240px - 70px);
        bottom: 130px;
    }
}
