﻿/* ==================== 直播页面样式 ==================== */
/* 直播容器 */
.live-container {
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-container.pushed {
    transform: translateX(-30%);
}

/* 顶部标题栏 */
.live-header {
    background: #ffffff;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.live-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    text-align: center;
}

/* 顶部悬浮Tab栏 */
.live-sticky-tabs {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding-top: 3px;
    flex-shrink: 0;
}

.live-tabs-container {
    display: flex;
    align-items: center;
    background: white;
    position: relative;
    width: 100%;
}

.live-tabs-scroll {
    display: flex;
    gap: 0;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1;
    margin-right: 60px; /* 为更多按钮留出空间 */
}

.live-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.live-tabs-more-container {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 30%);
}


.live-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.live-tab:hover {
    color: var(--primary-color);
}

.live-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 更多按钮样式 */
.live-tab-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 4px;
}

.live-tab-more:hover {
    background: rgba(var(--primary-color-rgb, 255, 149, 0), 0.1);
    transform: scale(1.1);
}

.live-tab-more:active {
    transform: scale(0.95);
}

.live-tab-more .more-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.live-tab-more:hover .more-icon {
    filter: brightness(1.2);
}

/* SVG更多按钮图标样式 - 支持主题切换 */
.live-tab-more .more-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
    color: var(--primary-color, #ff9500);
    transition: color 0.3s ease;
}

.live-tab-more:hover .more-icon-svg {
    color: var(--primary-light, #ffad33);
}

.live-main-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ==================== 直播展开页面样式 ==================== */
.live-expand-page {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateX(100%);
    width: 100%;
    max-width: 540px;
    height: 100vh;
    background: white;
    z-index: 2000;
    display: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.live-expand-page.show {
    transform: translateX(-50%) translateX(0);
}

/* 展开页面头部 */
.live-expand-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 16px;
    background: white;
    height: 48px;
    min-height: 48px;
}

.live-expand-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
}

.live-expand-back:hover {
    background: rgba(255, 149, 0, 0.1);
    transform: scale(1.1);
}

.live-expand-back .back-icon,
.live-expand-back svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.live-expand-back .back-icon {
    object-fit: contain;
}

.live-expand-back svg {
    display: block;
    color: var(--primary-color, #ff9500);
}

.live-expand-back:hover .back-icon {
    filter: brightness(1.2);
}

.live-expand-back:hover svg {
    color: var(--primary-light, #ffad33);
}

.live-expand-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    flex: 1;
    text-align: center;
}

.live-expand-placeholder {
    width: 32px;
    height: 32px;
}

/* 展开页面内容 */
.live-expand-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: white;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - 48px); /* 减去头部高度 */
}

