/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 8px;
}

/* ===== 顶部导航栏 ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, #16213e 0%, #0f172a 100%);
    border-bottom: 1px solid #2a3a5c;
    height: 64px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #ffd700;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

.room-id {
    font-weight: 600;
    color: #4fc3f7;
    font-size: 14px;
}

.host-name {
    color: #b0b0b0;
    font-size: 14px;
}

.network-status {
    display: flex;
    gap: 12px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-item span:last-child {
    font-weight: 600;
    color: #4caf50;
}

.timer {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 16px;
    font-weight: 600;
    background: #0d1117;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #30363d;
    color: #ffd700;
    flex-shrink: 0;
}

/* ===== 主体区域 ===== */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 12px;
    gap: 12px;
    background-color: #0f172a;
}

/* ===== 左侧直播区 ===== */
.live-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* 视频容器 */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a3a5c;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0a0a0a;
}

.video-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    pointer-events: none;
}

.interpolate-badge {
    background: rgba(220, 20, 60, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 功能标签页 */
.tabs-container {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    height: 200px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #334155;
    background: #16213e;
    padding: 0 8px;
}

.tab-btn {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    flex: 1;
    text-align: center;
}

.tab-btn:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #4fc3f7;
    border-bottom-color: #4fc3f7;
}

.tabs-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.presentation-slide {
    background: #0f172a;
    border-radius: 6px;
    padding: 16px;
    height: 100%;
    border: 1px solid #334155;
    position: relative;
}

.presentation-slide h3 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 16px;
}

.presentation-slide p {
    color: #cbd5e1;
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 14px;
}

.page-indicator {
    position: absolute;
    bottom: 12px;
    right: 16px;
    color: #64748b;
    font-size: 12px;
}

/* 控制栏 */
.controls-bar {
    padding: 10px;
    background: #1e293b;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== 右侧侧边栏 ===== */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.chat-section,
.members-section {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-section {
    flex: 2;
    min-height: 0;
}

.members-section {
    flex: 1;
    min-height: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #16213e;
    border-bottom: 1px solid #334155;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
}

.member-count,
.online-count {
    background: #0f172a;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 12px;
    color: #4fc3f7;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #0f172a;
}

.message {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.message.system {
    color: #ffb74d;
    text-align: center;
    font-style: italic;
    padding: 4px 0;
}

.message.user {
    color: #e0e0e0;
}

.message .username {
    font-weight: 600;
    color: #4fc3f7;
    margin-right: 6px;
}

/* 聊天输入区 */
.chat-input {
    display: flex;
    padding: 10px;
    background: #16213e;
    border-top: 1px solid #334155;
    gap: 6px;
}

#chatInput {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 6px 12px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#chatInput:focus {
    border-color: #4fc3f7;
}

#sendMsgBtn {
    background: #4fc3f7;
    color: #0f172a;
    border: none;
    border-radius: 16px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

#sendMsgBtn:hover {
    background: #29b6f6;
}

/* 成员列表 */
.members-list {
    padding: 10px;
    overflow-y: auto;
    background: #0f172a;
}

.member-item {
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    color: #cbd5e1;
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.member-item:hover {
    background: #1e293b;
}

.member-item::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 8px;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ===== 响应式调整 ===== */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .header {
        height: auto;
        padding: 8px 12px;
    }
    
    .network-status {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 16px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        padding: 8px;
        gap: 8px;
    }
    
    .video-container {
        border-radius: 6px;
    }
}

/* 小平板和大屏手机 (480px - 767px) */
@media (max-width: 767px) {
    .app-container {
        padding: 0;
    }
    
    .header {
        padding: 6px 10px;
        gap: 8px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .room-info {
        padding: 4px 10px;
        gap: 8px;
    }
    
    .room-id,
    .host-name {
        font-size: 12px;
    }
    
    .timer {
        font-size: 14px;
        padding: 3px 10px;
    }
    
    .network-status {
        font-size: 11px;
        padding: 3px 10px;
        gap: 10px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        height: 200px;
    }
    
    .chat-section,
    .members-section {
        flex: 1;
    }
    
    .video-container {
        aspect-ratio: 16 / 9;
    }
}

/* 手机设备 (小于 480px) */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px;
        gap: 6px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .room-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .timer {
        align-self: flex-end;
    }
    
    .network-status {
        gap: 8px;
        font-size: 10px;
    }
    
    .sidebar {
        flex-direction: column;
        height: 250px;
    }
    
    .chat-section {
        flex: 2;
    }
    
    .members-section {
        flex: 1;
    }
    
    .video-container {
        aspect-ratio: 16 / 9;
    }
    
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #chatInput {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    #sendMsgBtn {
        font-size: 12px;
        padding: 0 14px;
    }
}