/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 直播容器 */
.live-container {
    max-width: 100%;
    margin: 0;
    padding: 10px;
}

/* 直播头部 */
.live-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.live-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    padding: 5px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
}

.title-icon {
    height: 20px;
    width: 20px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
}

.heat-icon {
    font-size: 14px;
}

/* 直播状态 */
.live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    color: #666;
    font-size: 14px;
}

.status-text {
    color: #999;
    font-weight: bold;
}

.status-text.live {
    color: #ff0000;
}

/* 直播内容区域 */
.live-content {
    display: flex;
    gap: 10px;
    height: calc(100vh - 150px);
}

/* 视频区域 */
.video-section {
    flex: 2;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 加载状态 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    font-size: 16px;
}

.error-text {
    color: #ff6b6b;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* 播放按钮 */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
}

.play-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 暂停覆盖层 */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    cursor: pointer;
}

.pause-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    font-size: 24px;
    transition: all 0.3s ease;
}

.pause-overlay:hover .pause-icon {
    transform: scale(1.1);
}

/* 倒计时 */
.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 直播内容覆盖层 */
.live-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 40px;
}

.live-main-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #fff;
}

.phone-screenshots {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.phone-screen {
    width: 120px;
    height: 240px;
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #ff0000;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 16px;
    color: #fff;
}

.host-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.host-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid #fff;
    background-color: #333;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.host-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

/* 弹幕容器 */
.danmaku-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

/* 弹幕样式 */
.danmaku {
    position: absolute;
    top: 0;
    left: 100%;
    white-space: nowrap;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    animation: danmaku-move 8s linear forwards;
}

@keyframes danmaku-move {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100vw);
    }
}

/* 弹幕输入容器 */
.danmaku-input-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.danmaku-input-container .input-with-emoji {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

#danmaku-input {
    flex: 1;
    padding: 10px 40px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#danmaku-input:focus {
    border-color: #ff6b6b;
}

#send-danmaku {
    padding: 0 20px;
    background-color: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 36px;
}

#send-danmaku:hover {
    background-color: #ff5252;
}

