body,
html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0a0a0f;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    user-select: none;
}

/* 顶部悬浮栏 */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: env(safe-area-inset-top, 20px) 20px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    z-index: 100;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header .date-badge {
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 视频容器 */
.video-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

video {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    outline: none;
}

/* 加载状态层 */
.status-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 14px;
    text-align: center;
    z-index: 10;
}

.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 视频加载进度条 */
.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar-container.visible {
    opacity: 1;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6, #039be5);
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease;
}

/* 全屏控制按钮 */
.fullscreen-btn {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 80px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 10px 24px;
    font-size: 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 101;
    cursor: pointer;
    display: none;
    transition: background 0.3s, transform 0.1s, opacity 0.3s;
}

.fullscreen-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%) scale(0.95);
}

/* 页面淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 播放结束重播浮层 */
.replay-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 20px 32px;
    border-radius: 14px;
    font-size: 15px;
    z-index: 102;
    display: none;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.5s ease;
}

.replay-overlay .replay-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.replay-overlay p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #ccc;
}

/* 视频错误提示 */
.error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ccc;
    z-index: 50;
    display: none;
}

.error-overlay .error-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.error-overlay p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #999;
}

.error-overlay .retry-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.error-overlay .retry-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* 下拉刷新 */
.pull-refresh-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-50px);
    color: #fff;
    font-size: 13px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: transform 0.3s ease;
    opacity: 0;
}

.pull-refresh-indicator.visible {
    opacity: 1;
}

.pull-refresh-indicator .refresh-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* noscript 样式 */
.noscript-msg {
    color: #ccc;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    line-height: 1.8;
}
