* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 确保Halfmoon样式能正确应用 */
:root {
    /* 基础变量 */
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white-color: #ffffff;
    
    /* 白昼模式（默认） */
    --text-color: #333333;
    --bg-color: rgba(245, 245, 245, 0.95);
    --card-bg-color: rgba(255, 255, 255, 0.95);
    --border-color: #e0e0e0;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --navbar-bg-color: rgba(44, 62, 80, 0.95);
    --navbar-text-color: #ffffff;
    --navbar-brand-text-color: #ffffff;
    --navbar-link-text-color: #b0b0b0;
    --navbar-link-hover-text-color: #ffffff;
    --navbar-link-hover-bg-color: rgba(255, 255, 255, 0.1);
    --primary-hover-color: #2980b9;
    --primary-active-color: #1f618d;
    --danger-hover-color: #c0392b;
    --danger-active-color: #a93226;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-pill: 50rem;
    --box-shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 深色模式 */
.dark-mode {
    --text-color: #e0e0e0;
    --bg-color: rgba(26, 26, 46, 0.95);
    --card-bg-color: rgba(22, 33, 62, 0.95);
    --border-color: #0f3460;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --navbar-bg-color: rgba(15, 52, 96, 0.95);
    --navbar-text-color: #e0e0e0;
    --navbar-brand-text-color: #ffffff;
    --navbar-link-text-color: #b0b0b0;
    --navbar-link-hover-text-color: #ffffff;
    --navbar-link-hover-bg-color: rgba(255, 255, 255, 0.1);
}

/* 移除dark-mode默认类的body样式，使用light-mode类来区分 */
body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('https://file.devhub.eu.org/file/wallpaper/ornzIbKk.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* 重置light-mode类的样式 */
body.light-mode {
    --text-color: #333333;
    --bg-color: rgba(245, 245, 245, 0.95);
    --card-bg-color: rgba(255, 255, 255, 0.95);
    --border-color: #e0e0e0;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --navbar-bg-color: rgba(44, 62, 80, 0.95);
    --navbar-text-color: #ffffff;
}

/* 直播容器 */
.live-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--card-bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

/* 顶部导航栏 - 现代化设计 */
.live-header {
    background-color: var(--navbar-bg-color);
    color: var(--navbar-text-color);
    padding: 0.5rem 1rem;
    box-shadow: var(--box-shadow);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* 导航栏内部容器 */
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    height: 60px;
}

/* Logo区域 */
.header-logo-container {
    display: flex;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--navbar-brand-text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.header-logo:hover {
    background-color: var(--navbar-link-hover-bg-color);
    transform: translateY(-1px);
}

.logo-icon {
    font-size: 1.8rem;
    display: inline-block;
}

.logo-text {
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* 主要导航 */
.primary-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--navbar-link-text-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    font-size: 0.95rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--navbar-link-hover-text-color);
    background-color: var(--navbar-link-hover-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-link:active {
    transform: translateY(0);
}

.nav-icon {
    font-size: 1.1rem;
}

/* 右侧功能区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 搜索框 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0 1rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.search-container:focus-within {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    padding: 0.6rem 0.5rem;
    color: var(--navbar-text-color);
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--navbar-link-text-color);
    opacity: 0.7;
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--navbar-link-text-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.search-btn:hover {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
}

/* 功能按钮 */
.action-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--navbar-link-text-color);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: 45px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1.1rem;
}

.action-btn:hover {
    color: var(--navbar-link-hover-text-color);
    background-color: var(--navbar-link-hover-bg-color);
    border-color: var(--border-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: translateY(0) scale(0.95);
}

/* 通知按钮 */
.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 模式切换按钮 */
.mode-toggle-btn {
    font-size: 1.2rem;
}

.mode-icon {
    transition: all 0.3s ease;
    display: inline-block;
}

body.light-mode .mode-icon {
    transform: rotate(180deg) scale(0.9);
    content: '☀️';
}

/* 用户头像 */
.user-profile {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .search-input {
        width: 150px;
    }
    
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .primary-nav {
        display: none;
    }
    
    .search-input {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        gap: 1rem;
    }
    
    .search-container {
        order: 3;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}

/* 主要内容区域 */
.live-main {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
}

/* 左侧播放器区域 */
.player-section {
    flex: 1;
    min-width: 0;
}

.player-container {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* 视频播放器 */
.live-player {
    width: 100%;
    height: auto;
    display: block;
    background-color: #000;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    max-height: 80vh;
}

/* DPlayer容器特定样式 */
#dplayer-container {
    width: 100%;
    height: 100%;
}

/* 直播信息 */
.live-info {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.live-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.3;
}

.live-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.streamer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.streamer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: var(--box-shadow-sm);
}

.streamer-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.streamer-name {
    font-weight: 600;
    color: var(--text-color);
}

.follow-btn {
    background-color: var(--danger-color);
    color: var(--white);
    border: 1px solid var(--danger-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-pill);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-size: var(--font-size-normal);
}

.follow-btn:hover {
    background-color: var(--danger-hover-color);
    border-color: var(--danger-hover-color);
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-sm);
}

.follow-btn:active {
    transform: translateY(0);
    box-shadow: var(--box-shadow-inset);
}

.live-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.viewers-count, .likes-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 直播描述 */
.live-description {
    padding: 1rem;
    color: var(--text-muted);
    background-color: var(--bg-color);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

/* 右侧聊天室区域 */
.chat-section {
    width: 400px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 300px;
    border: 1px solid var(--border-color);
}

/* 聊天室头部 */
.chat-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

/* 聊天室切换按钮 */
.chat-toggle-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-size: var(--font-size-normal);
}

.chat-toggle-btn:hover {
    background-color: var(--primary-hover-color);
    transform: scale(1.1);
    border-color: var(--white);
}

.chat-toggle-btn:active {
    transform: scale(0.95);
    background-color: var(--primary-active-color);
}

/* 切换图标旋转动画 */
.toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.chat-section.shrunk .toggle-icon {
    transform: rotate(180deg);
}

/* 聊天室基础样式 */
.chat-section {
    width: 400px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 300px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

/* 收缩状态样式 - 固定宽度，仅改变高度 */
.chat-section.shrunk {
    width: 400px; /* 保持固定宽度，不影响播放器 */
    height: 80px;
    min-height: 80px;
    max-height: 80px;
}

.chat-section.shrunk .chat-iframe {
    display: none;
}

/* iframe嵌入式聊天室 */
.chat-iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--bg-color);
    min-height: 200px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chat-section {
        width: 350px;
    }
    
    /* 收缩状态保持350px宽度 */
    .chat-section.shrunk {
        width: 350px;
    }
}

@media (max-width: 992px) {
    .live-main {
        flex-direction: column;
    }
    
    .chat-section {
        width: 100%;
        height: 400px;
    }
    
    /* 移动端收缩状态 - 保持100%宽度但固定高度 */
    .chat-section.shrunk {
        width: 100%;
        height: 80px;
        min-height: 80px;
    }
    
    .live-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .live-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .live-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-nav ul {
        gap: 1rem;
    }
    
    .live-main {
        padding: 0.5rem;
    }
    
    .live-title {
        font-size: 1.1rem;
    }
    
    .streamer-details {
        gap: 0.5rem;
    }
    
    .follow-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .live-stats {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .streamer-info {
        gap: 0.5rem;
    }
    
    .streamer-avatar {
        width: 40px;
        height: 40px;
    }
    
    .live-title {
        font-size: 1rem;
    }
    
    .streamer-name {
        font-size: 0.9rem;
    }
    
    .live-stats {
        font-size: 0.85rem;
    }
    
    .live-description {
        font-size: 0.9rem;
    }
}