/**
 * 视频网站全局样式 - 明亮主题（美化增强版）
 */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-light: #8b9cf7;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fb;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --accent: #ff4757;
    --success: #2ed573;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 48px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== 顶部导航（美化版） ===== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
    backdrop-filter: blur(10px);
}

.header .logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header .search-bar {
    flex: 1;
    max-width: 560px;
    margin: 0 40px;
    position: relative;
}

.header .search-bar input {
    width: 100%;
    padding: 11px 44px 11px 18px;
    border: none;
    border-radius: 24px;
    background: rgba(255,255,255,0.95);
    color: #333;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header .search-bar input::placeholder {
    color: rgba(0,0,0,0.4);
}

.header .search-bar input:focus {
    background: #fff;
    box-shadow: 0 4px 16px rgba(255,255,255,0.25), 0 0 0 3px rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.header .search-bar button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.header .search-bar button:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
}

.header .nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header .nav-links a {
    color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
}

.header .nav-links a:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== 首页布局系统（优化版） ===== */
.home-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.home-main {
    flex: 1;
    min-width: 0;
}

.home-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* 大屏幕优化 - 充分利用宽屏空间 */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    .home-sidebar {
        width: 340px;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    .home-sidebar {
        width: 360px;
    }
}

/* 排行榜标签页（美化版） */
.rank-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rank-tabs .tab {
    padding: 7px 16px;
    border-radius: 18px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    user-select: none;
}

.rank-tabs .tab:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.rank-tabs .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* ===== 主内容区 ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

/* ===== 幻灯片广告位（美化版） ===== */
.slide-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 28px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background: var(--bg-card);
    display: none; /* 默认隐藏，有数据时显示 */
}

.slide-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 30%; /* 约 3.3:1 宽高比，适合桌面横幅广告 */
    overflow: hidden;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: 1;
}

.slide-item.active {
    opacity: 1;
    z-index: 2;
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.slide-link:hover {
    transform: scale(1.02);
}

.slide-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: #f0f0f0;
}

.slide-nav {
    display: none; /* 隐藏左右箭头按钮 */
}

.slide-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.8);
}

.slide-dot.active {
    background: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.slide-dot:hover {
    background: rgba(255,255,255,0.9);
}

/* ===== 分类标签（美化版） ===== */
.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding: 4px 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 8px 8px 8px;
    box-shadow: var(--shadow-sm);
}

.category-tabs::-webkit-scrollbar {
    height: 6px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.category-tabs::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.category-tabs .tab {
    padding: 9px 22px;
    border-radius: 22px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    user-select: none;
}

.category-tabs .tab:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-tabs .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* ===== 视频网格（美化版） ===== */
.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-shadow: var(--shadow-sm);
}

.video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 36px;
}

.video-card {
    flex: 1 1 calc(25% - 24px);
    min-width: 220px;
    max-width: 100%;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border);
    display: block;
    box-shadow: var(--shadow-sm);
}

/* 首个视频大封面样式（全宽显示） */
.video-card.featured {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
}

.video-card.featured .cover-wrap {
    padding-top: 45%; /* 更扁平的宽高比，适合大封面 */
    border-radius: 16px 16px 0 0;
}

.video-card.featured .cover-wrap img {
    object-fit: cover; /* 自动裁剪铺满容器 */
}

.video-card.featured .play-icon {
    width: 72px;
    height: 72px;
}

.video-card.featured .play-icon::after {
    font-size: 28px;
}

.video-card.featured .info {
    padding: 18px 20px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}

.video-card.featured .title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.video-card.featured .meta {
    font-size: 14px;
    gap: 12px;
}

.video-card.featured .badge {
    padding: 4px 12px;
    font-size: 12px;
}

.video-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.video-card .cover-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, #e8ecf1 0%, #d5dce5 100%);
    overflow: hidden;
}

/* 竖屏封面统一为横屏比例 16:9 */
.video-card .cover-wrap.vertical {
    padding-top: 56.25%;
}

.video-card .cover-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.video-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.video-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-card .play-icon::after {
    content: '▶';
    color: #fff;
    font-size: 22px;
    margin-left: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.video-card .title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    line-height: 1.4;
}

.video-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    gap: 8px;
}

