/* ==========================================================================
   TVBox 网页播放器 - 暗色主题样式
   参考 TVBox 客户端风格
   ========================================================================== */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #1a1a2e;
    color: #eee;
    -webkit-font-smoothing: antialiased;
}

a { color: #e94560; text-decoration: none; }
a:hover { color: #ff5a7a; }

button { font-family: inherit; cursor: pointer; }

input, select {
    font-family: inherit;
    outline: none;
}

/* ===================== 顶部导航栏 ===================== */
.app-header {
    height: 56px;
    background: #16213e;
    border-bottom: 1px solid rgba(233, 69, 96, 0.2);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.app-header .logo {
    font-size: 18px;
    font-weight: 700;
    color: #e94560;
    margin-right: 24px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-header .logo .logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #0f3460, #e94560);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.app-header .nav-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-header .nav-bar .site-select,
.app-header .nav-bar .search-box {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.app-header .nav-bar .site-select { min-width: 140px; max-width: 220px; }
.app-header .nav-bar .search-box { flex: 1; min-width: 120px; max-width: 360px; }
.app-header .nav-bar .site-select:focus,
.app-header .nav-bar .search-box:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.app-header .nav-bar .search-box::placeholder { color: #555; }

.app-header .nav-bar .btn-search {
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.app-header .nav-bar .btn-search:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3); }
.app-header .nav-bar .btn-search:active { transform: translateY(0); }

.app-header .nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.app-header .nav-actions .nav-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}

.app-header .nav-actions .nav-link:hover,
.app-header .nav-actions .nav-link.active {
    color: #fff;
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.12);
}

/* ===================== 主体布局 ===================== */
.app-main {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* ===================== 左侧分类栏 ===================== */
.sidebar {
    width: 180px;
    flex-shrink: 0;
    background: #16213e;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 8px;
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
}

.sidebar .sidebar-title {
    font-size: 12px;
    color: #888;
    padding: 6px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 6px;
}

.sidebar .cat-item {
    padding: 10px 14px;
    border-radius: 6px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .cat-item:hover { background: rgba(233, 69, 96, 0.08); color: #ddd; }
.sidebar .cat-item.active {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.6), rgba(233, 69, 96, 0.3));
    color: #fff;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.15);
}

.sidebar .cat-empty {
    padding: 20px 14px;
    text-align: center;
    color: #555;
    font-size: 12px;
}

/* ===================== 主内容区 ===================== */
.content-area {
    flex: 1;
    padding: 16px;
    min-width: 0;
    overflow-y: auto;
}

.content-area .page-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 站点不可达等错误提示 */
.site-error-tip {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.4);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
    color: #ff8a9b;
    font-size: 13px;
    line-height: 1.5;
}

/* ===================== 影片卡片瀑布流 ===================== */
.movie-grid {
    /* 用 column-width 让浏览器根据容器宽度自动计算列数，自动铺满 */
    column-width: 220px;
    column-gap: 12px;
}

.movie-card {
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.04);
    break-inside: avoid;
    margin-bottom: 12px;
    display: block;
}

.movie-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(233, 69, 96, 0.3);
}

.movie-card .card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #0f3460;
    display: block;
}

.movie-card .card-no-poster {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: #555;
    font-size: 32px;
    font-weight: 700;
}

.movie-card .card-body {
    padding: 8px 10px 10px;
}

