/* 直播详情页样式 */

/* 直播主容器 */
.live-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    max-width: 1400px;
    margin: 80px auto 0;
    padding: 20px;
    min-height: calc(100vh - 160px);
}

/* 左侧直播区域 */
.live-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 视频播放器容器 */
.video-player-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
}

.live-indicator i {
    color: #dc3545;
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9rem;
}

.video-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 视频播放器 */
.video-player {
    position: relative;
    background: #000;
    aspect-ratio: 16/9;
}

#liveVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
    background: rgba(102, 126, 234, 1);
}

/* 视频信息 */
.video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
}

.anchor-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.anchor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.anchor-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    color: #333;
}

.anchor-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.fans-count {
    color: #666;
}

.level-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b6914;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.live-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.follow-btn {
    background: #667eea;
    color: white;
}

.follow-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.share-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.share-btn:hover {
    background: #e9ecef;
}

/* 聊天区域 */
.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.chat-header h3 {
    margin: 0;
    color: #333;
}

.chat-stats {
    color: #666;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fafafa;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    animation: fadeInUp 0.3s ease;
}

.message-user {
    font-weight: 600;
    color: #667eea;
    margin-right: 5px;
}

.message-content {
    color: #333;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
    margin-left: 10px;
}

.gift-message {
    background: linear-gradient(135deg, #fff9c4 0%, #fff176 100%);
    border-left: 3px solid #ffd600;
}

.system-message {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    text-align: center;
    font-style: italic;
}

.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.9rem;
}

#chatInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.chat-tools {
    display: flex;
    gap: 5px;
}

.tool-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: #f8f9fa;
    color: #667eea;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

/* 右侧功能区域 */
.live-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 用户信息卡片 */
.user-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.user-balance {
    font-size: 0.9rem;
    color: #666;
}

.balance-amount {
    color: #e74c3c;
    font-weight: 600;
}

.recharge-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.recharge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 面板通用样式 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.panel-header h4 {
    margin: 0;
    color: #333;
}

.panel-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: transform 0.3s ease;
}

.panel-toggle.active {
    transform: rotate(180deg);
}

/* 礼物面板 */
.gift-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.gift-list {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.gift-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.gift-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.gift-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 10px;
}

.gift-info {
    flex: 1;
}

.gift-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.gift-price {
    font-size: 0.8rem;
    color: #e74c3c;
    font-weight: 600;
}

/* 排行榜 */
.ranking-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ranking-time {
    font-size: 0.8rem;
    color: #666;
}

.ranking-list {
    padding: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-number {
    width: 25px;
    height: 25px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
}

.top-1 .rank-number {
    background: #ffd700;
    color: #8b6914;
}

.top-2 .rank-number {
    background: #c0c0c0;
    color: #666;
}

.top-3 .rank-number {
    background: #cd7f32;
    color: #8b4513;
}

.ranking-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-name {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.contribution {
    font-size: 0.8rem;
    color: #e74c3c;
    font-weight: 600;
}

/* 直播信息面板 */
.live-info-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.live-details {
    padding: 15px 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.info-value {
    color: #333;
    font-size: 0.9rem;
}

/* 礼物动画容器 */
#giftAnimationContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.gift-animation {
    position: absolute;
    animation: giftFloat 3s ease-in-out forwards;
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes giftFloat {
    0% {
        transform: translateY(100vh) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateY(70vh) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(20vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .live-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .live-sidebar {
        order: -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .live-container {
        margin-top: 60px;
        padding: 10px;
    }
    
    .video-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .anchor-info {
        justify-content: center;
    }
    
    .live-actions {
        justify-content: center;
    }
    
    .live-sidebar {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .anchor-stats {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .user-card {
        flex-direction: column;
        text-align: center;
    }
    
    .gift-list {
        max-height: 200px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}