/* ==============================================
   主布局 Main Layout
============================================== */
.yt-main {
    margin-top: 56px;
    margin-left: 240px;
    padding: 24px;
    transition: margin-left 0.25s ease;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    min-height: calc(100vh - 56px);
}
.yt-main.expanded {
    margin-left: 72px;
}

/* 左侧播放区 */
.watch-primary {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ==============================================
   播放器容器与广告层
============================================== */
.player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.player-container video {
    width: 100%;
    height: 100%;
}
.plyr {
    --plyr-color-main: var(--brand-red);
    height: 100%;
}

/* 手势操作提示浮层 */
.gesture-tip-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 80;
    pointer-events: none;
    display: none;
    backdrop-filter: blur(4px);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.gesture-tip-box i {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

/* 广告遮罩层 */
.yt-ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #181818;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}
.yt-ad-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}
.yt-ad-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.6;
}
.yt-ad-content {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.yt-ad-skip-box {
    position: absolute;
    right: 24px;
    bottom: 24px;
    background: rgba(28, 28, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 60;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.yt-ad-skip-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 4px;
}
.yt-ad-skip-btn:hover {
    color: #3ea6ff;
}
.yt-ad-countdown-text {
    color: #aaa;
}

/* ==============================================
   视频信息与操作栏
============================================== */
.watch-video-title {
    font-size: 20px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.watch-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.channel-info-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.watch-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-sub);
}
.channel-text .name {
    font-weight: 600;
    font-size: 15px;
}
.channel-text .sub {
    font-size: 12px;
    color: var(--text-sub);
}
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.yt-action-btn {
    background-color: var(--chip-bg);
    border: none;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.yt-action-btn:hover {
    background-color: var(--bg-hover);
}

/* 标签栏 */
.watch-tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-bottom: 4px;
}
.tag-chip {
    background-color: var(--chip-bg);
    color: var(--text-main);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.tag-chip:hover {
    background-color: var(--brand-red);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

/* 播放源与集数列表 */
.episode-section {
    margin-top: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
}
.episode-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
}
.episode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
}
.episode-btn {
    padding: 6px 14px;
    background-color: var(--chip-bg);
    color: var(--text-main);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}
.episode-btn:hover {
    background-color: var(--bg-hover);
}
.episode-btn.active {
    background-color: var(--chip-active-bg);
    color: var(--chip-active-text);
    font-weight: 600;
}

/* 简介区域 */
.watch-desc-box {
    margin-top: 16px;
    background-color: var(--bg-card);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
}
.watch-desc-box .desc-title {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 6px;
}

/* ==============================================
   右侧相关推荐
============================================== */
.watch-secondary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.recommend-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}
.recommend-card {
    display: flex;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    align-items: flex-start;
    transition: background-color 0.2s ease;
}
.recommend-card:hover {
    background-color: var(--bg-card);
}
.recommend-thumb {
    width: 150px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
.recommend-card:hover .recommend-thumb {
    transform: scale(1.02);
}
.recommend-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}
.recommend-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    padding-top: 1px;
}
.recommend-video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.recommend-card:hover .recommend-video-title {
    color: var(--brand-red);
}
.recommend-meta {
    font-size: 12px;
    color: var(--text-sub);
    display: flex;
    gap: 6px;
}

/* ==============================================
   响应式适配
============================================== */
@media (max-width: 1024px) {
    .yt-main {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}
@media (max-width: 768px) {
    .header-center {
        display: none !important;
    }
    .mobile-search-btn {
        display: flex !important;
    }
    .yt-sidebar {
        transform: translateX(-100%);
        width: 240px !important;
    }
    .yt-sidebar.mobile-open {
        transform: translateX(0);
    }
    .yt-main {
        margin-left: 0 !important;
        padding: 6px;
    }
    #themeText {
        display: none;
    }
    .recommend-thumb {
        width: 140px;
    }
}