.movie-card .card-title {
    font-size: 13px;
    color: #eee;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.movie-card .card-remarks {
    font-size: 11px;
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.movie-card .card-meta {
    font-size: 11px;
    color: #777;
}

/* ===================== 加载更多（瀑布流底部） ===================== */
.load-more {
    text-align: center;
    padding: 24px 0 12px;
    color: #888;
    font-size: 13px;
}

.load-more .load-more-btn {
    background: #16213e;
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #e94560;
    padding: 8px 28px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
    cursor: pointer;
}

.load-more .load-more-btn:hover:not(:disabled) {
    background: rgba(233, 69, 96, 0.1);
    color: #ff5a7a;
}

.load-more .load-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.load-more .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(233, 69, 96, 0.2);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.load-more .no-more { color: #555; }

/* ===================== 响应式 ===================== */
/* movie-grid 使用 column-width 自动适配列数，无需断点控制 */
@media (max-width: 800px) {
    .app-header .nav-bar .site-select { min-width: 100px; max-width: 140px; }
    .app-header .nav-bar .search-box { max-width: 200px; }
}
@media (max-width: 560px) {
    .movie-grid { column-width: 140px; }
    .sidebar { width: 140px; }
    .app-header { padding: 0 12px; }
    .app-header .logo { font-size: 15px; margin-right: 12px; }
    .app-header .nav-actions .nav-link { padding: 6px 10px; font-size: 12px; }
    .content-area { padding: 10px; }
}

/* ===================== 分页 ===================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0 8px;
    flex-wrap: wrap;
}

.pagination .page-btn {
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
}

.pagination .page-btn:hover:not(:disabled) {
    border-color: #e94560;
    color: #fff;
    background: rgba(233, 69, 96, 0.08);
}

.pagination .page-btn:disabled { opacity: 0.35; cursor: default; }
.pagination .page-btn.active {
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border-color: transparent;
}

.pagination .page-info { color: #888; font-size: 13px; padding: 0 8px; }

/* ===================== 详情页（左右分栏） ===================== */
.detail-page {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
}

/* 左侧：影片信息（固定宽度，顶部对齐） */
.detail-left {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
}

/* 右侧：播放器 + 集数（自适应宽度） */
.detail-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-info {
    background: #16213e;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.detail-info .detail-poster {
    width: 180px;
    border-radius: 8px;
    display: block;
    object-fit: cover;
    background: #0f3460;
}

.detail-info .detail-poster-wrap {
    display: inline-grid;
    grid-template-areas: "stack";
    align-self: center;
}

.detail-info .detail-poster-wrap > * {
    grid-area: stack;
}

.detail-info > .back-btn {
    position: absolute;
    top: 0px;
    left: 0px;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 2;
}

.detail-info > .back-btn:hover {
    background: rgba(233, 69, 96, 0.8);
}

.detail-info .detail-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-info .detail-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.detail-info .detail-row {
    font-size: 13px;
    color: #bbb;
    line-height: 1.7;
}

.detail-info .detail-row .label { color: #666; margin-right: 6px; }
.detail-info .detail-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.8;
    margin-top: 6px;
    max-height: 120px;
    overflow-y: auto;
}

/* ===================== 播放器区 ===================== */
.player-section {
    background: #16213e;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.player-wrapper {
    position: relative;
    background: #000;
}

.player-wrapper video {
    width: 100%;
    display: block;
    background: #000;
}

.player-wrapper .detail-artplayer-container {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-wrapper .detail-artplayer-container .artplayer-app {
    background: #000;
}

/* 网页全屏：整个 player-section 覆盖视口（含播放器栏） */
.player-section.browser-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    height: 100% !important;
}

.player-section.browser-fullscreen .player-wrapper {
    flex: 1;
    min-height: 0;
}

.player-section.browser-fullscreen .player-wrapper video {
    max-height: none;
    height: 100%;
    width: 100%;
}

.player-section.browser-fullscreen .player-wrapper .detail-artplayer-container {
    max-height: none;
    height: 100%;
    width: 100%;
}

.player-section.browser-fullscreen .player-bar {
    flex-shrink: 0;
}

/* ===================== iframe 降级播放 ===================== */
.iframe-fallback {
    display: flex;
    flex-direction: column;
}

.iframe-fallback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: #aaa;
    font-size: 13px;
    background: #0f3460;
}

.iframe-fallback-header .close-tip {
    background: transparent;
    border: none;
    color: #888;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.iframe-fallback-header .close-tip:hover {
    color: #fff;
    background: rgba(233, 69, 96, 0.7);
}

.iframe-fallback-player {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
    background: #000;
}

/* ===================== 解析页报错按钮 + 拖到收藏 ===================== */
.parse-page-player {
    position: relative;
}

.parse-report-area {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.parse-bookmark-link {
    background: rgba(0, 0, 0, 0.5);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: grab;
    transition: background 0.2s, color 0.2s;
    line-height: 1.8;
    text-decoration: none;
    white-space: nowrap;
}

.parse-bookmark-link:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #ffe44d;
    border-color: rgba(255, 215, 0, 0.5);
}

.parse-report-btn {
    background: rgba(0, 0, 0, 0.5);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1.8;
}

.parse-report-btn:hover,
.parse-report-btn.active {
    background: rgba(233, 69, 96, 0.6);
    color: #fff;
    border-color: rgba(233, 69, 96, 0.4);
}

.parse-report-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #1e2a4a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    min-width: 100px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.parse-report-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.parse-report-menu-item:hover {
    background: rgba(233, 69, 96, 0.15);
    color: #fff;
}

