/* ==========================================================================
   app.css —— 业务样式
   导航 / 分类标签 / 视频网格 / 播放器 / 博主页 + 对应响应式
   通用件（变量/reset/toast/loading/empty/back-top）见 base.css
   ========================================================================== */

/* 顶部导航 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-box {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg);
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    background: white;
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.nav-stats {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* 主分类标签 */
.category-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 61px;
    z-index: 99;
}

.category-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 0;
}

.category-tab {
    padding: 14px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.category-tab:hover { color: var(--text); }

.category-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 子分类标签 */
.sub-category-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 110px;
    z-index: 98;
    display: none;
}

.sub-category-bar.show {
    display: block;
}

.sub-category-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sub-category-content::-webkit-scrollbar { display: none; }

.sub-tab {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sub-tab:hover { color: var(--text); }

.sub-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 主内容 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

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

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: var(--shadow);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 11;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

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

.thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    opacity: 0.2;
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.play-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
}

.badge-vip, .badge-tg {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.badge-vip {
    background: linear-gradient(135deg, #ffa502, #ff6b6b);
}

.badge-tg {
    background: linear-gradient(135deg, #54a0ff, #2e86de);
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

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

.video-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 36px;
}

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

/* 视频卡片上的博主名 */
.video-bloger {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-bloger:hover { text-decoration: underline; }

/* 加载更多 */
.load-more-wrap {
    text-align: center;
    padding: 30px 20px;
}

.btn-load {
    background: white;
    color: var(--text);
    padding: 10px 30px;
    border-radius: 24px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-load:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-load:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 播放器（沉浸式全屏，参考官方） */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.show { display: block; }

.modal-content {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* 视频舞台：黑色，顶部吸附 */
.player-stage {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #000;
}

.player-stage-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.player-stage-close:hover { background: rgba(0, 0, 0, 0.75); }

.video-wrap {
    background: black;
    aspect-ratio: 16 / 9;
    position: relative;
    width: 100%;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    display: block;
}

/* ArtPlayer 挂载点：撑满 16:9 播放区 */
.art-mount {
    width: 100%;
    height: 100%;
}

.art-mount .art-video-player {
    width: 100% !important;
    height: 100% !important;
}

/* 播放器加载动画 */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2;
}

.player-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3;
    text-align: center;
    padding: 20px;
}

.player-error button {
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
}

/* 视频信息区 */
.player-body { padding: 16px 20px 40px; }

.player-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.player-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.player-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    transition: all 0.2s;
}

.player-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* 原创博主条 */
.player-bloger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    cursor: pointer;
}

.player-bloger-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    flex-shrink: 0;
}

.player-bloger-info { flex: 1; min-width: 0; }
.player-bloger-name { font-size: 14px; font-weight: 600; }
.player-bloger-sub { font-size: 12px; color: var(--text-muted); }
.player-bloger-arrow { color: var(--text-muted); font-size: 18px; }

.modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.btn-action {
    padding: 9px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 简介 */
.player-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 22px;
}

/* 相关推荐 */
.player-related-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-related-title::before {
    content: "";
    width: 3px;
    height: 15px;
    background: var(--primary);
    border-radius: 2px;
}

.tg-notice {
    padding: 40px 20px;
    text-align: center;
}

.tg-notice-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.tg-notice-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 博主主页 */
.bloger-page {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bloger-page.show { display: block; }

.bloger-header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.bloger-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
}

.bloger-back {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bloger-profile {
    display: flex;
    gap: 16px;
    align-items: center;
}

.bloger-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    flex-shrink: 0;
}

.bloger-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.bloger-meta { flex: 1; min-width: 0; }

.bloger-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bloger-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.bloger-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.bloger-caption {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bloger-page .video-grid,
.bloger-page .load-more-wrap {
    max-width: 1400px;
    margin: 0 auto;
}

.bloger-page .video-grid { padding: 20px; }

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-content {
        padding: 10px 14px;
        gap: 10px;
    }

    .logo { font-size: 17px; }

    .search-box input {
        padding: 8px 14px 8px 36px;
        font-size: 13px;
    }

    .search-box::before {
        left: 12px;
        font-size: 13px;
    }

    .nav-stats { display: none; }

    .category-bar {
        top: 56px;
    }

    .sub-category-bar {
        top: 99px;
    }

    .category-content {
        padding: 0 14px;
    }

    .category-tab {
        padding: 12px 20px;
        font-size: 13px;
    }

    .sub-category-content {
        padding: 0 14px;
        gap: 4px;
    }

    .sub-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .container {
        padding: 14px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    .video-title {
        font-size: 12px;
        min-height: 32px;
    }

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

    .play-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .badge-vip, .badge-tg {
        top: 6px;
        left: 6px;
        padding: 2px 6px;
        font-size: 10px;
    }

    .duration {
        bottom: 6px;
        right: 6px;
        font-size: 10px;
    }

    .modal-content {
        max-width: 100%;
    }

    .player-body { padding: 14px; }

    .player-title { font-size: 15px; }

    .modal-actions { gap: 6px; }

    .btn-action {
        padding: 9px 10px;
        font-size: 12px;
        flex: 1;
        text-align: center;
        min-width: calc(50% - 3px);
    }

    .player-related .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .bloger-avatar,
    .bloger-avatar-fallback {
        width: 56px;
        height: 56px;
    }

    .bloger-avatar-fallback { font-size: 26px; }

    .bloger-name { font-size: 16px; }

    .bloger-page .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        gap: 8px;
    }

    .nav-content {
        gap: 8px;
    }
}
