/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ========== 头部导航 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e94560;
    letter-spacing: 1px;
    white-space: nowrap;
}

.logo span {
    color: #fff;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    order: 0;
}

/* 移动端搜索按钮 */
.search-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
}

.header-right {
    display: none;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e94560;
    letter-spacing: 1px;
    white-space: nowrap;
}

.logo span {
    color: #fff;
}

/* 下拉菜单 */
.nav-has-sub {
    position: relative;
}

.nav-has-sub > a.nav-paren-link {
    display: block;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-has-sub > a.nav-paren-link:hover {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a2e;
    border-radius: 10px;
    padding: 6px;
    min-width: 140px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.08);
}

.nav-has-sub:hover .nav-sub {
    display: block;
}

.nav-sub li {
    list-style: none;
}

.nav-sub li a {
    display: block;
    padding: 7px 12px;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-sub li a:hover {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

@media (max-width: 768px) {
    .nav-has-sub {
        position: static;
    }

    .nav-sub {
        display: none;
        position: static;
        background: rgba(0,0,0,0.2);
        box-shadow: none;
        border: none;
        padding: 0 0 4px 16px;
        min-width: auto;
        border-radius: 8px;
        margin: 2px 0 2px 8px;
        transform: none;
        left: auto;
    }

    .nav-has-sub.open .nav-sub {
        display: block;
    }

    .nav-sub li a {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    /* 遮罩层 */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .nav-overlay.show {
        display: block;
    }
}

/* ========== 主内容占位 ========== */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 64px 16px 40px;
}

/* ========== 友情链接区块（content 上方） ========== */
.friendly-links-block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 24px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.friendly-links-block a {
    font-size: 0.86rem;
    color: #666;
}
.friendly-links-block a:hover {
    color: #e94560;
}

/* ========== 搜索区域 ========== */
.search-section {
    margin-bottom: 32px;
}

/* 搜索空状态 */
.search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.search-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-empty p {
    font-size: 1.1rem;
    color: #bbb;
}

.search-form {
    display: flex;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-form input {
    flex: 1;
    padding: 14px 22px;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-form input:focus {
    border-color: #e94560;
}

.search-form button {
    padding: 14px 28px;
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.search-form button:hover {
    opacity: 0.9;
}

/* ========== 分类标签 ========== */
.category-tabs {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 24px; justify-content: center;
}
.cat-tab {
    padding: 6px 16px; border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    background: var(--card-bg, #1a1a2e);
    color: var(--text-muted, #999);
    font-size: .82rem; font-weight: 500;
    text-decoration: none; cursor: pointer; transition: all .2s;
}
.cat-tab:hover { color: #fff; background: var(--accent-color, #e94560); border-color: var(--accent-color, #e94560); }
.cat-tab.active { background: var(--accent-color, #e94560); color: #fff; border-color: var(--accent-color, #e94560); }

/* ========== 视频网格 300x250 ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
}

/* 网格广告行 — 自动填充列 */
.grid-ad-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

@media (max-width: 768px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; justify-items: stretch; }
    .grid-ad-row { grid-template-columns: repeat(2, 1fr); gap: 12px; justify-items: stretch; }
}

/* ===== 统一网格卡片 固定 300x250 ===== */

/* 网格广告卡 */
.grid-ad {
    width: 300px;
    height: 250px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.grid-ad img,
.grid-ad video,
.grid-ad iframe,
.grid-ad ins {
    max-width: 300px !important;
    max-height: 250px !important;
}

/* Exo 原生广告 2x2 网格排列 — 用 :not(#_) 注入ID特异性覆盖Exo自带样式 */
.grid-ad .exo-native-widget:not(#_) {
    width: 300px !important;
    height: 250px !important;
    max-width: 300px !important;
    max-height: 250px !important;
    min-width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-header {
    display: none !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-outer-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 0 !important;
    height: 250px !important;
    width: 300px !important;
    max-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-content: stretch !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-container {
    width: 150px !important;
    height: 125px !important;
    max-width: 150px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-basis: auto !important;
    overflow: hidden !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-image-wrapper {
    width: 150px !important;
    height: 85px !important;
    max-height: 85px !important;
    border-radius: 4px 4px 0 0 !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-image-ratio {
    display: none !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-content {
    position: relative !important;
    top: auto !important;
    height: 40px !important;
    width: 150px !important;
    max-width: 150px !important;
    padding: 2px 4px !important;
    border-radius: 0 0 4px 4px !important;
    background: rgba(0,0,0,0.03) !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-content:before {
    display: none !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-title {
    font-size: 10px !important;
    line-height: 1.3 !important;
    height: 18px !important;
    padding: 0 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-brand {
    font-size: 9px !important;
    height: 14px !important;
    padding: 0 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-text {
    display: none !important;
}
.grid-ad [class*="pLDP"] {
    width: 300px !important;
    height: 250px !important;
    overflow: hidden !important;
}

/* 视频卡片 — 固定 300x250 */
.video-card {
    width: 300px;
    height: 250px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.thumbnail {
    flex: 1;
    width: 100%;
    overflow: hidden;
    background: #ddd;
    position: relative;
}

@media (max-width: 768px) {
    .grid-ad,
    .video-card {
        width: 100%;
        height: auto;
        aspect-ratio: 6 / 5;
    }
    .grid-ad img,
    .grid-ad video,
    .grid-ad iframe,
    .grid-ad ins {
        max-width: 100% !important;
        max-height: 100% !important;
    }
    .grid-ad .exo-native-widget:not(#_) {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-outer-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-container {
        width: 50% !important;
        height: 50% !important;
        max-width: 50% !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-image-wrapper {
        width: 100% !important;
        height: 68% !important;
        max-height: 68% !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-content {
        width: 100% !important;
        height: 32% !important;
        max-width: 100% !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-title {
        font-size: 9px !important;
    }
    .grid-ad .exo-native-widget:not(#_) .exo-native-widget-item-brand {
        font-size: 8px !important;
    }
    .grid-ad [class*="pLDP"] {
        width: 100% !important;
        height: 100% !important;
    }
}
.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-info {
    flex-shrink: 0;
    padding: 10px 12px;
}
.video-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.video-meta {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}
.video-tag-link {
    color: #e94560;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.video-tag-link:hover {
    opacity: 0.7;
}

/* 空状态 */
.grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}
.grid-ad-container {
    margin-bottom: 20px;
}

/* ========== 搜索页面结果信息 ========== */
.search-result-info {
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: #666;
}

.search-result-info .search-keyword strong {
    color: #e94560;
}

.search-result-info .search-count {
    color: #888;
}

/* ========== 导航菜单 ========== */
.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-list li a {
    display: block;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.nav-list li a:hover,
.nav-list li a.active,
.nav-list li a.parent-active {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

/* ========== 头部搜索图标 ========== */
.header-search-icon {
    display: none;
    font-size: 1.2rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    padding: 4px;
}

.header-search-icon:hover {
    color: #e94560;
}

.nav-search-li {
    display: list-item;
}

/* ========== 广告位 ========== */
.ad-container {
    background: #f0f0f0;
    padding: 4px 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.ad-container.ad-top {
    margin-top: 60px;
}

.ad-container.ad-bottom {
    margin-bottom: 0;
}

.ad-container.ad-video-mid {
    margin: 20px 0;
    background: transparent;
    padding: 0;
}

.ad-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    box-sizing: border-box;
    overflow: visible;
}

.ad-link {
    line-height: 0;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.ad-link:hover {
    opacity: 0.85;
}

.ad-link img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* 广告横幅 - 自然宽度，居中排列 */
.ad-banner {
    text-align: center;
    line-height: 0;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}
.ad-banner:empty {
    display: none;
}
.ad-banner > * {
    max-width: 728px;
    margin: 0 auto;
}

.ad-label {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.ad-text {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .ad-container.ad-top,
    .ad-container.ad-bottom {
        background: transparent;
        padding: 4px 0;
    }

    .ad-container {
        width: 100%;
        margin-left: 0;
    }

    .ad-inner {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 0 8px;
        overflow: hidden;
    }

    .ad-link img {
        max-width: 100%;
        height: auto;
    }

    .ad-banner {
        min-height: 70px;
        max-width: 100%;
        overflow: hidden;
    }

    .ad-text {
        font-size: 0.9rem;
    }

    /* 确保广告内图片不溢出 */
    .ad-banner img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ========== 分类标签（首页） ========== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.cat-tab {
    padding: 8px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.88rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-tab:hover {
    border-color: #e94560;
    color: #e94560;
}

.cat-tab.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}

/* ========== 页面横幅 ========== */
.page-banner {
    text-align: center;
    padding: 20px 0 28px;
}

.page-banner h1 {
    font-size: 1.6rem;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.page-banner p {
    font-size: 0.95rem;
    color: #888;
}

/* ========== 筛选栏（热门页） ========== */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.filter-btn {
    padding: 8px 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

.filter-btn.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}

/* ========== 热门列表 ========== */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s;
}

.hot-item:hover {
    transform: translateX(4px);
}

.hot-rank {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #888;
    border-radius: 8px;
    flex-shrink: 0;
}

.hot-rank.top {
    color: #fff;
    background: #e94560;
}

.hot-rank.top:nth-child(1) { background: #e94560; }
.hot-rank.top:nth-child(2) { background: #e07c24; }
.hot-rank.top:nth-child(3) { background: #2d6a4f; }

.hot-thumb {
    width: 160px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.hot-info {
    flex: 1;
    min-width: 0;
}

.hot-title {
    font-size: 1rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    color: #333;
    transition: color 0.2s;
}

.hot-title:hover {
    color: #e94560;
}

.hot-meta {
    font-size: 0.82rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ========== 分类详情页 ========== */
.category-detail {
    margin-bottom: 28px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.detail-header {
    padding: 32px 28px;
    color: #fff;
}

.detail-header-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.detail-icon {
    font-size: 3rem;
    flex-shrink: 0;
    line-height: 1;
}

.detail-text h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-text p {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 12px;
}

.detail-count {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
}

.detail-actors {
    background: #fff;
    padding: 20px 28px;
}

.detail-actors h3 {
    font-size: 1rem;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.actor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.detail-actor {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f8f8;
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    font-size: 0.88rem;
    color: #555;
}

.actor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .detail-header {
        padding: 24px 20px;
    }

    .detail-header-content {
        flex-direction: column;
        gap: 12px;
    }

    .detail-icon {
        font-size: 2.2rem;
    }

    .detail-text h2 {
        font-size: 1.2rem;
    }

    .detail-text p {
        font-size: 0.88rem;
    }

    .detail-actors {
        padding: 16px 20px;
    }

    .actor-list {
        gap: 10px;
    }

    .detail-actor {
        font-size: 0.82rem;
        padding: 6px 12px 6px 6px;
    }

    .actor-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

/* ========== 标签页面 ========== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 16px;
    margin-bottom: 28px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.tag-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 8px 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.tag-category-header:first-child {
    margin-top: 0;
}

.tag-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.tag-cat-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
}

.tag-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.88rem;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.tag-badge:hover {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

.tag-badge.active {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
    font-weight: 600;
}

/* ========== 标签详情（复用分类详情的样式） ========== */
.tag-detail {
    margin-bottom: 28px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .tag-cloud {
        padding: 14px;
        gap: 8px 10px;
    }

    .tag-badge {
        padding: 5px 12px;
        font-size: 0.82rem;
    }
}

/* ========== 分类浏览页面 ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.category-card {
    border-radius: 10px;
    padding: 16px 14px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.cat-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.cat-card-desc {
    font-size: 0.72rem;
    opacity: 0.7;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.cat-card-count {
    font-size: 0.7rem;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

/* ========== 推荐页面 ========== */
.recommend-featured {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.featured-card {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
}

.featured-link {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 20px;
    text-decoration: none;
    color: #fff;
}

.featured-content {
    position: relative;
    z-index: 1;
}

.featured-badge {
    display: inline-block;
    background: #e94560;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.featured-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========== 我的页面 ========== */
.profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 28px;
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

.profile-info h2 {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.profile-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
}

.mine-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 36px;
}

.mine-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border-radius: 12px;
    padding: 24px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #333;
}

.mine-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.mine-icon {
    font-size: 1.8rem;
}

.mine-card span:last-child {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========== 公告页面 ========== */
.page-header {
    text-align: center;
    padding: 40px 0 30px;
}

.page-title {
    font-size: 1.8rem;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.page-desc {
    font-size: 0.95rem;
    color: #888;
}

.notice-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
}

.notice-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    cursor: default;
}

.notice-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.notice-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.notice-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
}

.notice-date {
    font-size: 0.82rem;
    color: #aaa;
}

.notice-title {
    font-size: 1.15rem;
    color: #1a1a2e;
    margin-bottom: 10px;
    font-weight: 600;
}

.notice-preview {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 12px;
}

.notice-read-btn {
    background: none;
    border: none;
    color: #e94560;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
    transition: opacity 0.2s;
}

.notice-read-btn:hover {
    opacity: 0.7;
}

/* 响应式 */
@media (max-width: 768px) {
    .notice-card {
        padding: 18px 16px;
    }
    .page-title {
        font-size: 1.4rem;
    }
}

/* ========== 区域标题 ========== */
.section-title {
    font-size: 1.15rem;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e94560;
    display: inline-block;
}

/* ========== 视频详情页 ========== */
.video-detail-page .main {
    padding-top: 64px;
}

.video-player-section {
    margin-bottom: 24px;
}

.video-player-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    z-index: 1;
}

/* 全屏模式：覆盖限制，撑满整个屏幕 */
.video-player-wrapper:fullscreen,
.video-player-wrapper:-webkit-full-screen {
    border-radius: 0 !important;
    overflow: visible !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}
.video-player-wrapper:fullscreen .video-player,
.video-player-wrapper:-webkit-full-screen .video-player {
    aspect-ratio: unset !important;
    width: 100% !important;
    height: 100% !important;
}
.video-player-wrapper:fullscreen video,
.video-player-wrapper:-webkit-full-screen video,
.video-player-wrapper:fullscreen iframe,
.video-player-wrapper:-webkit-full-screen iframe {
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* 视频内嵌元素 z-index 统一低于导航菜单 */
.video-player video,
.video-player iframe {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(233, 69, 96, 0.9);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.play-btn-large:hover {
    transform: scale(1.1);
    background: #e94560;
}

/* 暂停时覆盖在视频上的大播放按钮 */
.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: rgba(233, 69, 96, 0.85);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.play-btn-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #e94560;
}

.player-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 3;
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 16px 12px;
    z-index: 3;
    display: none;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #e94560;
    border-radius: 2px;
    transition: width 0.2s;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.ctrl-btn:hover {
    opacity: 1;
}

.time-display {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ========== 视频详情信息 ========== */
.video-detail-info {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.video-detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    line-height: 1.5;
}

.video-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-uploader {
    display: flex;
    align-items: center;
    gap: 10px;
}

.uploader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.detail-stats {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dot {
    color: #ccc;
}

.detail-tag-link {
    color: #e94560;
    text-decoration: none;
    font-weight: 500;
}

.detail-tag-link:hover {
    text-decoration: underline;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.action-btn {
    padding: 8px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

.like-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

.video-detail-desc {
    font-size: 0.92rem;
    color: #666;
    line-height: 1.7;
}

/* ========== 缩略图 ========== */
.thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.thumb-text {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    user-select: none;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pagination .page-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

.pagination .page-btn.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
    font-weight: 600;
}

.pagination .page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .page-btn.ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    min-width: 20px;
    color: #aaa;
}

.pagination .page-btn.ellipsis:hover {
    color: #aaa;
}

/* ========== 页脚（极简版） ========== */
.footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
    padding: 36px 16px 0;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 20px;
    font-size: 1.05rem;
    font-weight: 500;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    padding: 6px 8px;
    border-radius: 6px;
}

.footer-links a:hover {
    color: #fff;
    background: rgba(233, 69, 96, 0.15);
}

.footer-contact {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.2s;
}

.footer-contact a:hover {
    color: #e94560;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    padding: 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ========== 响应式：平板 ========== */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .recommend-featured {
        grid-template-columns: repeat(2, 1fr);
    }

    .mine-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== 响应式：手机 ========== */
@media (max-width: 768px) {
    .header-inner {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
        padding: 0 8px;
    }

    .menu-toggle {
        display: block;
        justify-self: start;
    }

    .logo {
        justify-self: center;
    }

    .header-right {
        display: flex;
        justify-self: end;
    }

    .search-toggle {
        display: inline-flex;
    }

    .nav-list {
        display: flex;
        position: fixed;
        top: 0;
        right: -280px;
        bottom: 0;
        left: auto;
        width: 280px;
        background: #1a1a2e;
        flex-direction: column;
        padding: 20px 16px;
        gap: 2px;
        border-top: none;
        box-shadow: -4px 0 30px rgba(0,0,0,0.5);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        /* 提升到独立合成层，避免被 video 元素遮挡 */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .nav-list.open {
        right: 0;
    }

    .nav-list li a {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .header-search-icon {
        display: block;
    }

    .nav-search-li {
        display: none;
    }

    .search-form input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .search-form button {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .video-title {
        font-size: 0.9rem;
    }

    .video-info {
        padding: 10px 12px;
    }

    /* 分类标签移动端 */
    .category-tabs {
        gap: 6px;
        margin-bottom: 18px;
    }

    .cat-tab {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    /* 热门列表移动端 */
    .hot-item {
        padding: 10px 12px;
        gap: 12px;
    }

    .hot-thumb {
        width: 120px;
    }

    .hot-title {
        font-size: 0.9rem;
    }

    /* 分类网格 */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 16px 14px;
    }

    /* 推荐大图 */
    .recommend-featured {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .featured-title {
        font-size: 0.9rem;
    }

    /* 我的页面 */
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .profile-stats {
        justify-content: center;
    }

    .mine-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 视频详情 */
    .video-detail-info {
        padding: 18px 16px;
    }

    .video-detail-title {
        font-size: 1.1rem;
    }

    .video-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .detail-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .play-btn-large {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* 分页移动端 */
    .pagination {
        gap: 4px;
        margin-top: 28px;
    }

    .pagination .page-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 0.85rem;
    }

    /* 页脚移动端 */
    .footer {
        padding: 28px 12px 0;
    }

    .footer-links {
        gap: 6px 14px;
        font-size: 0.92rem;
    }

    .footer-contact {
        font-size: 0.82rem;
    }

    .footer-bottom {
        font-size: 0.75rem;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 52px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .main {
        padding-top: 56px;
    }

    .search-form input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .search-form button {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .video-title {
        font-size: 0.85rem;
    }

    .video-meta {
        font-size: 0.75rem;
    }

    .page-banner h1 {
        font-size: 1.3rem;
    }

    .hot-thumb {
        width: 90px;
    }

    .hot-title {
        font-size: 0.85rem;
    }

    .hot-meta {
        font-size: 0.75rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .mine-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mine-card {
        padding: 18px 12px;
    }

    .mine-icon {
        font-size: 1.4rem;
    }

    .avatar-placeholder {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .video-player-wrapper {
        border-radius: 10px;
    }

    .play-btn-large {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* 分页 */
    .pagination {
        margin-top: 24px;
        gap: 3px;
    }

    .pagination .page-btn {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    /* 页脚 */
    .footer {
        padding: 24px 10px 0;
    }

    .footer-links {
        gap: 4px 10px;
        font-size: 0.88rem;
    }

    .footer-contact {
        font-size: 0.78rem;
    }

    /* 移动端：网格广告跨列全宽显示 */
    .video-grid .grid-ad {
        padding: 0;
    }
    .video-grid .grid-ad .ad-link,
    .video-grid .grid-ad .ad-banner {
        display: block !important;
        text-align: center;
    }

    /* 视频详情页移动端适配 */
    .video-detail-page {
        display: flex;
        flex-direction: column;
    }
    .video-player-section,
    .video-detail-info {
        width: 100%;
    }
    .video-detail-info {
        padding: 12px 4px;
    }
    .video-detail-title {
        font-size: 1rem;
    }
    .detail-stats {
        flex-wrap: wrap;
        gap: 4px;
    }
    .detail-actions {
        flex-wrap: wrap;
    }
    .action-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* 分类卡片移动端 */
    .category-card {
        padding: 20px 16px;
    }
    .cat-card-name {
        font-size: 1rem;
    }

    /* 公告卡片移动端 */
    .notice-card {
        padding: 16px;
    }
    .notice-title {
        font-size: 1rem;
    }

    /* 标签详情 header */
    .detail-header {
        padding: 24px 16px;
    }
    .detail-header h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .video-info {
        padding: 8px;
    }
    .video-title {
        font-size: 0.8rem;
    }
    .video-meta {
        font-size: 0.7rem;
    }
}

/* ========== 标签列表 ========== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0 0;
    margin-top: 12px;
}

.tag-item {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: default;
    transition: background 0.2s;
}

.tag-item:hover {
    background: rgba(255, 255, 255, 0.2);
}
