/* ============== 全局 ============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

/* ============== 主容器 ============== */
.live-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}

/* ============== 顶部状态栏 ============== */
.top-bar {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 100;
    gap: 16px;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ff3b3b;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.connection-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.connection-status.connected {
    color: #4caf50;
}

.room-title {
    margin-left: auto;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* ============== 主舞台 ============== */
.stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.digital-human {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at center, rgba(255, 105, 180, 0.1) 0%, transparent 60%);
}

.digital-human canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.product-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.product-tag {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============== 弹幕层 ============== */
.danmaku-layer {
    position: absolute;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 120px;
    pointer-events: none;
    overflow: hidden;
    z-index: 50;
}

.danmaku-item {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    max-width: 400px;
    animation: slideInLeft 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.danmaku-item .nickname {
    color: #4fc3f7;
    font-weight: 600;
    margin-right: 6px;
}

.danmaku-item .content {
    color: rgba(255, 255, 255, 0.95);
}

.danmaku-item.ai-reply {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.5);
}

.danmaku-item.ai-reply .nickname {
    color: #66bb6a;
}

.danmaku-item.ai-reply::before {
    content: "🤖";
    margin-right: 4px;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============== 底部商品栏 ============== */
.bottom-bar {
    height: 100px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-symbol {
    font-size: 16px;
    color: #ff5252;
}

.price-num {
    font-size: 28px;
    font-weight: 700;
    color: #ff5252;
}

.price-tag {
    margin-left: 8px;
    background: #ff5252;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.buy-btn {
    background: linear-gradient(135deg, #ff5252, #ff1744);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 23, 68, 0.4);
    transition: transform 0.2s;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 23, 68, 0.5);
}

.buy-btn:active {
    transform: translateY(0);
}

/* ============== 控制面板（开发用） ============== */
.control-panel {
    position: fixed;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}

.control-panel button {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.control-panel button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ============== 直播伴侣友好：1080x1920 竖屏 ============== */
@media (aspect-ratio: 9/16) {
    .top-bar { height: 64px; }
    .bottom-bar { height: 120px; }
    .danmaku-layer { top: 90px; bottom: 140px; }
}

/* 隐藏滚动条 */
::-webkit-scrollbar { display: none; }
