/* 直播页布局（颜色由 white.css / black.css 随主题切换） */

.live-page .live-wrap {
    padding: 12px 0 28px;
}

.live-sources {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
}

.live-sources-label {
    font-size: 12px;
    margin-right: 4px;
}

.live-source-item {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-main {
    display: flex;
    gap: 14px;
    align-items: stretch;
    min-height: 560px;
}

.live-player-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-player-box {
    position: relative;
    width: 100%;
    background: #0b0d12;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.live-player {
    width: 100%;
    height: 100%;
}

.live-player .live-video-el {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.live-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 14, 0.78);
    color: #fff;
    z-index: 5;
}

.live-mask.hide {
    display: none;
}

.live-mask-inner {
    text-align: center;
    padding: 20px;
}

.live-mask-inner p {
    margin: 0 0 16px;
    font-size: 16px;
}

.live-mask-idle .live-mask-hint {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.02em;
}

.live-mask-idle .live-mask-hint .iconfont {
    margin-right: 6px;
    font-size: 18px;
    vertical-align: -2px;
    opacity: 0.88;
}

.live-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--hl-primary, #ff5f33);
    color: #fff !important;
    text-decoration: none;
}

.live-mask-loading p {
    margin: 12px 0 0;
}

.live-loading-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: live-spin 0.75s linear infinite;
}

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

.live-player .artplayer-app {
    width: 100%;
    height: 100%;
}

/* 直播页用外层遮罩 loading，避免与 Artplayer 内置图标重叠 */
.live-player .art-loading {
    display: none !important;
}

.live-now {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
}

.live-now-meta {
    min-width: 0;
}

.live-now-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.live-now-sub {
    margin-top: 2px;
    font-size: 12px;
}

.live-lines {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* 半透明样式，随父级深浅色自适应；提高优先级覆盖 button 默认白底 */
.live-page .live-lines .live-line-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    background: rgba(127, 127, 127, 0.18);
    color: inherit;
    line-height: 1.2;
}

