/* 全局重置 & 基础变量 */
:root {
    /* {固定关键词1}专属配色 */
    --bg-primary: #E8F5E9; /* 浅青蓝 */
    --bg-secondary: #FFFFFF; /* 暖白 */
    --text-primary: #333333; /* 主文本 */
    --text-secondary: #666666; /* 次文本 */
    --accent-primary: #4CAF50; /* 青绿色（核心色） */
    --accent-secondary: #2E7D32; /* 深青绿 */
    --accent-tertiary: #FF9800; /* 橙黄色（点缀） */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* 标签色 */
    --hot-color: #F44336;
    --new-color: #2196F3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
    transition: all 0.3s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 顶部导航 */
.header {
    background-color: var(--bg-secondary);
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 28px;
    color: var(--accent-primary);
    font-weight: 700;
}

.logo-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.search-box {
    display: flex;
    width: 350px;
    max-width: 100%;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background-color: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
}

.search-box button:hover {
    background-color: var(--accent-secondary);
}

/* 全屏分类导航 */
.category-nav {
    background-color: var(--accent-primary);
    color: #fff;
    padding: 15px 0;
    margin-bottom: 20px;
}

.category-list {
    display: flex;
    list-style: none;
    justify-content: space-around;
    flex-wrap: wrap;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.category-item.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.category-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.category-item i {
    font-size: 20px;
}

/* 主要内容区通用样式 */
.main-content {
    padding: 0 0 50px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.content-left {
    flex: 1;
}

.content-right {
    width: 300px;
    flex-shrink: 0;
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-primary);
}

.section-header h2 {
    font-size: 22px;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 热门推荐轮播 */
.carousel-section {
    margin-bottom: 30px;
}

.carousel-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    padding: 30px;
}

.carousel-overlay h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.carousel-overlay p {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}

.prev-control {
    left: 20px;
}

.next-control {
    right: 20px;
}

.carousel-control:hover {
    background-color: var(--accent-primary);
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
}

.carousel-dot.active {
    background-color: var(--accent-primary);
}

/* 视频瀑布流 */
.waterfall-section {
    margin-bottom: 40px;
}

.waterfall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    /* 瀑布流关键：自动适配高度 */
    grid-auto-rows: min-content;
}

.video-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img {
    position: relative;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: auto;
    display: block;
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
}

.hot-badge {
    background-color: var(--hot-color);
}

.new-badge {
    background-color: var(--new-color);
}

.card-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    background-color: rgba(0,0,0,0.7);
}

.card-info {
    padding: 15px;
}

.card-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--accent-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
}

.play-count {
    color: var(--text-secondary);
}

.score {
    color: var(--accent-tertiary);
    font-weight: 700;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 2px 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.load-more-btn {
    display: block;
    width: 200px;
    margin: 0 auto;
    padding: 12px 0;
    background-color: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.load-more-btn:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-3px);
}

/* 侧边栏 */
.sidebar-module {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.sidebar-module h3 {
    font-size: 16px;
    color: var(--accent-secondary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 热门排行 */
.rank-list {
    list-style: none;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #eee;
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-num.top1 {
    background-color: #FFD700;
    color: #fff;
}

.rank-num.top2 {
    background-color: #C0C0C0;
    color: #fff;
}

.rank-num.top3 {
    background-color: #CD7F32;
    color: #fff;
}

.rank-item img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.rank-info {
    flex: 1;
}

.rank-info a {
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-play {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 最近更新 */
.update-list {
    list-style: none;
}

.update-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item a {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.update-time {
    color: var(--accent-primary);
    font-size: 12px;
    white-space: nowrap;
}

.update-title {
    flex: 1;
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 关于{固定关键词1} */
.about-section {
    margin-top: 40px;
}

.about-content {
    background-color: var(--bg-secondary);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.contact-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

/* 页脚 */
.footer {
    background-color: var(--accent-secondary);
    color: #fff;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ccc;
    font-size: 14px;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    font-size: 13px;
    color: #999;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .content-wrapper {
        flex-direction: column;
    }
    .content-right {
        width: 100%;
    }
    .sidebar-module {
        width: 100%;
    }
    .carousel-item img {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    .search-box {
        width: 100%;
    }
    .category-item {
        width: 25%;
        margin-bottom: 10px;
    }
    .carousel-item img {
        height: 300px;
    }
    .waterfall-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 480px) {
    .category-item {
        width: 50%;
    }
    .carousel-item img {
        height: 200px;
    }
    .carousel-overlay h3 {
        font-size: 18px;
    }
    .waterfall-grid {
        grid-template-columns: 1fr;
    }
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}