/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 背景 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: -1;
}

/* 主容器 */
.container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 标题 */
.header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.header h1 {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    letter-spacing: 8px;
}

/* 弹幕容器 */
.danmu-container {
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 150px;
    overflow: hidden;
}

/* 弹幕项 */
.danmu-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(5px);
    white-space: nowrap;
    animation: danmuMove linear forwards;
}

.danmu-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.danmu-item .name {
    font-size: 14px;
    color: #ffd700;
    font-weight: bold;
}

.danmu-item .content {
    font-size: 18px;
    color: #ffffff;
}

/* 弹幕移动动画 */
@keyframes danmuMove {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-100% - 100vw));
    }
}

/* 特效弹幕样式 */
.danmu-item.effect-firework {
    background: linear-gradient(90deg, rgba(255, 100, 100, 0.3), rgba(255, 200, 100, 0.3));
    border: 1px solid rgba(255, 150, 100, 0.5);
}

.danmu-item.effect-heart {
    background: linear-gradient(90deg, rgba(255, 100, 150, 0.3), rgba(255, 150, 200, 0.3));
    border: 1px solid rgba(255, 100, 150, 0.5);
}

.danmu-item.effect-confetti {
    background: linear-gradient(90deg, rgba(100, 200, 255, 0.3), rgba(200, 100, 255, 0.3));
    border: 1px solid rgba(150, 150, 255, 0.5);
}

.danmu-item.effect-star {
    background: linear-gradient(90deg, rgba(255, 255, 100, 0.3), rgba(255, 200, 50, 0.3));
    border: 1px solid rgba(255, 220, 100, 0.5);
}

.danmu-item.effect-sakura {
    background: linear-gradient(90deg, rgba(255, 180, 200, 0.3), rgba(255, 220, 230, 0.3));
    border: 1px solid rgba(255, 180, 200, 0.5);
}

/* 入场提示 */
.entrance-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
}

.entrance-item {
    font-size: 42px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: entranceAnim 2s ease-out forwards;
}

@keyframes entranceAnim {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    40% {
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 公告 */
.notice-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    pointer-events: none;
}

.notice-item {
    padding: 30px 60px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #ffd700;
    border-radius: 15px;
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    text-align: center;
    animation: noticeAnim 5s ease-out forwards;
}

@keyframes noticeAnim {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 优质弹幕展示 */
.excellent-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
}

.excellent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid transparent;
    border-radius: 20px;
    animation: excellentAnim 3s ease-out forwards;
}

.excellent-item .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #ffd700;
}

.excellent-item .name {
    font-size: 24px;
    color: #ffd700;
    font-weight: bold;
}

.excellent-item .content {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(90deg, #ff6b6b, #ffd700, #51cf66, #339af0, #cc5de8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 2s linear infinite;
}

@keyframes excellentAnim {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    15% {
        opacity: 1;
        transform: scale(1.1);
    }
    25% {
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes gradientText {
    to {
        background-position: 200% center;
    }
}

/* 统计面板 */
.stats-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    min-width: 200px;
}

.stats-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.stats-value {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
}

.ranking-list {
    list-style: none;
    padding-left: 0;
}

.ranking-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #ffffff;
}

.ranking-list li .rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffd700;
    color: #1a1a2e;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

.ranking-list li .rank-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.ranking-list li .rank-name {
    flex: 1;
}

.ranking-list li .rank-count {
    color: #ffd700;
    font-weight: bold;
}

/* 特效画布 */
.effects-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* 暂停状态 */
.paused .danmu-item {
    animation-play-state: paused;
}

/* 连接状态提示 */
.connection-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1000;
}

.connection-status.connected {
    background: rgba(81, 207, 102, 0.8);
    color: #ffffff;
}

.connection-status.disconnected {
    background: rgba(255, 107, 107, 0.8);
    color: #ffffff;
}