.live-page .live-lines .live-line-btn:hover {
    border-color: var(--hl-primary, #ff5f33);
    color: var(--hl-primary, #ff5f33);
    background: rgba(127, 127, 127, 0.28);
}

.live-page .live-lines .live-line-btn.active {
    background: var(--hl-primary, #ff5f33);
    border-color: var(--hl-primary, #ff5f33);
    color: #fff;
}

.live-page .live-lines .live-line-btn.is-failed {
    opacity: 0.45;
    text-decoration: line-through;
}

.live-side {
    width: 420px;
    flex: 0 0 420px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 150px);
    overflow: hidden;
}

.live-side-head {
    padding: 12px;
    border-bottom: 1px solid transparent;
}

.live-search {
    display: flex;
    gap: 8px;
}

/* 覆盖 input 默认白底，颜色随主题由 white/black.css 覆盖；此处给兜底 */
.live-page .live-search input[type="search"],
.live-page .live-search input[type="text"],
.live-page .live-search input {
    flex: 1;
    height: 36px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(127, 127, 127, 0.16);
    color: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.live-page .live-search input::placeholder {
    color: inherit;
    opacity: 0.45;
}

.live-page .live-search input::-webkit-input-placeholder {
    color: inherit;
    opacity: 0.45;
}

.live-page .live-search input:focus {
    border-color: var(--hl-primary, #ff5f33);
}

.live-search button {
    height: 36px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--hl-primary, #ff5f33);
    color: #fff;
    cursor: pointer;
}

.live-side-body {
    flex: 1;
    min-height: 0;
    display: flex;
}

.live-groups {
    width: 176px;
    flex: 0 0 176px;
    overflow: auto;
    border-right: 1px solid transparent;
    padding: 8px 0 10px;
}

.live-nav-section-label {
    padding: 10px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.45;
}

.live-source-block {
    margin: 0 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(127, 127, 127, 0.14);
    background: rgba(127, 127, 127, 0.04);
    overflow: hidden;
}

.live-source-block.is-open {
    background: rgba(127, 127, 127, 0.08);
    border-color: rgba(127, 127, 127, 0.22);
}

.live-source-block.is-active-source {
    border-color: rgba(255, 95, 51, 0.35);
    box-shadow: inset 3px 0 0 var(--hl-primary, #ff5f33);
}

.live-source-head {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 11px 8px 11px 7px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.live-source-head:hover {
    background: rgba(127, 127, 127, 0.1);
}

.live-source-block.is-active-source > .live-source-head {
    color: var(--hl-primary, #ff5f33);
}

.live-source-badge {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(127, 127, 127, 0.22);
    color: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    opacity: 0.9;
}

.live-source-block.is-active-source .live-source-badge {
    background: rgba(255, 95, 51, 0.18);
    color: var(--hl-primary, #ff5f33);
}

.live-source-arrow {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    position: relative;
    opacity: 0.75;
}

.live-source-arrow::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.live-source-block.is-open > .live-source-head .live-source-arrow::before {
    transform: rotate(45deg);
    top: 0;
}

.live-source-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-source-groups {
    display: none;
    margin: 0 6px 8px 10px;
    padding: 2px 0 2px 10px;
    border-left: 2px solid rgba(127, 127, 127, 0.2);
}

.live-source-block.is-open .live-source-groups {
    display: block;
}

.live-group-child {
    position: relative;
    padding: 7px 8px 7px 4px;
    margin-bottom: 1px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: inherit;
    opacity: 0.82;
    border-left: 0 !important;
    border-radius: 6px;
}

.live-group-child::before {
    content: '';
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.28;
}

.live-group-child:hover {
    opacity: 1;
    background: rgba(127, 127, 127, 0.1);
}

.live-group-child:hover::before {
    opacity: 0.5;
}

.live-group-child.active {
    opacity: 1;
    font-weight: 600;
    color: var(--hl-primary, #ff5f33);
    background: rgba(255, 95, 51, 0.1);
}

.live-group-child.active::before {
    opacity: 1;
    background: var(--hl-primary, #ff5f33);
}

.live-source-empty {
    padding: 6px 8px 6px 4px;
    font-size: 11px;
    opacity: 0.5;
}

.live-channels {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 8px;
}

.live-pane-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 8px;
    font-size: 12px;
    font-weight: 600;
}

.live-pane-title em {
    font-style: normal;
    font-weight: 500;
}

.live-nav-global {
    margin: 0 6px 2px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

.live-group-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 10px 10px 9px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    overflow: hidden;
    white-space: nowrap;
}

.live-group-item > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-group-icon {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1;
    margin-right: 1px;
}

.live-group-item:hover {
    background: rgba(127, 127, 127, 0.08);
}

.live-group-item.active {
    border-left-color: var(--hl-primary, #ff5f33);
    color: var(--hl-primary, #ff5f33);
    font-weight: 700;
}

.live-group-item.is-recommend,
.live-group-item.is-favorite {
    font-weight: 700;
}

.live-group-item.is-recommend .live-group-icon {
    color: #ff8a3d;
}

.live-group-item.is-favorite .live-group-icon {
    color: #f5a623;
}

.live-group-item.is-recommend.active .live-group-icon,
.live-group-item.is-favorite.active .live-group-icon {
    color: inherit;
}

.live-channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 8px 9px 10px;
    border-radius: 10px;
    color: inherit;
    margin-bottom: 2px;
}

.live-channel-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.live-fav-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    opacity: 0.55;
}

.live-fav-btn:hover {
    opacity: 1;
    background: rgba(127, 127, 127, 0.15);
}

.live-fav-icon {
    display: block;
    width: 16px;
    height: 16px;
    background: currentColor;
    opacity: 0.7;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.live-channel-item.is-fav .live-fav-btn {
    opacity: 1;
    color: #f5a623;
}

.live-channel-item.is-fav .live-fav-icon {
    opacity: 1;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.live-channel-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 38px;
}

.live-channel-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.live-channel-logo i {
    font-style: normal;
    font-size: 14px;
    font-weight: 700;
}

.live-channel-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.live-channel-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.live-channel-lines {
    font-size: 11px;
}

.live-vip-tag {
    font-size: 11px;
    color: var(--hl-primary, #ff5f33);
    border: 1px solid var(--hl-primary, #ff5f33);
    border-radius: 10px;
    padding: 0 6px;
    line-height: 18px;
}

.live-empty {
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
}

.live-source-item.active {
    background: var(--hl-primary, #1f6feb);
    color: #fff;
}

/* 桌面：播放器为主，侧栏固定宽度给分类/频道；底部线路可滚动 */
@media (min-width: 993px) {
    .live-main {
        align-items: stretch;
        min-height: 0;
        gap: 14px;
    }

    .live-player-col {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        gap: 10px;
    }

    .live-player-box {
        width: 100%;
        max-width: none;
        /* 按列宽撑满 16:9，仅避免过高超出视口 */
        max-height: min(calc((100vw - 460px) * 9 / 16), 70vh, 720px);
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .live-side {
        flex: 0 0 400px;
        width: 400px;
        min-width: 400px;
        max-width: 400px;
        max-height: calc(100vh - 130px);
    }

    .live-groups {
        width: 176px;
        flex-basis: 176px;
    }

    .live-now {
        align-items: flex-start;
        min-height: 88px;
        padding: 12px 14px 14px;
    }

    .live-now-meta {
        flex: 0 0 auto;
        max-width: 140px;
        padding-top: 2px;
    }

    .live-lines {
        flex: 1 1 auto;
        justify-content: flex-start;
        max-height: 120px;
        overflow-y: auto;
        padding-right: 2px;
    }
}

@media (min-width: 1200px) {
    .live-side {
        flex-basis: 440px;
        width: 440px;
        min-width: 440px;
        max-width: 440px;
    }

    .live-groups {
        width: 180px;
        flex-basis: 180px;
    }

    .live-player-box {
        max-height: min(calc((100vw - 500px) * 9 / 16), 75vh, 780px);
    }
}

@media (max-width: 992px) {
    .live-main {
        flex-direction: column;
        min-height: 0;
    }

    .live-side {
        width: 100%;
        flex: none;
        max-height: none;
    }

    .live-side-body {
        min-height: 420px;
    }

    .live-groups {
        width: 160px;
        flex-basis: 160px;
    }

    .live-now {
        flex-direction: column;
        align-items: flex-start;
    }

    .live-lines {
        justify-content: flex-start;
    }
}