.video-card .badge {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

/* ===== 排行榜侧栏（美化版） ===== */
.rank-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.rank-list {
    list-style: none;
}

/* 排行榜精简模式 - 只显示标题文字 */
.rank-list {
    list-style: none;
}

.rank-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.rank-list li:last-child {
    border-bottom: none;
}

.rank-list li:hover {
    padding-left: 8px;
}

.rank-list .rank-num {
    display: none;
}

.rank-list .rank-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    transition: color 0.2s ease;
    display: block;
}

.rank-list .rank-title:hover {
    color: var(--primary);
}

.rank-list .rank-views {
    display: none;
}

/* ===== 播放页侧栏相关推荐（PC端完整样式） ===== */
.play-page .sidebar .rank-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.25s ease;
}

.play-page .sidebar .rank-list li:last-child {
    border-bottom: none;
}

.play-page .sidebar .rank-list li:hover {
    padding-left: 0;
}

/* 封面缩略图 - 固定尺寸，不再过大 */
.play-page .sidebar .rank-list .rank-thumb {
    width: 120px;
    height: 68px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8ecf1, #d5dce5);
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.play-page .sidebar .rank-list li:hover .rank-thumb {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transform: scale(1.03);
}

.play-page .sidebar .rank-list .rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 缩略图上的播放小图标 */
.play-page .sidebar .rank-list .rank-thumb .rank-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.play-page .sidebar .rank-list li:hover .rank-thumb .rank-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-page .sidebar .rank-list .rank-thumb .rank-play-icon::after {
    content: '▶';
    color: #fff;
    font-size: 10px;
    margin-left: 2px;
}

/* 信息区域 */
.play-page .sidebar .rank-list .rank-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

/* 标题 */
.play-page .sidebar .rank-list .rank-title {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    color: var(--text);
    line-height: 1.5;
    transition: color 0.2s ease;
}

.play-page .sidebar .rank-list .rank-title:hover {
    color: var(--primary);
}

/* 元数据（播放量 + 分类标签） */
.play-page .sidebar .rank-list .rank-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.play-page .sidebar .rank-list .rank-meta .badge {
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

/* 播放页侧栏整体优化 */
.play-page .sidebar .rank-section {
    margin-bottom: 20px;
    padding: 18px;
}

.play-page .sidebar .section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

/* ===== 播放页 ===== */
.play-page {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.play-page > .player-wrap,
.play-page > .video-info,
.play-page > .comment-section {
    flex: 1;
    min-width: 0;
}

.play-page .sidebar {
    width: 360px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .play-page {
        flex-direction: column;
    }
    .play-page .sidebar {
        width: 100%;
    }
}

.player-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 100%;
    min-height: 400px;
}

.player-wrap.horizontal {
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

.player-wrap.vertical {
    aspect-ratio: 9 / 16;
    max-height: 80vh;
    min-height: 500px;
    margin: 0 auto;
}

.player-wrap .artplayer-app {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.video-info {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    border: 1px solid var(--border);
}

.video-info h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.video-info .meta-row {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.video-info .desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.action-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-btns button {
    padding: 11px 26px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.action-btns button:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-btns button.liked {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* ===== 评论区（美化版） ===== */
.comment-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* ===== 互动/排行榜切换区（美化版） ===== */
.interaction-section {
    background: var(--bg-card);
    border-radius: 16px;
    margin-top: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.interaction-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 100%);
}

.interaction-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    user-select: none;
}

.interaction-tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.interaction-tabs .tab:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.comment-form input,
.comment-form textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary);
}

.comment-form input { width: 100px; }
.comment-form textarea { flex: 1; resize: vertical; min-height: 40px; }

.comment-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.comment-form button:hover { opacity: 0.85; }

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child { border-bottom: none; }

.comment-item .comment-user {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.comment-item .comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.comment-item .comment-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ===== 侧栏 ===== */
.sidebar .section-title {
    font-size: 16px;
}

/* ===== 分页（美化版） ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.pagination a, .pagination span {
    padding: 9px 16px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pagination .active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== 加载状态（美化版） ===== */
.loading {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 底部（美化版） ===== */
.footer {
    text-align: center;
    padding: 36px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}

.footer p {
    opacity: 0.85;
}

/* ===== 封面占位符（美化版） ===== */
.cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
    color: rgba(255,255,255,0.9);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== 微信端全面优化 ===== */
/* 微信浏览器基础优化 */
.wechat-optimized body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    font-size: 15px;
}

.wechat-optimized .video-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.wechat-optimized .video-card:active {
    transform: scale(0.97);
    transition: transform 0.1s;
}

/* 微信端播放器全屏适配（兼容旧版微信内核） */
.wechat-optimized .player-wrap {
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    background: #000 !important;
}

/* 横屏视频 - 使用 padding-top 保持 16:9 比例（兼容所有浏览器） */
.wechat-optimized .player-wrap.horizontal {
    padding-top: 56.25% !important; /* 9/16 = 0.5625 */
    min-height: 200px !important;
    max-height: 60vh !important;
}

/* 竖屏视频 - 使用 padding-top 保持 9:16 比例 */
.wechat-optimized .player-wrap.vertical {
    padding-top: 177.78% !important; /* 16/9 = 1.7778 */
    max-height: 80vh !important;
    min-height: 300px !important;
}

.wechat-optimized .artplayer-app {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    min-height: 200px !important;
}

.wechat-optimized .artplayer-app video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000 !important;
}

/* 微信端播放器内部元素定位 */
.wechat-optimized .player-wrap.horizontal .artplayer-app {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.wechat-optimized .player-wrap.vertical .artplayer-app {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 微信端播放器控制栏优化 */
.wechat-optimized .artplayer-controller {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* 微信端播放器按钮优化 */
.wechat-optimized .artplayer-icon {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 微信端播放页强制单栏布局 */
.wechat-optimized .play-page {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

.wechat-optimized .play-page > div:first-child {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
}

/* 侧栏（弹幕+推荐）下沉到最底部，全宽显示 */
.wechat-optimized .play-page .sidebar {
    width: 100% !important;
    flex: none !important;
    order: 10 !important;
    margin-top: 0 !important;
}

/* 微信端视频信息区（增强优化） */
.wechat-optimized .video-info {
    padding: 12px 16px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid var(--border) !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
}

.wechat-optimized .video-info h2 {
    font-size: 16px !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
    word-break: break-word;
    font-weight: 600 !important;
}

.wechat-optimized .meta-row {
    flex-wrap: wrap !important;
    gap: 6px 12px !important;
    font-size: 12.5px !important;
    color: var(--text-secondary) !important;
    align-items: center !important;
}

.wechat-optimized .meta-row > span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.wechat-optimized .video-info .desc {
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    margin-top: 6px !important;
    color: var(--text-secondary) !important;
}

/* 微信端按钮组（增强优化） */
.wechat-optimized .action-btns {
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

.wechat-optimized .action-btns button {
    flex: 1 !important;
    min-width: calc(50% - 4px) !important;
    justify-content: center !important;
    padding: 10px 12px !important;
    font-size: 13.5px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
}

/* 微信端按钮点击反馈 */
.wechat-optimized .action-btns button:active {
    transform: scale(0.96) !important;
    opacity: 0.85 !important;
}

/* 微信端评论区 */
.wechat-optimized .comment-section {
    padding: 14px 16px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid var(--border) !important;
}

/* 微信端互动/排行榜切换区（增强优化） */
.wechat-optimized .interaction-section {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
}

.wechat-optimized .interaction-tabs {
    background: var(--bg-card) !important;
    display: flex !important;
    border-bottom: 1px solid var(--border) !important;
}

.wechat-optimized .interaction-tabs .tab {
    flex: 1 !important;
    text-align: center !important;
    padding: 14px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -1px !important;
    transition: all 0.2s ease !important;
}

.wechat-optimized .interaction-tabs .tab.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
}

.wechat-optimized .interaction-tabs .tab:active {
    background: var(--bg-hover) !important;
}

.wechat-optimized .tab-content {
    padding: 12px 16px !important;
    background: var(--bg-card) !important;
}

.wechat-optimized .tab-content.active {
    display: block !important;
}

.wechat-optimized .tab-content:not(.active) {
    display: none !important;
}

.wechat-optimized .section-title {
    font-size: 15px !important;
    margin-bottom: 12px !important;
    font-weight: 600 !important;
}

.wechat-optimized .comment-form {
    gap: 10px !important;
    flex-direction: column !important;
}

.wechat-optimized .comment-form input,
.wechat-optimized .comment-form textarea {
    font-size: 16px !important;
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 8px !important;
}

.wechat-optimized .comment-form button {
    width: 100% !important;
    padding: 12px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
}

.wechat-optimized .comment-item {
    padding: 12px 0 !important;
}

.wechat-optimized .comment-item .comment-user {
    font-size: 14px !important;
}

.wechat-optimized .comment-item .comment-content {
    font-size: 14px !important;
    line-height: 1.6 !important;
}

/* 微信端弹幕/侧栏区域（增强优化） */
.wechat-optimized .rank-section {
    margin: 0 0 1px 0 !important;
    padding: 12px 16px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 8px solid var(--bg) !important;
    background: var(--bg-card) !important;
}

.wechat-optimized .rank-section .section-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--border) !important;
}

/* 微信端弹幕输入（增强优化） */
.wechat-optimized #danmuInput {
    font-size: 14px !important;
    width: 100% !important;
    min-height: 38px !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;
    padding: 8px 12px !important;
}

.wechat-optimized #danmuColor {
    width: 38px !important;
    height: 38px !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    cursor: pointer !important;
}

/* 微信端相关推荐列表（增强优化） */
.wechat-optimized .rank-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.wechat-optimized .rank-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 10px !important;
    border-radius: 8px !important;
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    transition: all 0.2s ease !important;
}

.wechat-optimized .rank-list li:active {
    background: var(--bg-hover) !important;
    transform: scale(0.98) !important;
}

.wechat-optimized .rank-list .rank-num {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
}

.wechat-optimized .rank-list .rank-thumb {
    width: 100px !important;
    height: 56px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #e8ecf1, #d5dce5) !important;
    position: relative !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
}

.wechat-optimized .rank-list .rank-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.wechat-optimized .rank-list .rank-thumb .rank-play-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 24px !important;
    height: 24px !important;
    background: rgba(0,0,0,0.55) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.wechat-optimized .rank-list li:active .rank-thumb .rank-play-icon {
    opacity: 1 !important;
}

.wechat-optimized .rank-list .rank-thumb .rank-play-icon::after {
    content: '▶' !important;
    color: #fff !important;
    font-size: 10px !important;
    margin-left: 2px !important;
}

.wechat-optimized .rank-list .rank-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    justify-content: center !important;
}

.wechat-optimized .rank-list .rank-title {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    color: var(--text) !important;
    line-height: 1.4 !important;
}

.wechat-optimized .rank-list .rank-title:active {
    color: var(--primary) !important;
}

.wechat-optimized .rank-list .rank-meta {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11.5px !important;
    color: var(--text-secondary) !important;
    flex-wrap: wrap !important;
}

.wechat-optimized .rank-list .rank-meta .badge {
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 10.5px !important;
    font-weight: 500 !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2) !important;
}

.wechat-optimized .rank-list .rank-views {
    font-size: 11.5px !important;
    color: var(--text-secondary) !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

/* 微信端首页优化 */
.wechat-optimized .container {
    padding: 0 !important;
}

.wechat-optimized .category-tabs {
    padding: 12px 16px !important;
    margin-bottom: 0 !important;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.wechat-optimized .category-tabs .tab {
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-radius: 16px !important;
}

.wechat-optimized .section-title {
    padding: 14px 16px 8px !important;
    font-size: 17px !important;
}

.wechat-optimized .video-grid {
    padding: 0 12px !important;
    gap: 10px !important;
}

.wechat-optimized .video-card {
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 150px !important;
    border-radius: 8px !important;
    border: none !important;
}

/* 微信端禁用大封面效果，保持统一布局 */
.wechat-optimized .video-card.featured {
    flex: 1 1 calc(50% - 10px) !important;
    margin-bottom: 0 !important;
}

.wechat-optimized .video-card .info {
    padding: 8px 10px !important;
}

.wechat-optimized .video-card .title {
    font-size: 13px !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wechat-optimized .video-card .meta {
    font-size: 11px !important;
}

/* 微信端隐藏排行榜 */
.wechat-optimized .home-sidebar {
    display: none !important;
}

/* 微信端分页 */
.wechat-optimized .pagination {
    padding: 16px 0 !important;
}

.wechat-optimized .pagination a,
.wechat-optimized .pagination span {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

/* 微信端底部 */
.wechat-optimized .footer {
    padding: 20px 16px !important;
    font-size: 12px !important;
    border: none !important;
    background: transparent !important;
}

/* 微信端顶部导航栏全面优化 */
.wechat-optimized .header {
    padding: 0 12px !important;
    height: 52px !important;
    gap: 8px !important;
}

.wechat-optimized .header .logo {
    font-size: 17px !important;
    flex-shrink: 0 !important;
}

.wechat-optimized .header .search-bar {
    flex: 1 !important;
    max-width: none !important;
    margin: 0 8px !important;
    min-width: 0 !important;
}

.wechat-optimized .header .search-bar input {
    font-size: 14px !important;
    padding: 8px 36px 8px 12px !important;
    height: 34px !important;
}

.wechat-optimized .header .search-bar button {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
}

.wechat-optimized .header .nav-links {
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.wechat-optimized .header .nav-links a {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

/* 微信端播放页隐藏顶部导航（可选，让播放器更突出） */
.wechat-optimized .play-page .header {
    /* 如果需要在播放页隐藏 header，取消下面注释 */
    /* display: none !important; */
}

/* 微信端加载状态 */
.wechat-optimized .loading {
    padding: 30px 20px !important;
    font-size: 14px !important;
}

/* ===== 响应式优化（增强版） ===== */

/* 中等屏幕（1200px - 1400px） */
@media (max-width: 1400px) and (min-width: 1201px) {
    .video-card {
        flex: 1 1 calc(25% - 20px);
        min-width: 200px;
    }
}

/* 平板设备（900px - 1200px） */
@media (max-width: 1200px) {
    .home-sidebar {
        width: 280px;
    }
    
    .video-card {
        flex: 1 1 calc(33.333% - 20px);
        min-width: 180px;
    }
}

/* 平板设备 */
@media (max-width: 900px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 0 20px;
        height: 56px;
    }
    
    .header .logo {
        font-size: 20px;
    }
    
    .header .search-bar {
        margin: 0 20px;
        max-width: 400px;
    }
    
    /* 首页单栏布局 */
    .home-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .home-sidebar {
        width: 100%;
        order: 1;
    }
    
    /* 幻灯片响应式（平板） */
    .slide-container {
        border-radius: 12px;
        margin: 0 auto 20px auto;
    }
    
    .slide-wrapper {
        height: 0;
        padding-top: 40%; /* 2.5:1 宽高比 */
        position: relative;
    }
    
    .slide-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        background: rgba(255,255,255,0.85);
    }
    
    .slide-dots {
        bottom: 12px;
        gap: 8px;
    }
    
    .slide-dot {
        width: 8px;
        height: 8px;
    }
    
    .video-card {
        flex: 1 1 calc(33.333% - 16px);
        min-width: 160px;
    }
    
    /* 播放页单栏布局 */
    .play-page {
        flex-direction: column;
        gap: 0;
    }
    
    .play-page > div:first-child {
        width: 100%;
        flex: none;
    }
    
    .play-page .sidebar {
        width: 100%;
        flex: none;
        order: 10;
        margin-top: 20px;
    }
    
    .rank-section {
        padding: 16px;
    }
}

/* 手机设备 */
@media (max-width: 600px) {
    /* ========== 顶部导航 ========== */
    .header { 
        padding: 0 10px; 
        height: 52px;
        gap: 6px;
    }
    .header .logo { 
        font-size: 15px; 
        gap: 4px;
        white-space: nowrap;
    }
    .header .search-bar { 
        margin: 0; 
        max-width: none;
        flex: 1;
    }
    .header .search-bar input {
        padding: 7px 34px 7px 12px;
        font-size: 13px;
        border-radius: 16px;
        background: rgba(255,255,255,0.85);
    }
    .header .search-bar input:focus {
        background: #fff;
    }
    .header .search-bar button {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .header .nav-links {
        gap: 4px;
        margin-left: 4px;
    }
    .header .nav-links a {
        padding: 5px 8px;
        font-size: 14px;
        border-radius: 8px;
        background: rgba(255,255,255,0.12);
    }
    
    /* ========== 主内容区 ========== */
    .container { 
        padding: 0; 
    }
    
    /* 幻灯片手机响应式 */
    .slide-container {
        border-radius: 0;
        margin: 0 auto 16px auto;
        box-shadow: none;
    }
    
    .slide-wrapper {
        height: 0;
        padding-top: 50%; /* 2:1 宽高比，更适合手机横幅广告 */
        position: relative;
    }
    
    .slide-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        background: rgba(255,255,255,0.8);
    }
    
    .slide-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    .slide-dot {
        width: 6px;
        height: 6px;
        border-width: 1px;
    }
    
    /* ========== 视频卡片高度统一（移动端竖屏视频与横屏保持一致） ========== */
    .video-card .cover-wrap.vertical {
        padding-top: 56.25% !important;
    }
    
    /* ========== 分类标签 ========== */
    .category-tabs {
        padding: 10px 12px;
        margin-bottom: 0;
        gap: 6px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .category-tabs .tab {
        padding: 6px 14px;
        font-size: 13px;
        border-radius: 16px;
        background: var(--bg);
        border: 1px solid transparent;
    }
    .category-tabs .tab.active {
        background: var(--primary);
        color: #fff;
    }
    
    /* ========== 首页布局 ========== */
    .home-layout {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .home-sidebar {
        width: 100%;
        order: 1;
        display: none;
    }
    
    /* ========== 排行榜 ========== */
    .rank-section {
        padding: 14px 16px;
        margin: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        background: var(--bg-card);
    }
    
    .rank-section .section-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .rank-tabs {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .rank-tabs .tab {
        padding: 5px 12px;
        font-size: 12px;
        border-radius: 14px;
    }
    
    /* ========== 排行榜卡片化 ========== */
    .rank-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .rank-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px;
        border-radius: 8px;
        background: var(--bg);
        border: 1px solid var(--border);
        transition: all 0.2s;
        font-size: 13px;
    }
    
    .rank-list li:active {
        background: var(--bg-hover);
    }
    
    .rank-list .rank-num {
        width: 22px;
        height: 22px;
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .rank-list .rank-thumb {
        width: 64px;
        height: 40px;
        border-radius: 4px;
        overflow: hidden;
        flex-shrink: 0;
        background: #e0e0e0;
        position: relative;
    }
    
    .rank-list .rank-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .rank-list .rank-thumb .rank-play-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        background: rgba(0,0,0,0.5);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .rank-list .rank-thumb .rank-play-icon::after {
        content: '▶';
        color: #fff;
        font-size: 9px;
        margin-left: 1px;
    }
    
    .rank-list .rank-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .rank-list .rank-title {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text);
    }
    
    .rank-list .rank-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 11px;
        color: var(--text-secondary);
    }
    
    .rank-list .rank-meta .badge {
        padding: 1px 6px;
        border-radius: 4px;
        font-size: 10px;
        background: var(--primary);
        color: #fff;
    }
    
    .rank-list .rank-views {
        font-size: 11px;
        color: var(--text-secondary);
        flex-shrink: 0;
    }
    
    /* ========== 标题 ========== */
    .section-title {
        padding: 16px 16px 10px;
        font-size: 17px;
        margin-bottom: 0;
    }
    
    /* ========== 视频网格 ========== */
    .video-grid { 
        padding: 0 6px;
        gap: 6px; 
        margin-bottom: 0;
    }
    
    .video-card {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
        border-radius: 8px;
        overflow: hidden;
        border: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    /* 移动端禁用大封面效果，保持统一布局 */
    .video-card.featured {
        flex: 1 1 calc(50% - 6px) !important;
        margin-bottom: 0 !important;
    }
    
    .video-card:active {
        transform: scale(0.97);
        box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    }
    
    .video-card .cover-wrap {
        border-radius: 8px 8px 0 0;
    }
    
    .video-card .cover-wrap img {
        border-radius: 8px 8px 0 0;
    }
    
    .video-card .info {
        padding: 6px 8px;
    }
    .video-card .title {
        font-size: 13px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 3px;
    }
    .video-card .meta {
        font-size: 11px;
        gap: 3px;
    }
    .video-card .badge {
        font-size: 10px;
        padding: 1px 5px;
    }
    .video-card .play-icon {
        width: 32px;
        height: 32px;
    }
    .video-card .play-icon::after {
        font-size: 13px;
    }
    
    /* ========== 分页 ========== */
    .pagination { 
        padding: 16px 0 20px;
        gap: 6px;
    }
    .pagination a, .pagination span {
        padding: 7px 11px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    /* ========== 底部 ========== */
    .footer {
        padding: 20px 16px;
        font-size: 12px;
        color: var(--text-secondary);
        border-top: 1px solid var(--border);
        background: var(--bg-card);
    }
}

/* 小屏手机（375px以下） */
@media (max-width: 375px) {
    .header .logo {
        font-size: 14px;
    }
    .header .nav-links a {
        padding: 4px 6px;
        font-size: 13px;
    }
    .video-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
    }
    .video-grid {
        gap: 8px;
        padding: 0 8px;
    }
    .video-card .title {
        font-size: 12px;
    }
    .video-card .info {
        padding: 6px 8px;
    }
    .category-tabs {
        padding: 8px 10px;
    }
    .category-tabs .tab {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* 横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        position: relative;
    }
    .container {
        padding-top: 12px;
    }
}

/* 高DPI屏幕 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .video-card .cover-wrap img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* 深色模式（增强版） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f1a;
        --bg-card: #1a1a2e;
        --bg-hover: #252542;
        --text: #e8e8e8;
        --text-secondary: #9ca3af;
        --border: #2d2d4a;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
        --shadow: 0 2px 8px rgba(0,0,0,0.4);
        --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
        --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
        --shadow-xl: 0 12px 48px rgba(0,0,0,0.7);
    }
    
    .header {
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }
    
    .video-card {
        box-shadow: var(--shadow-sm);
    }
    
    .video-card:hover {
        box-shadow: var(--shadow-xl);
    }
    
    .rank-section,
    .comment-section,
    .interaction-section {
        box-shadow: var(--shadow);
    }
    
    .category-tabs {
        background: var(--bg-card);
    }
}

/* ===== 聊天室样式 ===== */
.chatroom-container {
    display: flex;
    flex-direction: column;
    height: 420px;
    background: transparent;
    border-radius: 0;
    border: none;
    overflow: hidden;
}

.chatroom-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.chatroom-header .online-count {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 12px;
}

.chatroom-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.chatroom-messages::-webkit-scrollbar {
    width: 4px;
}

.chatroom-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chat-msg {
    display: flex;
    gap: 8px;
    animation: chatMsgIn 0.3s ease;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
    object-fit: cover;
}

.chat-msg-body {
    flex: 1;
    min-width: 0;
}

.chat-msg-name {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-msg-text {
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    padding: 8px 12px;
    border-radius: 4px 12px 12px 12px;
    word-break: break-word;
    line-height: 1.5;
}

.chat-msg-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.chatroom-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chatroom-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.chatroom-input-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatroom-input-bar button {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chatroom-input-bar button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatroom-input-bar button:active {
    transform: translateY(0);
}

.chatroom-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 微信登录状态条 */
.wechat-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.wechat-status-bar .wx-icon {
    font-size: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chatroom-container {
        height: 300px;
    }
    
    .chatroom-input-bar {
        padding: 10px 12px;
    }
    
    .chatroom-input-bar button {
        padding: 10px 16px;
    }
}

/* ========== 用户分享排行样式 ========== */
.share-rank-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    min-height: 36px;
}

.share-rank-item:last-child {
    border-bottom: none;
}

.share-rank-item:hover {
    background: #f8f9ff;
}

.share-rank-badge {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-right: 6px;
    flex-shrink: 0;
}

/* 前三名徽章特殊样式 */
.share-rank-item:nth-child(1) .share-rank-badge {
    font-size: 16px;
}

.share-rank-item:nth-child(2) .share-rank-badge {
    font-size: 14px;
}

.share-rank-item:nth-child(3) .share-rank-badge {
    font-size: 13px;
}

.share-rank-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-rank-avatar .avatar-fallback {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

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

.share-rank-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.share-rank-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

.share-rank-views {
    color: #667eea;
    font-weight: 500;
}

.share-rank-count {
    color: #999;
}

/* 移动端分享排行适配 */
@media (max-width: 768px) {
    .share-rank-item {
        padding: 5px 8px;
        min-height: 32px;
    }

    .share-rank-avatar {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }

    .share-rank-badge {
        width: 20px;
        height: 20px;
        font-size: 12px;
        margin-right: 4px;
    }

    .share-rank-name {
        font-size: 12px;
    }

    .share-rank-stats {
        flex-direction: row;
        gap: 8px;
        font-size: 10px;
    }
}
