/* 全局重置和基本样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: #1a1a1a;
    color: #ddd;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #ddd;
    transition: all 0.3s ease;
}

a:hover {
    color: #ff69b4;
}

/* 容器 */
.container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部和导航栏 */
.header {
    background-color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 26px;
    font-weight: bold;
    color: #eee;
    white-space: nowrap;
    margin-right: 40px;
}

.nav {
    flex: 1;
    margin-left: 20px;
}

.category-grid {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 5px 10px;
    border-radius: 6px;
    min-height: 160px;
    background-color: #2a2a2a;
    position: relative;
    overflow: visible;
}

.grid-item {
    position: relative;
    text-align: center;
}

.grid-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #444;
    border-radius: 6px;
    background-color: #333;
    color: #ddd;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.grid-item a:hover,
.grid-item.active a {
    background-color: #3a3a3a;
    border-color: #ff69b4;
    color: #ff69b4;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.2);
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 6px;
    list-style: none;
    min-width: 120px;
    z-index: 101;
    border: 1px solid #444;
}

.submenu li a {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    background-color: #333;
    color: #ccc;
    transition: all 0.3s ease;
}

.submenu li a:hover {
    background-color: #444;
    color: #ff69b4;
}

.grid-item:hover .submenu {
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 4px 8px;
        min-height: 120px;
    }
    .grid-item a {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 4px;
    }
    .submenu {
        position: static;
        display: none;
    }
    .grid-item:hover .submenu {
        display: block;
    }
}

/* 英雄区 */
.hero-section {
    text-align: center;
    padding: 20px 0;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 0;
    border-bottom: none;
}

.hero-title {
    font-size: 24px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 14px;
    color: #bbb;
    margin-bottom: 8px;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
}

.hero-search form {
    display: flex;
    border: 1px solid #444;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    background-color: #333;
}

.hero-search .search-input {
    flex: 1;
    border: none;
    padding: 8px 16px;
    outline: none;
    font-size: 14px;
    background-color: #333;
    color: #ddd;
}

.hero-search .search-input::placeholder {
    color: #888;
}

.hero-search .search-button {
    border: none;
    background-color: #ff69b4;
    color: #fff;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.hero-search .search-button:hover {
    background-color: #e75480;
}

/* 视频模块 */
.video-section {
    margin: 10px 0;
    background-color: #222;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 4px solid #ff69b4;
}

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

.more-link {
    font-size: 14px;
    color: #aaa;
    transition: color 0.3s ease;
}

.more-link:hover {
    color: #ff69b4;
}

.video-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 20px !important;
}

.video-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #444;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(255, 105, 180, 0.15);
}

.video-card:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.video-card-image {
    position: relative;
    padding-top: 56.25%;
    background-color: #333;
}

.video-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.video-card-image img.lazyload:not(.lazyloaded) {
    background: url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==') no-repeat center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card-image img.lazyloaded {
    opacity: 1;
}

.video-card-label {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}

.video-card.free .video-card-label {
    background-color: #c71585;
}

.video-card-info {
    padding: 14px;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    color: #eee;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 分页 */
.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ddd;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover {
    background-color: #ff69b4;
    color: #fff;
    border-color: #ff69b4;
}

.pagination .active {
    background-color: #ff69b4;
    color: #fff;
    border-color: #ff69b4;
}

/* 视频详情页 */
.video-detail-section {
    margin: 10px 0;
    background-color: #222;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-detail-header {
    margin-bottom: 24px;
}

.video-detail-title {
    font-size: 28px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 12px;
}

.video-detail-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.video-detail-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #333;
    border-radius: 8px;
    overflow: hidden;
}

