/**
 * 主样式文件
 * rh888av.com
 * 响应式设计：支持 PC、平板、手机
 */

/* ========== 基础样式 ========== */
* {
    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;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

a:hover {
    color: #667eea;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部导航 ========== */
.header {
    background: var(--bg-header);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 30px;
}

.logo {
    flex-shrink: 0;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.nav {
    flex: 1;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-item a {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.nav-item a:hover,
.nav-item.active a {
    background: rgba(255,255,255,0.2);
    color: white;
}

.search-box {
    flex-shrink: 0;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    width: 200px;
    background: rgba(255,255,255,0.9);
}

.search-box input:focus {
    outline: none;
    background: white;
}

.search-btn {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: rgba(255,255,255,0.3);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* 移动端导航 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav ul {
    list-style: none;
    padding: 60px 0 20px;
}

.mobile-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: #333;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav a:active {
    background: #f5f5f5;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 2001;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-btn:active span {
    background: rgba(255,255,255,0.7);
}

/* ========== Banner ========== */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.banner-content h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.banner-content p {
    font-size: 18px;
    opacity: 0.9;
}

/* ========== 区块样式 ========== */
.section {
    padding: 40px 0;
    background: var(--bg-card);
}

.section:nth-child(even) {
    background: var(--bg-body);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-title {
    font-size: 22px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    color: #667eea;
    font-size: 24px;
}

.section-more {
    color: #667eea;
    font-size: 14px;
}

/* ========== 视频卡片 ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.video-grid-large {
    grid-template-columns: repeat(4, 1fr);
}

.video-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    display: block;
    width: 100%;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.video-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.video-card:hover .video-cover img {
    transform: scale(1.1);
}

.video-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;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #667eea;
}

.vip-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

.video-info {
    padding: 15px;
    display: block;
}

.video-title {
    font-size: 15px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    display: block;
}

.video-title a {
    display: block;
    width: 100%;
    color: var(--text-primary);
}

.video-title a:hover {
    color: #667eea;
}

.video-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* ========== 分类卡片 ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 15px;
}

.category-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 13px;
    opacity: 0.9;
}

/* ========== 排行榜 ========== */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.ranking-item:hover {
    transform: translateX(5px);
}

.ranking-num {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
}

.ranking-num.top {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ranking-info {
    flex: 1;
}

.ranking-info h3 {
    font-size: 15px;
    margin-bottom: 5px;
}

.ranking-meta {
    font-size: 12px;
    color: #999;
}

/* ========== 页脚 ========== */
.footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    display: inline-block;
    margin: 0 15px;
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: white;
}

.footer-info p {
    margin: 8px 0;
    font-size: 13px;
}

.copyright {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

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

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    min-width: 40px;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .prev,
.pagination .next {
    font-weight: 500;
}

/* ========== 面包屑 ========== */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #999;
}

.breadcrumb .current {
    color: #999;
}

/* ========== 返回顶部 ========== */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 50px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 18px;
    color: #999;
}

/* ========== 响应式设计 ========== */

/* 平板 */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .video-grid-large {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .search-box input {
        width: 150px;
    }
}

/* 手机横屏 */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }
    
    .search-box form {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
        width: auto;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .video-grid-large {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner-content h1 {
        font-size: 24px;
    }
    
    .banner-content p {
        font-size: 14px;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .section-title {
        font-size: 18px;
    }
}

/* 手机竖屏 */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .video-card {
        border-radius: 8px;
    }
    
    .video-info {
        padding: 10px;
    }
    
    .video-title {
        font-size: 13px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-item {
        padding: 10px;
    }
    
    .footer-links a {
        display: block;
        margin: 8px 0;
    }
    
    .back-to-top {
        right: 15px;
        bottom: 30px;
        width: 45px;
        height: 45px;
    }
}

/* ========== 广告样式 ========== */
.ad-section {
    padding: 20px 0;
    background: white;
}

.ad-banner {
    margin: 20px auto;
    text-align: center;
}

.ad-banner-960x80 {
    max-width: 960px;
}

.ad-banner img {
    display: block;
    margin: 0 auto;
}

.ad-code {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-code-cover {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

/* 视频卡片广告 - 强制与普通视频卡片大小一致，消除所有间距 */
.video-card.ad-card {
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    line-height: 0;
    font-size: 0;
    background: #f0f0f0;
}

.video-card.ad-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.video-card.ad-card a img,
.video-card.ad-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    vertical-align: top;
    line-height: 0;
}

/* 确保广告卡片内的任何元素都适应卡片容器 */
.video-card.ad-card > a > *,
.video-card.ad-card a > div,
.video-card.ad-card a > img {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
}

/* 广告卡片内的所有元素消除间距 */
.video-card.ad-card p,
.video-card.ad-card div,
.video-card.ad-card span,
.video-card.ad-card br,
.video-card.ad-card .video-info,
.video-card.ad-card .video-meta,
.video-card.ad-card .video-title {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
    display: none;
}

/* 导航栏下方广告容器 - 消除所有间距 */
.nav-ad-container {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    line-height: 0;
    font-size: 0;
    padding: 0;
    margin: 0;
}

.nav-ad-container > div {
    line-height: 0;
    font-size: 0;
}

.nav-ad-container a {
    display: inline-block;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.nav-ad-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    vertical-align: top;
    line-height: 0;
}

/* 移除广告容器内所有元素的默认边距 */
.nav-ad-container p,
.nav-ad-container div,
.nav-ad-container br,
.nav-ad-container span {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}

/* ========== 主题切换支持 ========== */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ========== 辅助类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