/* 评论区域 */
.comments-section {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comments-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.comments-header h3 {
    font-size: 18px;
    color: #1890ff;
    margin: 0;
}

/* 公告 */
.announcement {
    background-color: #f0f7ff;
    border: 1px solid #d0e3ff;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.announcement-icon {
    font-size: 14px;
    color: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #e6f7ff;
    border-radius: 50%;
}

.announcement-label {
    background-color: #1890ff;
    color: #fff;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: bold;
}

.announcement-content {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    margin-left: 28px;
}

/* 评论列表 */
.comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

/* 评论项 */
.comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 头像 */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* 评论内容 */
.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.nickname {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.content {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* 新消息提示 */
.new-messages {
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
}

/* 评论控制按钮 */
.comments-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.control-button {
    padding: 5px 15px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.control-button.active {
    background-color: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.control-button:hover {
    background-color: #e6f7ff;
    border-color: #91d5ff;
    color: #1890ff;
}

.control-button.active:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

/* 评论操作按钮 */
.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.3s;
}

.comment-action:hover {
    color: #1890ff;
}

.comment-action.liked {
    color: #ff4d4f;
}

/* 回复输入框 */
.reply-input-container {
    margin-top: 10px;
    margin-left: 46px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.reply-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.reply-input:focus {
    border-color: #1890ff;
}

.send-reply {
    padding: 0 15px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 30px;
}

.send-reply:hover {
    background-color: #40a9ff;
}

/* 回复列表 */
.replies-list {
    margin-top: 10px;
    margin-left: 46px;
    padding-left: 10px;
    border-left: 2px solid #f0f0f0;
}

.reply-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.reply-content {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.reply-nickname {
    font-weight: bold;
    color: #333;
    font-size: 12px;
    margin-right: 8px;
}

.reply-time {
    font-size: 11px;
    color: #999;
}

.message-count {
    font-weight: bold;
    color: #1890ff;
    margin-right: 4px;
}

.message-label {
    color: #666;
    margin-right: 4px;
}

.message-arrow {
    color: #999;
    font-size: 12px;
}

/* 评论输入 */
.comment-input-container {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    align-items: center;
}

.input-with-emoji {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

#comment-input {
    flex: 1;
    padding: 10px 40px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#comment-input:focus {
    border-color: #1890ff;
}

.emoji-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.emoji-button:hover {
    color: #666;
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    margin-bottom: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.emoji-picker.show {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
}

.emoji-grid span {
    font-size: 20px;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.emoji-grid span:hover {
    background-color: #f0f0f0;
}

#send-comment {
    padding: 0 20px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    height: 36px;
}

#send-comment:hover {
    background-color: #40a9ff;
}

.more-button {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #f0f0f0;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.more-button:hover {
    background-color: #e0e0e0;
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 5px;
    background-color: #333;
    color: #fff;
    margin-top: 10px;
}

#site-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

#domain {
    font-size: 12px;
    opacity: 0.8;
}

/* 配置按钮 */
.config-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s;
}

.config-button:hover {
    transform: scale(1.1);
}

/* 配置面板 */
.config-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: right 0.3s;
    overflow-y: auto;
}

.config-panel.open {
    right: 0;
}

.config-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-header h2 {
    font-size: 18px;
    color: #333;
}

#close-config {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.config-content {
    padding: 20px;
}

.config-section {
    margin-bottom: 20px;
}

.config-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.config-item input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.save-button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.save-button:hover {
    background-color: #45a049;
}

/* 全屏按钮 */
.fullscreen-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fullscreen-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 视频水印 */
.video-watermark {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* 防下载措施 */
.live-video::-webkit-media-controls-download-button {
    display: none !important;
}

.live-video::-webkit-media-controls-enclosure {
    overflow: hidden !important;
}

.live-video::-webkit-media-controls-panel {
    width: calc(100% + 30px) !important;
}

/* 禁用右键菜单 */
.video-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.video-container video {
    pointer-events: none;
}

.video-container:hover video {
    pointer-events: auto;
}

/* 网络错误提示 */
.network-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

/* 响应式设计 */
@media (max-width: 320px) {
    .live-title {
        font-size: 14px;
        padding: 4px 10px;
    }
    
    .status-text {
        font-size: 12px;
    }
    
    .announcement-content {
        font-size: 12px;
    }
    
    .comment-input-container {
        padding-top: 10px;
    }
    
    #comment-input {
        font-size: 12px;
        padding: 8px 35px 8px 8px;
    }
    
    .countdown {
        font-size: 24px;
    }
    
    .live-main-title {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .phone-screen {
        width: 80px;
        height: 160px;
    }
}

@media (min-width: 321px) and (max-width: 480px) {
    .live-title {
        font-size: 16px;
    }
    
    .announcement-content {
        font-size: 13px;
    }
    
    .countdown {
        font-size: 32px;
    }
    
    .live-main-title {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .phone-screen {
        width: 100px;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .live-container {
        padding: 10px;
    }
    
    .live-content {
        flex-direction: column;
        height: auto;
    }
    
    .video-section {
        width: 100%;
        aspect-ratio: 16/9;
        height: auto;
    }
    
    .comments-section {
        height: 400px;
        margin-top: 20px;
    }
    
    .phone-screenshots {
        gap: 15px;
    }
    
    .phone-screen {
        width: 100px;
        height: 200px;
    }
    
    .live-stats {
        gap: 30px;
    }
    
    .live-main-title {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .config-panel {
        width: 100%;
        right: -100%;
    }
    
    .countdown {
        font-size: 32px;
    }
    
    .live-title {
        font-size: 18px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .live-content {
        height: calc(100vh - 180px);
    }
    
    .video-section {
        flex: 1.5;
    }
    
    .comments-section {
        flex: 1;
    }
}

/* 横屏适配 */
@media (orientation: landscape) {
    .live-content {
        flex-direction: row;
        height: calc(100vh - 120px);
    }
    
    .video-section {
        flex: 2;
        height: 100%;
    }
    
    .comments-section {
        flex: 1;
        height: 100%;
        margin-top: 0;
    }
}

/* 滚动条样式 */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 触摸反馈 */
button, .control-button, .nav-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:active, .control-button:active, .nav-item:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}