/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #ffffff;
    color: #18191c;
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00a1d6;
    cursor: pointer;
}

.logo i {
    margin-right: 8px;
    font-size: 1.8rem;
}

/* 搜索栏 */
.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e7e7e7;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f6f7f8;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #00a1d6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9499a0;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9499a0;
    cursor: pointer;
    font-size: 16px;
}

.search-clear:hover {
    color: #f56c6c;
}

/* 投稿按钮 */
.upload-btn {
    background-color: #00a1d6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.upload-btn:hover {
    background-color: #0090c0;
}

.upload-btn i {
    margin-right: 6px;
}

/* 分区导航 */
.category-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #e7e7e7;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-nav ul {
    display: flex;
    list-style: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #61666d;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.category-item:hover {
    color: #00a1d6;
}

.category-item.active {
    color: #00a1d6;
    border-bottom-color: #00a1d6;
    font-weight: 500;
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.search-info,
.category-info {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-info h3,
.category-info h2 {
    color: #18191c;
    margin-bottom: 8px;
}

.search-info p,
.category-info p {
    color: #61666d;
    font-size: 14px;
}

/* B站视频分区标题 */
.bilibili-section {
    margin: 30px 0 20px;
    padding: 10px 0;
    border-top: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
}

.bilibili-section h3 {
    color: #18191c;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.clear-search-btn {
    margin-top: 12px;
    padding: 6px 12px;
    background-color: #f6f7f8;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    color: #61666d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background-color: #e7e7e7;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 视频卡片 */
.video-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 宽高比 */
    overflow: hidden;
    background-color: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #18191c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9499a0;
}

.views,
.date {
    display: flex;
    align-items: center;
}

.views i,
.date i {
    margin-right: 4px;
    font-size: 11px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 20px;
}

.page-btn {
    padding: 8px 16px;
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    color: #61666d;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.page-btn:hover:not(:disabled) {
    background-color: #f6f7f8;
    border-color: #00a1d6;
    color: #00a1d6;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #61666d;
}

/* 分页按钮容器 */
.page-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 页码按钮 */
.page-number-btn {
    padding: 6px 10px;
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    color: #61666d;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-number-btn:hover {
    background-color: #f6f7f8;
    border-color: #00a1d6;
    color: #00a1d6;
}

.page-number-btn.active {
    background-color: #00a1d6;
    border-color: #00a1d6;
    color: white;
}

/* 省略号 */
.ellipsis {
    font-size: 14px;
    color: #61666d;
    margin: 0 4px;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9499a0;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #e7e7e7;
}

.no-results h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #61666d;
}



.video-player {
    width: 100%;
    margin-bottom: 20px;
}

.video-player video {
    width: 100%;
    border-radius: 8px;
    background-color: #000;
}

.video-details h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #18191c;
}

.video-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #61666d;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background-color: #F1F2F3;
    color: #61666d;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background-color: #e7e7e7;
    color: #00a1d6;
}

.video-description h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #18191c;
}

.video-description p {
    color: #61666d;
    line-height: 1.6;
    font-size: 14px;
}

/* 底部 */
.footer {
    background-color: #ffffff;
    border-top: 1px solid #e7e7e7;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #18191c;
    display: flex;
    align-items: center;
}

.footer-section h4 i {
    margin-right: 8px;
    color: #00a1d6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    text-decoration: none;
    color: #61666d;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #00a1d6;
}

.footer-section p {
    color: #61666d;
    font-size: 14px;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #e7e7e7;
    color: #9499a0;
    font-size: 13px;
}

/* 回到顶部按钮 */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #00a1d6;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 161, 214, 0.3);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: all 0.3s;
}

.scroll-top-btn:hover {
    background-color: #0090c0;
    transform: translateY(-3px);
}

/* 响应式设计 - 手机端适配 */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        /* 修改：调整手机端布局顺序 */
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .logo {
        order: 1;
        width: auto;
        margin-bottom: 0;
        margin-right: auto;
    }

    /* 修改：搜索框放在中间 */
    .search-container {
        order: 2;
        max-width: 100%;
        margin: 0 10px;
        flex: 1;
    }

    /* 修改：投稿按钮移到搜索框右侧 */
    .upload-btn {
        order: 3;
        margin-bottom: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .video-title {
        font-size: 13px;
        height: 36px;
    }


    .video-details h2 {
        font-size: 18px;
    }

    .video-meta {
        flex-direction: column;
        gap: 8px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    /* 进一步调整小屏幕布局 */
    .header-container {
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.4rem;
    }

    .upload-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .upload-btn i {
        margin-right: 4px;
    }
}

.video-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.back-home-btn {
    padding: 8px 16px;
    background: #00a1d6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
}

.video-player-container video {
    width: 100%;
    max-height: 80vh;
    background: #000;
}

.custom-player {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.custom-player video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.custom-player .swf-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.custom-player .swf-player object,
.custom-player .swf-player embed {
    width: 100%;
    height: 100%;
    display: block;
}

.custom-player .swf-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.custom-player .swf-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.custom-player .swf-fallback h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #f44336;
}

.custom-player .swf-fallback p {
    font-size: 16px;
    margin-bottom: 10px;
}

.custom-player .swf-fallback ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.custom-player .swf-fallback li {
    margin-bottom: 5px;
}

.custom-player .download-btn {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 20px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.custom-player .download-btn:hover {
    background-color: #45a049;
}

.player-controls {
    opacity: 0;/* 默认隐藏 */
    transition: opacity 0.3s;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-controls.controls-visible {
    opacity: 1;/* 需要显示时变为可见 */
}



.progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    margin-bottom: 8px;
    border-radius: 3px;
    position: relative;
}

.progress-played {
    height: 100%;
    background: #00a1d6;
    border-radius: 3px;
    width: 0;
    position: relative;
}

.progress-handle {
    width: 12px;
    height: 12px;
    background: #00a1d6;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.progress-bar:hover .progress-handle {
    display: block;
}

.controls-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 左右分开 */
    gap: 15px;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-select {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider {
    width: 70px;
    cursor: pointer;
}

.time {
    font-size: 14px;
    font-family: monospace;
}

.speed-select {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
}

.speed-tip {
    /*倍速播放提示*/
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    /* 让提示不阻挡点击 */
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.speed-tip i {
    color: #00a1d6;
}

/* 代理提示遮罩层 - 覆盖整个视频区域，居中对齐 */
.proxy-tip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 20;
    /* 确保高于控件层（控件层z-index默认可设为10） */
    pointer-events: auto;
    /* 允许点击内部按钮 */
}

/* 代理提示内容框 */
.proxy-tip-content {
    background: #fff;
    color: #333;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.proxy-tip-content p {
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.5;
}

.proxy-tip-content button {
    padding: 10px 24px;
    background: #00a1d6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.proxy-tip-content button:hover {
    background: #0090c0;
}

.custom-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    outline: none;
}

.custom-player .video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.custom-player video {
    width: 100%;
    height: 100%;
    display: block;
}

/* 缓冲提示层 */
.buffering-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    /* 允许点击穿透到视频 */
}

.buffering-content {
    color: white;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.buffering-content i {
    font-size: 1.5rem;
}

/* 全屏模式下的样式调整，确保视频在全屏时正确居中显示
并且保持纵横比扩展到最长边刚好抵达屏幕边缘，
最多两条黑边（横向宽视频仅上下黑边 / 竖屏窄视频仅左右黑边） */
.custom-player:fullscreen {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    height: 100%;
}
.custom-player:fullscreen .video-wrapper {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}
.custom-player:fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-height: none !important;
    max-width: none !important;
}
