/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
}

/* 导航栏样式 */
.header {
    position: sticky;
    top: 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 200px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #333333;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: #383838;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: #ff0000;
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 640px;
    display: flex;
    justify-content: center;
}

.search-box {
    display: flex;
    width: 100%;
    max-width: 640px;
    height: 40px;
}

.search-box input {
    flex: 1;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #333333;
    padding: 0 16px;
    font-size: 16px;
    border-radius: 40px 0 0 40px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #1890ff;
    background-color: #ffffff;
}

.search-btn {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: #666666;
    padding: 0 24px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.search-btn:hover {
    background-color: #e0e0e0;
    color: #333333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: flex-end;
}

.header-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header-btn:hover {
    background-color: #383838;
}

/* 主容器 */
.main-container {
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    padding: 24px 16px;
    gap: 24px;
}

/* 侧边栏广告区 */
.sidebar-left,
.sidebar-right {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ad-box {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.ad-placeholder {
    color: #999999;
    font-size: 14px;
    text-align: center;
}

/* 内容区 */
.content-area {
    flex: 1;
    min-width: 0;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    align-items: stretch;
}

/* 视频卡片 */
.video-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #1890ff;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    background-color: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.video-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 48px;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: auto;
    color: #333333;
}

.video-channel,.video-meta {
    font-size: 13px;
    color: #666666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-intro {
    font-size: 13px;
    color: #888888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.video-views {
    color: #aaaaaa;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
    flex-wrap: wrap;
    padding: 8px 0;
}

.page-btn {
    background-color: transparent;
    border: 1px solid #e0e0e0;
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
}

.page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.page-btn.active {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 详情页样式 */
.detail-container {
    flex-direction: row;
}

.detail-content {
    max-width: 1280px;
}

.video-player-container {
    margin-bottom: 16px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    background-color: #000000;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    margin-bottom: 10px;
}

.video-info .video-title {
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.4;
    display: block;
    -webkit-line-clamp: unset;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
}

.video-stats {
    display: flex;
    gap: 16px;
    color: #aaaaaa;
    font-size: 14px;
}

.video-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background-color: #272727;
    border: none;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #3d3d3d;
}

.like-btn.active {
    background-color: #065fd4;
}

.dislike-btn.active {
    background-color: #065fd4;
}

.video-description {
    background-color: #272727;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.channel-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.channel-details {
    flex: 1;
}

.channel-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.channel-subscribers {
    font-size: 14px;
    color: #aaaaaa;
}

.subscribe-btn {
    background-color: #cc0000;
    border: none;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.subscribe-btn:hover {
    background-color: #aa0000;
}

.subscribe-btn.subscribed {
    background-color: #303030;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    white-space: pre-wrap;
}

.related-videos {
    margin-top: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.related-video-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-video-item {
    display: flex;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    padding: 8px;
    border-radius: 8px;
}

.related-video-item:hover {
    background-color: #272727;
}

.related-thumbnail {
    width: 168px;
    min-width: 168px;
    height: 94px;
    background-color: #000000;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 32px;
}

.related-video-info {
    flex: 1;
    min-width: 0;
}

.related-video-title {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin: 8px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-video-meta {
    font-size: 12px;
    color: #aaaaaa;
}

/* 响应式设计 - 平板 */
/* 分页省略号 */
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #999;
    user-select: none;
}

@media (max-width: 1200px) {
    .sidebar-left,
    .sidebar-right {
        width: 150px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* 响应式设计 - 手机端 */
@media (max-width: 768px) {
    .header-container {
        padding: 0 8px;
    }

    .header-left {
        min-width: auto;
    }

    .header-center {
        max-width: none;
    }

    .search-box {
        max-width: none;
    }

    .header-right {
        min-width: auto;
    }

    .main-container {
        flex-direction: column;
        padding: 16px 8px;
        gap: 16px;
    }

    .sidebar-left,
    .sidebar-right {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .ad-box {
        min-width: 200px;
        flex-shrink: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .video-info {
        padding: 8px;
    }

    .video-title {
        font-size: 14px;
    }

    .video-meta {
        font-size: 12px;
    }

    .detail-container {
        flex-direction: column;
    }

    .video-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .video-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

    .channel-info {
        flex-wrap: wrap;
    }

    .subscribe-btn {
        width: 100%;
    }

    .related-video-item {
        flex-direction: column;
    }

    .related-thumbnail {
        width: 100%;
        height: auto;
        padding-top: 56.25%;
        position: relative;
    }

    .related-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 36px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .header-center {
        display: none;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .logo-text {
        font-size: 18px;
    }
}