.live-expand-banners {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 横幅样式 */
.live-expand-banner {
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
    margin: 0;
    padding: 0;
}

.live-expand-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.live-expand-banner img {
    width: 100%;
    height: 60px;
    object-fit: fill;
    transition: transform 0.3s ease;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.live-expand-banner:hover img {
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .live-expand-content {
        padding: 12px;
        height: calc(100vh - 48px);
    }
    
    .live-expand-banners {
        gap: 12px;
    }
    
    .live-expand-banner img {
        height: 60px;
        object-fit: fill;
        display: block;
        margin: 0;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .live-expand-header {
        padding: 3px 12px;
    }
    
    .live-expand-title {
        font-size: 16px;
    }
    
    .live-expand-content {
        padding: 8px;
        height: calc(100vh - 48px);
    }
    
    .live-expand-banners {
        gap: 10px;
    }
    
    .live-expand-banner img {
        height: 60px;
        object-fit: fill;
        display: block;
        margin: 0;
        padding: 0;
    }
}

/* 滚动条样式 */
.live-main-content::-webkit-scrollbar,
.live-expand-content::-webkit-scrollbar {
    width: 6px;
}

.live-main-content::-webkit-scrollbar-track,
.live-expand-content::-webkit-scrollbar-track {
    background: transparent;
}

.live-main-content::-webkit-scrollbar-thumb,
.live-expand-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.live-main-content::-webkit-scrollbar-thumb:hover,
.live-expand-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 直播卡片网格 */
.live-streams-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
    padding: 0 10px 20px 10px;
}

/* 直播卡片 */
.live-stream-card {
    position: relative;
    background: white;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.live-stream-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.live-stream-card:hover .live-card-image-img.loaded {
    transform: scale(1.03);
}

.live-card-image {
    position: relative;
    width: calc(100% - 16px);
    height: 180px;
    margin: 8px 8px 0 8px;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #f5f5f5 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: liveSkeletonLoading 1.5s ease-in-out infinite;
    border-radius: 12px 12px 0 0;
}

/* 骨架屏加载动画 */
@keyframes liveSkeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.live-card-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 12px 12px 0 0;
    opacity: 1;
    position: relative;
    z-index: 1;
}

/* 图片加载后停止骨架屏动画 */
.live-card-image:has(.live-card-image-img.loaded) {
    animation: none;
    background: #f0f0f0;
}


.live-free-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(236, 72, 153, 0.9);
    color: white;
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: normal;
    z-index: 20;
    min-width: 24px;
    text-align: center;
}

.live-live-indicator {
    position: absolute;
    bottom: 6px;
    left: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(251, 146, 60, 0.9);
    color: white;
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: normal;
    z-index: 20;
    min-width: 24px;
}

.live-live-dot {
    display: flex;
    align-items: center;
    gap: 1px;
    height: 12px;
}

.live-live-dot::before,
.live-live-dot::after {
    content: '';
    width: 2px;
    background: white;
    border-radius: 1px;
    animation: liveBounce 1.2s infinite ease-in-out;
}

.live-live-dot::before {
    animation-delay: 0s;
}

.live-live-dot::after {
    animation-delay: 0.3s;
}

@keyframes liveBounce {
    0%, 80%, 100% {
        height: 4px;
        opacity: 0.7;
    }
    40% {
        height: 12px;
        opacity: 1;
    }
}

.live-watch-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    padding: 2px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 9px;
    font-weight: normal;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease;
    min-width: 24px;
}

.live-watch-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.05);
}

.live-watch-icon {
    font-size: 10px;
}

.live-danmu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 15;
}

.live-danmu-item {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: normal;
    animation: liveDanmuMove 10s linear infinite;
    white-space: nowrap;
}

@keyframes liveDanmuMove {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(-200%);
        opacity: 0;
    }
}

.live-card-content {
    padding: 12px;
}

.live-streamer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.live-streamer-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #f5f5f5 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: liveSkeletonLoading 1.5s ease-in-out infinite;
}

/* 头像加载后停止骨架屏动画 */
.live-streamer-avatar:has(.live-avatar-img.loaded) {
    animation: none;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
}

.live-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}

.live-streamer-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-streamer-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-streamer-platform {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-stream-stats {
    display: flex;
    justify-content: space-between;
}

.live-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
}

.live-stat-icon {
    font-size: 12px;
}

.live-stat-text {
    font-size: 11px;
    color: #666;
}

.live-stat-value {
    font-size: 11px;
    color: #333;
    font-weight: 500;
}

.live-stat-item:first-child .live-stat-icon {
    color: #007bff;
}

.live-stat-item:last-child .live-stat-icon {
    color: #dc3545;
}

.live-stat-value {
    font-size: 11px;
    font-weight: 500;
    color: #333;
}

/* 观看模态框 */
.live-watch-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
}

.live-watch-content {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    max-width: 380px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: liveModalSlideIn 0.3s ease-out;
}

.live-modal-card-image {
    position: relative;
    width: calc(100% - 24px);
    height: 320px;
    margin: 12px 12px 0 12px;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #f5f5f5 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: liveSkeletonLoading 1.5s ease-in-out infinite;
    border-radius: 12px;
}

/* 弹窗图片加载后停止骨架屏动画 */
.live-modal-card-image:has(img.loaded) {
    animation: none;
    background: #f0f0f0;
}

.live-modal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform: scale(1);
}

.live-modal-card-image img:hover {
    transform: scale(1.05);
}

/* 弹窗图片内的直播中标识 */
.live-modal-card-image .live-live-indicator {
    position: absolute !important;
    bottom: 12px !important;
    left: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: rgba(251, 146, 60, 0.9) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    z-index: 20 !important;
}

