/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    padding: 10px 0;
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo-text {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo-sub {
    font-size: 16px;
    color: #fff;
    opacity: 0.9;
}

.search-box {
    display: flex;
    flex: 0 1 400px;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #555;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-actions a {
    color: #fff;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.upload-btn {
    background-color: rgba(255,255,255,0.2);
}

.upload-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

.login-btn, .register-btn {
    border: 1px solid rgba(255,255,255,0.5);
}

.login-btn:hover, .register-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

/* 主导航 */
.main-nav {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-list li {
    position: relative;
}

.nav-list a {
    display: block;
    padding: 15px 20px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.nav-list a:hover {
    color: #ee5a5a;
}

.nav-list li.active a {
    color: #ee5a5a;
    border-bottom-color: #ee5a5a;
}

/* 主要内容区 */
.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

/* 轮播图 */
.banner-section {
    margin-bottom: 30px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.banner-slider {
    position: relative;
    height: 400px;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-item.active {
    opacity: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.banner-info h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.banner-info p {
    font-size: 14px;
    opacity: 0.9;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: #fff;
}

/* 视频区块 */
.video-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ee5a5a;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #ee5a5a;
    border-radius: 2px;
}

.more-link {
    color: #999;
    font-size: 14px;
    transition: color 0.3s;
}

.more-link:hover {
    color: #ee5a5a;
}

.result-count {
    color: #999;
    font-size: 14px;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.video-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.video-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(238, 90, 90, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .play-icon {
    opacity: 1;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.author {
    color: #666;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: #666;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #ee5a5a;
}

.breadcrumb .separator {
    color: #ccc;
}

.breadcrumb .current {
    color: #333;
}

/* 筛选栏 */
.filter-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    padding-top: 5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-options a {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    background-color: #f5f5f5;
    transition: all 0.3s;
}

.filter-options a:hover {
    background-color: #ee5a5a;
    color: #fff;
}

.filter-options a.active {
    background-color: #ee5a5a;
    color: #fff;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a {
    background-color: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background-color: #ee5a5a;
    color: #fff;
    border-color: #ee5a5a;
}

.pagination a.active {
    background-color: #ee5a5a;
    color: #fff;
    border-color: #ee5a5a;
}

.pagination a.disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.pagination .ellipsis {
    color: #999;
}

/* 播放页布局 */
.play-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

.play-main {
    min-width: 0;
}

.play-sidebar {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
}

/* 视频播放器 */
.video-player {
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.player-container {
    position: relative;
    padding-top: 56.25%;
}

.player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-container:hover .player-controls {
    opacity: 1;
}

.play-pause-btn, .volume-btn, .fullscreen-btn {
    color: #fff;
    font-size: 18px;
    padding: 5px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background-color: #ee5a5a;
    border-radius: 2px;
    width: 0%;
}

.time-display {
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}

.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.3);
}

.big-play-btn {
    width: 80px;
    height: 80px;
    background-color: rgba(238, 90, 90, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

.big-play-btn:hover {
    transform: scale(1.1);
    background-color: #ee5a5a;
}

/* 视频详情 */
.video-detail {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-detail .video-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: auto;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    color: #999;
    font-size: 14px;
}

.video-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.action-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    background-color: #f5f5f5;
    color: #666;
    transition: all 0.3s;
}

.action-btn:hover {
    background-color: #ee5a5a;
    color: #fff;
}

.video-desc {
    color: #666;
    line-height: 1.8;
}

.video-desc p {
    margin-bottom: 8px;
}

/* 评论区 */
.comment-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-input {
    margin-bottom: 20px;
}

.comment-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.comment-input textarea:focus {
    border-color: #ee5a5a;
}

.submit-btn {
    margin-top: 10px;
    padding: 10px 30px;
    background-color: #ee5a5a;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #d64545;
}

.comment-list {
    margin-bottom: 20px;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.username {
    font-weight: bold;
    color: #333;
}

.time {
    color: #999;
    font-size: 12px;
}

.comment-text {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions button {
    font-size: 12px;
    color: #999;
    transition: color 0.3s;
}

.comment-actions button:hover {
    color: #ee5a5a;
}

.load-more {
    text-align: center;
}

.load-more-btn {
    padding: 10px 30px;
    background-color: #f5f5f5;
    color: #666;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background-color: #ee5a5a;
    color: #fff;
}

/* 选集 */
.episode-section {
    margin-bottom: 30px;
}

.episode-section .section-title {
    margin-bottom: 15px;
    font-size: 16px;
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.episode-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.episode-item:hover {
    background-color: #ee5a5a;
    color: #fff;
}

.episode-item.active {
    background-color: #ee5a5a;
    color: #fff;
}

/* 相关推荐 */
.related-section .section-title {
    margin-bottom: 15px;
    font-size: 16px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-item a {
    display: flex;
    gap: 10px;
}

.related-thumb {
    position: relative;
    width: 120px;
    height: 68px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-thumb .duration {
    font-size: 10px;
    padding: 1px 4px;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    font-size: 12px;
    color: #999;
}

/* 底部 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #ccc;
    margin: 0 15px;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-info {
    color: #999;
    font-size: 12px;
    line-height: 1.8;
}

/* 友情链接 */
.friend-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.friend-title {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 15px;
    display: block;
}

.friend-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
}

.friend-list a {
    color: #999;
    font-size: 12px;
    transition: color 0.3s;
}

.friend-list a:hover {
    color: #ee5a5a;
}

/* 首页主布局 */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 30px;
}

.main-left {
    min-width: 0;
}

.main-sidebar {
    min-width: 0;
}

/* 排行榜区域 */
.ranking-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ranking-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-bottom: none;
    margin-bottom: 15px;
}

.ranking-section .section-title {
    font-size: 18px;
}

.ranking-tabs {
    display: flex;
    gap: 5px;
}

.ranking-tabs .tab {
    padding: 4px 12px;
    font-size: 12px;
    color: #666;
    background-color: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.ranking-tabs .tab:hover {
    background-color: #ee5a5a;
    color: #fff;
}

.ranking-tabs .tab.active {
    background-color: #ee5a5a;
    color: #fff;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    transition: background-color 0.3s;
}

.ranking-item a:hover {
    background-color: #f9f9f9;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 4px;
}

.rank-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #666;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    flex-shrink: 0;
}

.rank-num.top3 {
    background: linear-gradient(135deg, #ee5a5a 0%, #ff6b6b 100%);
    color: #fff;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-title {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-views {
    font-size: 12px;
    color: #999;
}

/* 轮播图链接样式 */
.banner-item {
    display: block;
    cursor: pointer;
}

.banner-item:hover .banner-info h3 {
    color: #ee5a5a;
}

/* 平板/窄窗口下导航横向滚动，避免栏目名被压缩成竖排 */
@media (max-width: 1199px) {
    .nav-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .nav-list::-webkit-scrollbar {
        display: none;
    }
    .nav-list a {
        white-space: nowrap;
    }
}
