/* 基础样式 */
body {
    background-color: #f5f5f5;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei", sans-serif;
    color: #333;
    line-height: 1.6;
    padding-top: 60px;
}

/* 导航栏 */
.layui-header {
    background-color: #1E9FFF;
    box-shadow: 0 2px 4px rgba(0,0,0,.12);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    line-height: 60px;
}

.layui-header .layui-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layui-logo {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    line-height: 60px;
}

.layui-nav-item a {
    color: rgba(255,255,255,0.9);
    line-height: 60px;
}

.layui-nav-item a:hover {
    color: #fff;
}

.layui-nav-child a {
    color: #333;
}

.layui-nav-child a:hover {
    color: #1E9FFF;
}

/* 搜索框 */
.search-container {
    margin-top: 20px;
    padding: 20px 0;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.12);
}

.search-container .layui-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-container .layui-input {
    border-radius: 4px 0 0 4px;
}

.search-container .layui-btn {
    border-radius: 0 4px 4px 0;
}

/* 分类区域样式 - 修复版 */
.category-section {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin: 20px 0;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.category-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.category-header h3 {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.category-header h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #1E9FFF;
    margin-right: 10px;
    border-radius: 2px;
}

.category-content {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.category-main {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    margin-bottom: 2px;
}

.category-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f8f8f8;
    color: #333;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #eee;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.category-btn:hover {
    background-color: #1E9FFF;
    color: #fff;
    border-color: #1E9FFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 159, 255, 0.3);
}

.category-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.category-btn:hover::after {
    left: 100%;
}

.category-more {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 2px;
    border-top: 1px dashed #eee;
}

#toggleMoreCategories {
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #eee;
    transition: all 0.3s;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#toggleMoreCategories:hover {
    background-color: #1E9FFF;
    color: #fff;
    border-color: #1E9FFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 159, 255, 0.3);
}

#toggleMoreCategories .layui-icon {
    margin-left: 8px;
    transition: transform 0.3s;
}

#toggleMoreCategories:hover .layui-icon {
    transform: translateY(2px);
}

.category-collapse {
    width: 100%;
    margin-top: 15px;
    display: none; /* 默认隐藏 */
    flex-wrap: wrap;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
}

.category-collapse .category-btn {
    margin-bottom: 10px;
}

/* 视频列表 */
.video-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.video-item {
    flex: 0 0 14.2857%;
    padding: 0 10px;
    margin-bottom: 25px;
    box-sizing: border-box;
    min-height: 280px;
}

/* 严格统一图片尺寸 */
.video-poster {
    position: relative;
    width: 165px;
    height: 233px;
    margin: 0 auto 10px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: transform 0.2s;
}

.video-poster:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.video-poster img {
    position: absolute;
    width: 165px;
    height: 233px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* 评分显示 */
.video-score {
    position: absolute;
    right: 5px;
    bottom: 5px;
    background-color: rgba(0,0,0,.7);
    color: #FFB800;
    padding: 2px 5px;
    border-radius: 2px;
    font-size: 12px;
    z-index: 2;
    font-weight: bold;
}

/* 视频标题 */
.video-title {
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
    transition: color 0.2s;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    line-height: 1.4;
    max-height: 39px;
    min-height: 39px;
}

.video-title:hover {
    color: #1E9FFF;
    text-decoration: none;
}

/* 视频信息 */
.video-info {
    font-size: 12px;
    color: #999;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

/* 占位图处理 */
.video-poster img[src="/template/layui/images/placeholder.jpeg"] {
    object-fit: contain;
    background-color: #f0f0f0;
}

/* 页面标题 */
.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

/* 页脚 */
.layui-footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0 20px;
    margin-top: 40px;
}

.footer-links {
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.footer-links a {
    color: #fff;
    margin: 0 10px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #1E9FFF;
}

.copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* 详情页样式 */
.detail-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.detail-poster {
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.detail-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-info {
    padding-left: 20px;
}

.detail-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.detail-meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.detail-meta span {
    margin-right: 15px;
}

.detail-score {
    color: #FFB800;
    font-weight: bold;
    font-size: 16px;
}

.detail-actions {
    margin: 20px 0;
}

.detail-actions .layui-btn {
    margin-right: 10px;
}

.detail-description h3,
.detail-actors h3,
.detail-director h3 {
    font-size: 16px;
    color: #333;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.detail-description p {
    line-height: 1.8;
    color: #666;
}

.actor-list span {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
    padding: 2px 8px;
    background-color: #f0f0f0;
    border-radius: 2px;
    font-size: 12px;
}

/* 评论区样式 */
.comment-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.comment-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.comment-section .layui-textarea {
    min-height: 100px;
    margin-bottom: 10px;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.comment-user {
    font-weight: bold;
    margin-bottom: 5px;
    color: #1E9FFF;
}

.comment-content {
    line-height: 1.6;
    margin-bottom: 5px;
    color: #333;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

/* 推荐区样式 */
.recommend-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.recommend-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

/* 播放页样式 */
.play-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

#dplayer {
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}

.play-notice {
    background-color: #fff8e1;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #ff8f00;
}

.play-notice p {
    margin: 0;
    line-height: 1.6;
}

.play-info {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.play-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.play-meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.play-meta span {
    margin-right: 15px;
}

.play-score {
    color: #FFB800;
    font-weight: bold;
    font-size: 16px;
}

.play-description h3 {
    font-size: 16px;
    color: #333;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.play-description p {
    line-height: 1.8;
    color: #666;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lazyload {
    animation: fadeIn 0.3s ease-in;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-collapse {
    animation: slideDown 0.4s ease-out;
}

/* 图标旋转 */
.layui-icon-down {
    transition: transform 0.3s;
}

.layui-icon-up {
    transform: rotate(180deg);
}

/* 清除浮动 */
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .video-item {
        flex: 0 0 20%;
    }
}

@media (max-width: 992px) {
    .video-item {
        flex: 0 0 25%;
    }
    .detail-container,
    .comment-section,
    .recommend-section,
    .play-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }

    .layui-header {
        height: 50px;
        line-height: 50px;
    }

    .video-item {
        flex: 0 0 33.3333%;
    }

    .video-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        max-height: 36px;
        min-height: 36px;
    }

    .video-info {
        font-size: 11px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 13px;
        margin: 4px;
    }

    #toggleMoreCategories {
        padding: 6px 15px;
        font-size: 13px;
    }

    .category-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .video-item {
        flex: 0 0 50%;
    }

    .video-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
        max-height: 34px;
        min-height: 34px;
    }

    .video-info {
        font-size: 10px;
    }

    .category-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    #toggleMoreCategories {
        padding: 5px 12px;
        font-size: 12px;
    }

    .detail-title,
    .play-title {
        font-size: 20px;
    }

    .section-header h2,
    .recommend-section h2,
    .comment-section h2 {
        font-size: 18px;
    }
}