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

:root {
    --primary-color: #333;
    --secondary-color: #ff6b81;
    --bg-dark: #212529;
    --text-dark: #666;
    --text-light: #f8f9fa;
    --class-bg: #fff0f0;
    --break-bg: #f0fff0;
    --class-color: #e53935;
    --break-color: #43a047;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    color: var(--text-dark);
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url(./assets/bg.png);
}

.container {
    display: flex;
    flex-direction: row;
    min-height: 80vh;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
}

.live-room, .schedule {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    height: 100%;
}

.card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.card-body {
    padding: 0;
}

/* 视频容器样式 */
.video-container {
    flex: 1 1 0;
    width: 100%;
    background-color: #000;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    overflow: hidden;
    display: flex;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 当前状态样式 */
.current-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

#current-time {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

#status-indicator {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    display: inline-block;
}

.status-class {
    background-color: var(--class-bg);
    color: var(--class-color);
}

.status-free {
    background-color: var(--break-bg);
    color: var(--break-color);
}

/* 时间表样式 */
.schedule-list {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
    height: calc(100vh - 320px);
    overflow-y: auto;
}

.schedule-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.schedule-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

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

.schedule-item.active {
    background-color: rgba(78, 95, 255, 0.1);
    border-left: 4px solid var(--primary-color);
}

.schedule-time {
    color: var(--text-dark);
    font-weight: 600;
    background-color: #f0f4ff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.schedule-name {
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
    padding-left: 15px;
    font-size: 1rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 10px;
}

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

/* 备用容器样式 */
.fallback-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    color: white;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    border-radius: var(--border-radius);
}

.reload-button {
    margin-top: 20px;
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.reload-button:hover {
    background-color: #3546d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.reload-button:active {
    transform: scale(0.98);
}

/* 虚拟自习室样式 */
.virtual-study-room {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    color: white;
    font-family: 'Microsoft YaHei', sans-serif;
}

.study-room-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #333;
}

.room-title {
    font-weight: bold;
    font-size: 18px;
    color: #f1f1f1;
}

.online-count {
    font-size: 14px;
    color: #aaa;
}

.study-room-content {
    flex: 1;
    position: relative;
    background: linear-gradient(to bottom, #1a1a1a, #2a2a2a);
    overflow: hidden;
}

.study-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSIjNjA2MGEwIiBzdHJva2Utd2lkdGg9IjEuNSIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4xIj48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBiZWdpbj0iMHMiIGR1cj0iM3MiIHZhbHVlcz0iMTsxLjU7MSIgY2FsY01vZGU9InNwbGluZSIga2V5U3BsaW5lcz0iMC41IDAgMC41IDEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIi8+PC9jaXJjbGU+PC9zdmc+') center center;
    opacity: 0.2;
}

.ambient-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(100, 100, 180, 0.05) 0%, rgba(30, 30, 60, 0) 70%);
    animation: pulse 15s infinite alternate;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.live-link:hover {
    background-color: #fc8bab;
}

#background-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 添加连接状态徽章样式 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.online {
    background-color: rgba(67, 160, 71, 0.15);
    color: #43a047;
}

.status-badge.reconnecting {
    background-color: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    animation: pulse-warning 1.5s infinite;
}

.status-badge.offline {
    background-color: rgba(229, 57, 53, 0.15);
    color: #e53935;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 添加加载错误样式 */
.load-error {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* 美化细节 */
.card-header h2 {
    position: relative;
    padding-left: 15px;
}

.card-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        gap: 15px;
    }
    
    .video-container {
        height: 50vh;
    }
    
    .schedule-list {
        height: auto;
        max-height: 50vh;
    }
    
    #current-time {
        font-size: 1.5rem;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    h2 {
        font-size: 1.2rem;
    }
}

/* 倒计时样式 */
.countdown-container {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-label {
    font-size: 0.95rem;
    color: var(--text-dark);
    opacity: 0.7;
    margin-bottom: 6px;
    font-weight: 500;
}

#countdown-target {
    font-weight: 600;
    color: var(--primary-color);
}

.countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.countdown-box {
    background: linear-gradient(135deg, var(--primary-color), #636dff);
    border-radius: 8px;
    padding: 6px 4px;
    min-width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    box-shadow: 0 3px 10px rgba(78, 95, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.countdown-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 0 0;
}

.countdown-box span:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    z-index: 1;
}

.countdown-unit {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.9;
    z-index: 1;
    margin-top: 0.1rem;
}

.countdown-separator {
    font-size: 1.1rem;
    font-weight: 700;
    color: #bbb;
    margin: 0 2px;
}

/* 倒计时即将结束动画 */
@keyframes pulse-countdown {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.countdown-ending .countdown-box {
    animation: pulse-countdown 1s infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .countdown-box {
        min-width: 50px;
        padding: 8px 6px;
    }
    
    .countdown-box span:first-child {
        font-size: 1.4rem;
    }
    
    .countdown-separator {
        font-size: 1.4rem;
    }
    
    .countdown-unit {
        font-size: 0.65rem;
    }
} 