/* ========== 大厅页面样式 ========== */

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.user-info {
    color: #fff;
}

.user-info #user-nickname {
    font-size: 1.2rem;
    font-weight: bold;
}

.user-info .stats {
    margin-left: 15px;
    opacity: 0.9;
}

.lobby-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.lobby-actions button {
    flex: 1;
}

.room-section {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
}

.room-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.room-list {
    max-height: 300px;
    overflow-y: auto;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.room-item:last-child {
    border-bottom: none;
}

.room-item-info {
    flex: 1;
}

.room-item-id {
    font-weight: bold;
    color: #667eea;
}

.room-item-details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.room-item button {
    padding: 8px 20px;
    width: auto;
    font-size: 0.9rem;
}

.join-room {
    display: flex;
    gap: 10px;
}

.join-room input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 5px;
}

.join-room button {
    width: auto;
    padding: 15px 30px;
}

/* ========== 小程序二维码悬浮按钮 ========== */

.qr-float-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 500;
    transition: all 0.3s ease;
}

.qr-float-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.qr-float-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.qr-float-icon {
    font-size: 24px;
    line-height: 1;
}

/* 小程序二维码弹层 */
.qr-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 600;
    align-items: center;
    justify-content: center;
}

.qr-popup.show {
    display: flex;
}

.qr-popup-inner {
    background: white;
    border-radius: 20px;
    width: 280px;
    padding: 30px 24px 24px;
    text-align: center;
    position: relative;
    animation: popupIn 0.25s ease;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.qr-popup-close:hover {
    background: #f5f5f5;
}

.qr-popup-inner h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.qr-popup-img {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-popup-placeholder {
    flex-direction: column;
    color: #ccc;
    gap: 8px;
}

.qr-popup-placeholder p {
    font-size: 14px;
    color: #999;
}

.qr-popup-placeholder small {
    font-size: 11px;
    color: #bbb;
}

.qr-popup-tip {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* H5 小屏幕隐藏悬浮按钮，改用底部入口 */
@media (max-width: 768px) {
    .qr-float-btn {
        top: auto;
        bottom: 70px;
        right: 20px;
        transform: none;
        width: 48px;
        height: 48px;
    }

    .qr-float-btn:hover {
        transform: scale(1.1);
    }

    .qr-float-btn:active {
        transform: scale(0.95);
    }
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .lobby-actions {
        flex-direction: column;
    }
    
    .user-info .stats {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        font-size: 0.9rem;
    }
}