.live-modal-card-image .live-live-dot {
    display: flex;
    align-items: center;
    gap: 1px;
    height: 12px;
}

.live-modal-card-image .live-live-dot::before,
.live-modal-card-image .live-live-dot::after {
    content: '';
    width: 2px;
    background: white;
    border-radius: 1px;
    animation: liveBounce 1.2s infinite ease-in-out;
}

.live-modal-card-image .live-live-dot::before {
    animation-delay: 0s;
}

.live-modal-card-image .live-live-dot::after {
    animation-delay: 0.3s;
}

/* 弹窗图片进入动画 */
@keyframes liveModalImageSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 弹窗整体进入动画 */
@keyframes liveModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


.live-modal-info {
    padding: 20px;
}

.live-streamer-name-row,
.live-platform-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-name-label,
.live-platform-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.live-modal-info .live-streamer-name {
    font-size: 12px;
    font-weight: normal;
    color: #333;
}

.live-modal-info .live-platform-name {
    font-size: 11px;
    color: #007bff;
    font-weight: 500;
}

.live-streamer-stats {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin: 14px 0;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.live-stat-text {
    font-size: 11px;
    color: #666;
}

.live-stat-number {
    font-weight: normal;
    color: #007bff;
}

.live-modal-info {
    padding: 8px 12px 16px 12px;
}

.live-download-notice {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    border: 1px solid #f0f0f0;
}

.live-notice-content {
    display: block;
    padding: 10px;
}

.live-notice-icon {
    display: none;
}

.live-notice-text {
    text-align: left;
}

.live-notice-text p {
    font-size: 12px;
    color: #666;
    line-height: 1.8;
    margin: 0;
}

.live-stats-text {
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.live-stats-text .live-stat-icon {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
}

.live-stats-text .live-stat-number {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 8px;
}

.live-platform-highlight,
.live-app-highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.live-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    padding: 0;
}

.live-close-watch {
    flex: 1;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-close-watch:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.live-close-watch:active {
    transform: scale(0.98);
}

.live-download-btn {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.2);
}

.live-download-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.live-download-btn:active {
    transform: scale(0.98);
}

.live-download-icon {
    font-size: 18px;
}

.live-stream-card.hidden {
    display: none;
}

.live-stream-card.fade-in {
    animation: liveFadeIn 0.5s ease-in;
}

@keyframes liveFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 直播页面响应式设计 */
@media (max-width: 768px) {
    .live-header {
        padding: 10px 16px;
    }
    
    .live-title {
        font-size: 17px;
    }
    
    .live-streams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 8px 20px 8px;
    }
    
    .live-card-image {
        height: 160px;
    }
    
    .live-modal-card-image {
        height: 260px;
    }
    
    .live-card-content {
        padding: 10px;
    }
    
    .live-streamer-avatar {
        width: 32px;
        height: 32px;
    }
    
    .live-streamer-name {
        font-size: 12px;
    }
    
    .live-streamer-platform {
        font-size: 10px;
    }
    
    .live-stat-item {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .live-header {
        padding: 8px 12px;
    }
    
    .live-title {
        font-size: 16px;
    }
    
    .live-streams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 5px 20px 5px;
    }
    
    .live-card-image {
        height: 140px;
    }
    
    .live-modal-card-image {
        height: 240px;
    }
    
    .live-card-content {
        padding: 8px;
    }
    
    .live-streamer-avatar {
        width: 30px;
        height: 30px;
    }
    
    .live-streamer-name {
        font-size: 11px;
    }
    
    .live-streamer-platform {
        font-size: 9px;
    }
    
    .live-stat-item {
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    .live-streams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 3px 20px 3px;
    }
    
    .live-card-image {
        height: 120px;
    }
    
    .live-modal-card-image {
        height: 220px;
    }
    
    .live-card-content {
        padding: 6px;
    }
    
    .live-streamer-avatar {
        width: 28px;
        height: 28px;
    }
    
    .live-streamer-name {
        font-size: 10px;
    }
    
    .live-streamer-platform {
        font-size: 8px;
    }
    
    .live-stat-item {
        font-size: 8px;
    }
}

/* 统计图标样式 */
.live-stat-icon {
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.live-stat-number {
    font-weight: 700;
    letter-spacing: 0.5px;
}