.player-bar {
    height: 52px;
    padding: 0 16px;
    background: #0f3460;
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-bar .player-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-bar .player-title .main-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-bar .player-title .sub-title {
    color: #aaa;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-bar .player-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.player-bar .player-actions .icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}

.player-bar .player-actions .icon-btn:hover { color: #fff; border-color: #e94560; background: rgba(233, 69, 96, 0.15); }
.player-bar .player-actions .icon-btn:disabled { opacity: 0.4; cursor: default; }

.player-bar .player-actions .text-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.15s;
    white-space: nowrap;
}

.player-bar .player-actions .text-btn:hover:not(:disabled) { color: #fff; border-color: #e94560; background: rgba(233, 69, 96, 0.15); }
.player-bar .player-actions .text-btn:disabled { opacity: 0.4; cursor: default; }

.player-fail-tip {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #ff7a90;
    padding: 8px 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-fail-tip > span { flex: 1; }

.player-fail-tip .open-tab {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.player-fail-tip .open-tab:hover { background: #ff5a7a; }

.player-fail-tip .close-tip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.player-fail-tip .close-tip:hover {
    color: #fff;
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
}

/* ===================== 线路 + 剧集 ===================== */
.episodes-section {
    background: #16213e;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 16px 20px;
}

.line-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.line-tabs .line-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #aaa;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
}

.line-tabs .line-tab:hover { color: #ddd; border-color: rgba(233, 69, 96, 0.3); }
.line-tabs .line-tab.active {
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border-color: transparent;
}

.line-tabs .no-line {
    color: #666;
    font-size: 13px;
    padding: 6px 0;
}

.episode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

.episode-list .ep-item {
    background: rgba(15, 52, 96, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #bbb;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.15s;
    min-width: 60px;
    text-align: center;
}

.episode-list .ep-item:hover { color: #fff; border-color: #e94560; background: rgba(233, 69, 96, 0.15); }
.episode-list .ep-item.active {
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.25);
}

.episode-list .empty { color: #666; font-size: 13px; padding: 12px 0; }

/* ===================== 搜索页 ===================== */
.search-page .search-header {
    background: #16213e;
    border-radius: 10px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-page .search-header input {
    flex: 1;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.search-page .search-header input:focus { border-color: #e94560; box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1); }

.search-page .search-header .btn-search {
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.15s, box-shadow 0.15s;
}

.search-page .search-header .btn-search:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3); }

.search-page .search-header .search-stats {
    color: #888;
    font-size: 13px;
    align-self: center;
    white-space: nowrap;
}

/* 搜索结果：左侧站点列表 + 右侧结果网格 */
.search-page .search-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.search-page .search-sidebar {
    flex: 0 0 180px;
    width: 180px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px;
    box-sizing: border-box;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.search-page .search-sidebar-title {
    font-size: 12px;
    color: #888;
    padding: 6px 10px;
    letter-spacing: 1px;
}
.search-page .search-site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.search-page .search-site-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.search-page .search-site-item.active {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
}
.search-page .search-site-item .site-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-page .search-site-item .site-count {
    flex: 0 0 auto;
    min-width: 22px;
    text-align: center;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1px 7px;
    color: #aaa;
}
.search-page .search-site-item.active .site-count {
    background: rgba(233, 69, 96, 0.25);
    color: #ff9db0;
}
.search-page .search-grid {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 768px) {
    .search-page .search-body { flex-direction: column; }
    .search-page .search-sidebar {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .search-page .search-sidebar-title { width: 100%; }
    .search-page .search-site-item { flex: 0 0 auto; }
}

/* ===================== 解析页 ===================== */
.parse-page {
    max-width: 100%;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.parse-page-box {
    flex-shrink: 0;
    background: #16213e;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.parse-page-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.parse-page-label-inline {
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
    flex-shrink: 0;
}

.parse-page-select-inline {
    width: 130px;
    flex-shrink: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.parse-page-select-inline:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.parse-page-select-inline option { background: #16213e; color: #eee; }

.parse-page-input-inline {
    flex: 1;
    min-width: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.parse-page-input-inline:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.btn-play-inline {
    flex-shrink: 0;
    background: linear-gradient(135deg, #0f3460, #e94560);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-play-inline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-play-inline:not(:disabled):hover {
    opacity: 0.85;
}

.btn-open-inline {
    flex-shrink: 0;
    background: transparent;
    color: #5fb878;
    border: 1px solid #5fb878;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-open-inline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-open-inline:not(:disabled):hover {
    background: rgba(95, 184, 120, 0.1);
}

/* iframe 播放器 - 自动填充剩余高度 */
.parse-page-player {
    position: relative;
    flex: 1;
    min-height: 200px;
    background: #16213e;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.parse-page-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.parse-page-player-placeholder {
    color: #555;
    font-size: 14px;
}

/* ===================== 直播页 ===================== */
.live-page {
    display: grid;
    grid-template-columns: 200px 280px 1fr;
    gap: 12px;
    height: calc(100vh - 56px - 32px);
    min-height: 480px;
}

.live-page .live-source-panel,
.live-page .live-channel-panel {
    background: #16213e;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-page .panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
}

.live-page .panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.live-page .source-item {
    padding: 10px 14px;
    border-radius: 6px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-page .source-item:hover { background: rgba(233, 69, 96, 0.08); color: #ddd; }
.live-page .source-item.active {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.6), rgba(233, 69, 96, 0.3));
    color: #fff;
}

.live-page .channel-item {
    padding: 10px 14px;
    border-radius: 6px;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-page .channel-item:hover { background: rgba(233, 69, 96, 0.08); color: #ddd; }
.live-page .channel-item.active {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.6), rgba(233, 69, 96, 0.3));
    color: #fff;
}

.live-page .channel-item .ch-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    background: #0f3460;
    flex-shrink: 0;
}

.live-page .channel-item .ch-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-page .live-player-panel {
    background: #16213e;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-page .live-player-panel .player-wrapper video { max-height: none; flex: 1; }

.live-page .live-player-panel .live-artplayer-container {
    flex: 1;
    min-height: 300px;
    background: #000;
}

.live-page .live-player-panel .live-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 14px;
    background: #000;
}

.live-page .live-player-panel .live-channel-info {
    padding: 10px 16px;
    background: #0f3460;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.live-page .live-search-box {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.live-page .live-search-box input {
    width: 100%;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #eee;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.live-page .live-search-box input:focus { border-color: #e94560; }

/* ===================== 加载/空状态 ===================== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 14px;
}

.loading-state .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(233, 69, 96, 0.2);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .text { font-size: 14px; }

/* ===================== 滚动条美化 ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #e94560; }

/* ===================== 响应式（详情页/直播页/移动端） ===================== */
@media (max-width: 1200px) {
    .live-page { grid-template-columns: 180px 240px 1fr; }
}

@media (max-width: 900px) {
    .sidebar { width: 140px; }
    .detail-page { flex-direction: column; }
    .detail-left { width: 100%; position: static; }
    .detail-info .detail-poster { width: 140px; }
    .live-page { grid-template-columns: 160px 220px 1fr; }
}

@media (max-width: 700px) {
    .app-header { padding: 0 12px; flex-wrap: wrap; height: auto; }
    .app-header .logo { font-size: 16px; margin-right: 12px; }
    .app-header .nav-bar { width: 100%; margin-top: 8px; padding-bottom: 8px; }
    .app-header .nav-bar .site-select { min-width: 100px; max-width: 140px; }
    .app-header .nav-actions { margin-left: 0; }
    .app-main { flex-direction: column; }
    .sidebar {
        width: 100%;
        max-height: none;
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        overflow-x: auto;
        padding: 8px;
    }
    .sidebar .sidebar-title { display: none; }
    .sidebar .cat-item { white-space: nowrap; margin-right: 4px; margin-bottom: 0; }
    .content-area { padding: 12px; }
    .detail-info { padding: 16px; }
    .detail-info .detail-poster { width: 120px; height: 180px; }
    .live-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        height: auto;
    }
    .live-page .live-source-panel,
    .live-page .live-channel-panel { max-height: 200px; }
    .player-wrapper video { max-height: 240px; }
}

@media (max-width: 480px) {
    .episode-list .ep-item { padding: 6px 10px; font-size: 11px; }
}
