/* =========================================================
   前台「在线观看」播放器
   ========================================================= */
.watch-online {
    --watch-accent: #667eea;
    --watch-accent-2: #764ba2;
    background: #fff;
    border: 1px solid #e8eaf2;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 34px -22px rgba(16, 24, 40, .35);
    padding: 18px;
    margin: 0 0 2rem;
    scroll-margin-top: 90px;
}

.watch-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.watch-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.01em;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.watch-title i { color: var(--watch-accent); }

.watch-meta {
    margin-left: auto;
    font-size: .78rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}

/* ---------------------------------------------------- episode selector */
.watch-episodes {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #eceef5;
    scrollbar-width: thin;
}

.watch-ep {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fbfcff;
    color: #374151;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all .15s ease;
}

.watch-ep:hover { border-color: #c7cdf7; background: #f2f4ff; color: #4338ca; }

.watch-ep.is-active {
    background: linear-gradient(135deg, var(--watch-accent), var(--watch-accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(102, 126, 234, .95);
}

.watch-ep .ep-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #22c55e;
}
.watch-ep.is-active .ep-dot { background: rgba(255, 255, 255, .9); }

/* ------------------------------------------------------- source chips */
.watch-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.watch-source {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 11px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}

.watch-source:hover { border-color: #c7cdf7; background: #f8f9ff; transform: translateY(-1px); }

.watch-source.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--watch-accent), var(--watch-accent-2));
    box-shadow: 0 10px 22px -16px rgba(102, 126, 234, 1);
}

.watch-source .src-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--src-accent, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}
.watch-source.is-active .src-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .28); }

.watch-source small {
    font-weight: 500;
    opacity: .8;
    font-size: .72rem;
}

.watch-empty {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #d9dee9;
    color: #6b7280;
    font-size: .85rem;
}

/* ------------------------------------------------------------ stage */
.watch-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b1020;
    border-radius: 14px;
    overflow: hidden;
    isolation: isolate;
}

.watch-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.watch-poster {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    background-color: #0b1020;
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
    isolation: isolate;
}

.watch-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 50% 40%, rgba(11, 16, 32, .18) 0%, rgba(11, 16, 32, .78) 100%);
    z-index: -1;
}

.watch-poster-inner {
    text-align: center;
    color: #fff;
    padding: 18px;
}

.watch-play-orb {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(135deg, rgba(102, 126, 234, .96), rgba(118, 75, 162, .96));
    box-shadow: 0 20px 44px -18px rgba(102, 126, 234, 1), inset 0 0 0 1px rgba(255, 255, 255, .28);
    transition: transform .18s ease, box-shadow .18s ease;
}

.watch-poster:hover .watch-play-orb { transform: scale(1.06); }

.watch-poster-label {
    font-size: .95rem;
    font-weight: 650;
    letter-spacing: .01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.watch-poster-sub {
    font-size: .76rem;
    opacity: .82;
    margin-top: 5px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.watch-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #0b1020;
    color: #cbd5f5;
    font-size: .85rem;
    z-index: 3;
}

.watch-spinner {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: #a5b4fc;
    animation: watch-spin .8s linear infinite;
    margin: 0 auto 12px;
}

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

/* ------------------------------------------------------------- foot */
.watch-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: .78rem;
    color: #6b7280;
}

.watch-foot .watch-foot-links { margin-left: auto; display: flex; gap: 10px; }
.watch-foot a { color: #5b5bd6; text-decoration: none; font-weight: 600; }
.watch-foot a:hover { text-decoration: underline; }

.watch-note {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ------------------------------------------------------- responsive */
@media (max-width: 576px) {
    .watch-online { padding: 13px; border-radius: 13px; }
    .watch-title { font-size: 1rem; }
    .watch-play-orb { width: 58px; height: 58px; font-size: 24px; }
    .watch-source, .watch-ep { font-size: .76rem; }
}

/* =========================================================
   播放器外壳 + 自建全屏（不依赖第三方播放器控制条）
   ========================================================= */
.watch-stage-wrap {
    position: relative;
}

.watch-fs {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 7;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(11, 16, 32, .58);
    box-shadow: 0 8px 20px -12px rgba(2, 6, 23, .9), inset 0 0 0 1px rgba(255, 255, 255, .18);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}
.watch-fs:hover { background: rgba(102, 126, 234, .92); transform: scale(1.06); }
.watch-fs:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.watch-fs i { font-size: 16px; line-height: 1; }

/* 全屏：整个卡片进入全屏，播放源/选集仍可切换 */
.watch-online:fullscreen,
.watch-online:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: #0b1020;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    box-shadow: none;
}
.watch-online:fullscreen .watch-title,
.watch-online:-webkit-full-screen .watch-title { color: #f8fafc; }
.watch-online:fullscreen .watch-meta,
.watch-online:-webkit-full-screen .watch-meta { color: #cbd5e1; }
.watch-online:fullscreen .watch-chip,
.watch-online:-webkit-full-screen .watch-chip {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .16);
    color: #e2e8f0;
}
.watch-online:fullscreen .watch-stage-wrap,
.watch-online:-webkit-full-screen .watch-stage-wrap {
    flex: 1 1 auto;
    min-height: 0;
}
.watch-online:fullscreen .watch-stage,
.watch-online:-webkit-full-screen .watch-stage {
    aspect-ratio: auto;
    height: 100%;
    border-radius: 10px;
}
.watch-online:fullscreen .watch-foot,
.watch-online:-webkit-full-screen .watch-foot { color: #94a3b8; }
.watch-online:fullscreen .watch-foot a,
.watch-online:-webkit-full-screen .watch-foot a { color: #a5b4fc; }
.watch-online:fullscreen .watch-ep,
.watch-online:-webkit-full-screen .watch-ep {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
    color: #e2e8f0;
}
.watch-online:fullscreen .watch-source,
.watch-online:-webkit-full-screen .watch-source {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
    color: #e2e8f0;
}

/* 播放器底部提示（替代第三方按钮不可用的情况） */
.watch-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 3px 10px;
}
.watch-tip b { color: #4f46e5; }
.watch-online:fullscreen .watch-tip,
.watch-online:-webkit-full-screen .watch-tip {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
    color: #cbd5e1;
}
.watch-online:fullscreen .watch-tip b,
.watch-online:-webkit-full-screen .watch-tip b { color: #a5b4fc; }