.video-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.video-detail-image img.lazyload:not(.lazyloaded) {
    background: url('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==') no-repeat center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-detail-image img.lazyloaded {
    opacity: 1;
}

/* 视频播放页 */
.video-play-section {
    margin: 10px 0;
    background-color: #222;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-play-header {
    margin-bottom: 24px;
}

.video-play-title {
    font-size: 28px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 12px;
}

.video-play-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.video-player {
    position: relative;
    padding-top: 56.25%;
    background-color: #333;
}

.video-player #dplayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* 热门标签云 */
.tags-section {
    margin: 10px 0;
    background-color: #222;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-item {
    padding: 8px 16px;
    background-color: #333;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s;
    color: #ddd;
}

.tag-item:hover {
    background-color: #ff69b4;
    color: #fff;
}

/* 调试信息 */
.debug-info {
    font-size: 12px;
    color: #ff4444;
    background-color: #333;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* 页脚 */
.footer {
    background-color: #222;
    padding: 40px 0;
    text-align: center;
    color: #aaa;
    font-size: 14px;
    border-top: 1px solid #444;
    margin-top: 10px;
}

.footer p {
    margin-bottom: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 16px !important;
    }

    .video-detail-content,
    .video-play-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .video-detail-image {
        aspect-ratio: 16/9;
    }

    .container {
        padding: 0 12px;
    }

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

/* 分页组件（Element UI 风格） */
.pagination { display:flex; justify-content:center; margin:24px 0; }
.el-pager { display:flex; gap:8px; list-style:none; padding:0; margin:0; }

.el-pager .number,
.el-pager .pager-prev,
.el-pager .pager-next {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  line-height: 34px;
  text-align: center;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}

.el-pager a { display:block; text-decoration:none; color:#111827; }
.el-pager .active { background:#111827; border-color:#111827; }
.el-pager .active span { color:#fff; }

.el-pager .is-disabled { opacity:.45; cursor:not-allowed; }
.el-pager .is-disabled span { color:#6b7280; }

.search-title {
    font-size: 28px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 12px;
}

/* ==================== 新增/修改：detail 和 play 页面优化样式 ==================== */

/* 视频详情页 - 右侧信息栏（统一卡片，垂直居中） */
.video-info-sidebar {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: #ddd;
    align-self: center; /* 垂直居中 */
}

.video-info-sidebar .info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #444;
}

.video-info-sidebar .info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.video-info-sidebar .info-label {
    font-weight: 600;
    color: #eee;
    min-width: 60px;
    margin-right: 12px;
    flex-shrink: 0;
}

.video-info-sidebar .info-content {
    flex: 1;
    color: #ddd;
    word-break: break-word;
}

.video-info-sidebar .info-content a {
    color: #ff69b4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.video-info-sidebar .info-content a:hover {
    color: #fff;
    text-decoration: underline;
}

.video-info-sidebar .info-content .category-link {
    color: #fff; /* 分类文字设为白色 */
}

/* 类型和标签卡片（下方） */
.info-card {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

.info-card h2 {
    font-size: 16px;
    font-weight: 600;
    color: #eee;
    margin: 0 0 12px 0;
    border-left: 3px solid #ff69b4;
    padding-left: 8px;
}

.class-list,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* detail 和 play 页面类型和标签（统一配色） */
.detail-info-card .class-list a,
.play-info-card .class-list a {
    padding: 6.8px 12.6px; /* 减小约1/6 from 8.2px 15.1px */
    background-color: #6b7280; /* 柔和灰蓝色 */
    border-radius: 20px;
    font-size: 12.6px; /* 减小约1/6 from 15.1px */
    color: #fff;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.detail-info-card .class-list a:hover,
.play-info-card .class-list a:hover {
    background-color: #555b66; /* 稍深灰蓝色 */
    color: #fff;
}

.detail-info-card .tag-list a,
.play-info-card .tag-list a {
    padding: 6.8px 12.6px; /* 减小约1/6 from 8.2px 15.1px */
    background-color: #8b7b9b; /* 柔和淡紫色 */
    border-radius: 20px;
    font-size: 12.6px; /* 减小约1/6 from 15.1px */
    color: #fff;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.detail-info-card .tag-list a:hover,
.play-info-card .tag-list a:hover {
    background-color: #736384; /* 稍深淡紫色 */
    color: #fff;
}

/* 播放按钮和线路按钮样式 */
.play-button,
.play-line {
    display: inline-block;
    padding: 9.4px 18.7px; /* 保持增大约10% from 8.5px 17px */
    background-color: #9b59b6; /* 亮紫色，抢眼 */
    border-radius: 6px;
    font-size: 16px; /* 保持增大约10% from 14.5px */
    font-weight: 600; /* 加粗 */
    color: #fff; /* 文字始终白色 */
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.play-button:hover,
.play-line:hover {
    background-color: #8e44ad; /* 稍深紫色 */
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.5); /* 悬停发光效果 */
    transform: scale(1.05); /* 轻微放大 */
}

.play-line {
    margin-left: 8px;
}

.play-line.active {
    background-color: #8e44ad; /* 激活状态与悬停一致 */
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .video-info-sidebar {
        align-self: stretch; /* 移动端占满宽度 */
    }
    .video-info-sidebar .info-row {
        flex-direction: column;
        gap: 4px;
    }
    .video-info-sidebar .info-label {
        min-width: auto;
        font-size: 14px;
    }
    .info-card {
        padding: 12px;
    }
    .info-card h2 {
        font-size: 15px;
    }
    .detail-info-card .class-list a,
    .detail-info-card .tag-list a,
    .play-info-card .class-list a,
    .play-info-card .tag-list a {
        padding: 6px 11px;
        font-size: 11.7px;
    }
    .play-button,
    .play-line {
        padding: 8.3px 16.5px;
        font-size: 14.3px;
    }
}