/* 全站实时聊天室组件样式（chat.js 配套，暗色+粉紫渐变与站点风格一致） */
.live-chat {
    background: var(--bg-card, #15151f);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.live-chat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.live-chat-title { font-size: 17px; font-weight: 700; color: var(--text, #fff); }
.live-chat-online { font-size: 12px; color: #22c55e; }
.live-chat-online b { color: #4ade80; }
.live-chat-wallet { font-size: 12px; color: var(--text-muted, #999); display: flex; align-items: center; gap: 5px; }
.live-chat-wallet b { color: #fbbf24; font-size: 14px; }
.live-chat-recharge-btn {
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    cursor: pointer;
}
.live-chat-recharge-btn:hover { opacity: .88; }

/* 消息流 */
.live-chat-list {
    height: 380px;
    overflow-y: auto;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.live-chat-list::-webkit-scrollbar { width: 5px; }
.live-chat-list::-webkit-scrollbar-thumb { background: rgba(168,85,247,.4); border-radius: 4px; }
.live-chat-empty { text-align: center; color: var(--text-muted, #777); padding: 40px 0; font-size: 13px; }

/* 消息气泡 */
.live-chat-item { display: flex; gap: 10px; align-items: flex-start; }
.live-chat-item.mine { flex-direction: row-reverse; }
.live-chat-item.mine .live-chat-bubble {
    background: linear-gradient(135deg, rgba(168,85,247,.25), rgba(236,72,153,.25));
    border-color: rgba(168,85,247,.45);
}
.live-chat-item.mine .live-chat-meta { flex-direction: row-reverse; }
.live-chat-avatar {
    flex: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.live-chat-bubble {
    max-width: 78%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 8px 12px;
}
.live-chat-meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 11px;
    color: var(--text-muted, #888);
    margin-bottom: 3px;
    flex-wrap: wrap;
}
.live-chat-noble {
    font-size: 10px;
    font-weight: 700;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 0 4px;
    line-height: 16px;
}
.live-chat-user { color: #c084fc; font-weight: 600; }
.live-chat-text { font-size: 14px; color: var(--text, #eee); line-height: 1.55; word-break: break-word; white-space: pre-wrap; }

/* 礼物卡片 */
.live-chat-gift-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: linear-gradient(135deg, rgba(251,191,36,.08), rgba(236,72,153,.10));
    border: 1px solid rgba(251,191,36,.35);
    border-radius: 12px;
    padding: 10px 14px;
    width: 88%;
}
.live-chat-gift-card .gift-icon { font-size: 26px; }
.live-chat-gift-card .gift-info { font-size: 12px; color: var(--text, #eee); }
.live-chat-gift-card .gift-info b { color: #fbbf24; }
.live-chat-gift-card .gift-points { color: var(--text-muted, #888); font-size: 11px; display: block; margin-top: 2px; }

/* 红包卡片 */
.live-chat-rp-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: linear-gradient(135deg, #dc2626, #f97316);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 12px;
    padding: 10px 14px;
    width: 70%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(220,38,38,.35);
    transition: transform .15s;
}
.live-chat-rp-card:hover { transform: translateY(-2px); }
.live-chat-rp-card .rp-icon { font-size: 26px; }
.live-chat-rp-card .rp-info { font-size: 12px; color: #fff; }
.live-chat-rp-card .rp-info b { color: #fde68a; }
.live-chat-rp-card .rp-sub { color: rgba(255,255,255,.85); font-size: 11px; display: block; margin-top: 2px; }
.live-chat-rp-card.grabbed { filter: saturate(.4) brightness(.8); cursor: default; }

/* 系统播报 */
.live-chat-system {
    align-self: center;
    text-align: center;
    font-size: 11px;
    color: #fbbf24;
    background: rgba(251,191,36,.08);
    border: 1px dashed rgba(251,191,36,.4);
    border-radius: 20px;
    padding: 3px 14px;
    max-width: 92%;
}

/* 输入区 */
.live-chat-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
    margin-top: 12px;
}
.live-chat-tool-btn {
    flex: none;
    width: 40px; height: 40px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    font-size: 18px;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}
.live-chat-tool-btn:hover { transform: translateY(-2px); border-color: rgba(168,85,247,.6); }
.live-chat-input {
    flex: 1;
    resize: none;
    background: rgba(0,0,0,.3);
    border: 1px solid var(--border, rgba(255,255,255,.12));
    border-radius: 10px;
    color: var(--text, #eee);
    font-size: 14px;
    font-family: inherit;
    padding: 10px 12px;
    line-height: 1.4;
    min-height: 40px;
    max-height: 100px;
    outline: none;
}
.live-chat-input:focus { border-color: rgba(168,85,247,.6); }
.live-chat-send {
    flex: none;
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
}
.live-chat-send:hover { opacity: .88; }
.live-chat-send:disabled { opacity: .5; cursor: not-allowed; }

/* 提示条 */
.live-chat-tip {
    height: 0;
    overflow: hidden;
    font-size: 12px;
    color: #22c55e;
    transition: height .2s;
    margin-top: 0;
}
.live-chat-tip.show { height: 22px; margin-top: 8px; }
.live-chat-tip.error { color: #ef4444; }

/* ============ 礼物特效 ============ */
/* 普通飘屏：图标从聊天区底部横向飘过 */
.live-gift-float {
    position: absolute;
    bottom: 70px;
    right: -60px;
    font-size: 22px;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251,191,36,.8);
    animation: giftFloat 4s linear forwards;
    pointer-events: none;
    z-index: 5;
}
@keyframes giftFloat {
    from { transform: translateX(0); opacity: 1; }
    80%  { opacity: 1; }
    to   { transform: translateX(-560px); opacity: 0; }
}
/* 全屏礼花 */
.live-gift-burst {
    position: absolute; /* 覆盖聊天面板（.live-chat position:relative + overflow:hidden 裁剪，特效只在消息框内） */
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(168,85,247,.18), transparent 60%);
    animation: burstFade 4.5s ease forwards;
}
.live-gift-burst .burst-title {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 16px rgba(251,191,36,.9);
    animation: burstTitle 4.5s ease forwards;
}
.live-gift-burst span {
    position: absolute;
    top: -40px;
    font-size: 26px;
    animation: burstFall 3.6s ease-in forwards;
}
@keyframes burstFade { from { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { opacity: 0; } }
@keyframes burstTitle { from { transform: translateX(-50%) scale(.6); opacity: 0; } 20% { transform: translateX(-50%) scale(1.15); opacity: 1; } 80% { opacity: 1; } to { opacity: 0; } }
@keyframes burstFall { from { top: -40px; opacity: 0; } 20% { opacity: 1; } to { top: 105%; opacity: .4; } }

/* 图片图标（礼物图标支持图片地址时的各处尺寸） */
.gift-icon-img { width: 26px; height: 26px; object-fit: contain; vertical-align: -6px; border-radius: 4px; }
.gift-cell-icon .gift-icon-img { width: 24px; height: 24px; }
.float-icon-img { width: 1em; height: 1em; object-fit: contain; vertical-align: -0.12em; border-radius: 4px; }
.burst-icon-img { width: 1em; height: 1em; object-fit: contain; border-radius: 6px; }
.burst-title-img { width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: -0.2em; border-radius: 6px; }

/* 礼物特效素材（后台配置的特效链接：图片/GIF/视频 mp4/webm 通用） */
.float-asset-img, .float-asset-img.video { width: 3.2em; height: 3.2em; object-fit: contain; vertical-align: -0.9em; border-radius: 8px; filter: drop-shadow(0 0 12px rgba(251,191,36,.75)); }
.burst-asset {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 62%;
    max-height: 58%;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 0 26px rgba(168,85,247,.65));
    animation: burstAsset 4.5s ease forwards;
    pointer-events: none;
}
video.burst-asset { background: transparent; }
@keyframes burstAsset {
    from { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
    18%  { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(1); }
    82%  { opacity: 1; }
    to   { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}

/* 高级特效：震屏（等级≥8） */
.gift-shake { animation: giftShake .5s ease-in-out 2; }
@keyframes giftShake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-6px, 3px); }
    40% { transform: translate(5px, -4px); }
    60% { transform: translate(-4px, -3px); }
    80% { transform: translate(4px, 4px); }
}

/* 高级特效：彩虹粒子（等级≥9，图标循环变色） */
.live-gift-burst.rainbow span { animation: burstFall 3.6s ease-in forwards, rainbowHue 1.2s linear infinite; }
@keyframes rainbowHue {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* 高级特效：王者风暴（等级≥11，金色光柱背景加强） */
.live-gift-burst.royal {
    background:
        linear-gradient(90deg, transparent, rgba(251,191,36,.28), transparent) 0 0 / 100% 100%,
        radial-gradient(circle at 50% 60%, rgba(168,85,247,.25), transparent 60%);
}
.live-gift-burst.royal .burst-title {
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 14px rgba(251,191,36,.9));
}
.live-gift-burst.royal span { animation-duration: 4.4s; }

/* ============ 弹窗 ============ */
.chat-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.chat-modal {
    width: 100%;
    max-width: 420px;
    max-height: 82vh;
    overflow-y: auto;
    background: #17171f;
    border: 1px solid rgba(168,85,247,.35);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.chat-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.chat-modal-close { background: none; border: none; color: #888; font-size: 16px; cursor: pointer; }
.chat-modal-close:hover { color: #fff; }
.chat-modal-body { padding: 16px; }

/* 礼物网格 */
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.gift-cell {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.gift-cell:hover { border-color: rgba(168,85,247,.7); transform: translateY(-2px); }
.gift-cell-icon { font-size: 24px; }
.gift-cell-name { font-size: 11px; color: #ddd; }
.gift-cell-price { font-size: 10px; color: #fbbf24; }

/* 图片库九宫格（发图片面板，紧凑小图） */
.image-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.image-cell {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: rgba(0,0,0,.25);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.image-cell img { display: block; width: 100%; height: 48px; object-fit: cover; }
.image-cell:hover { border-color: rgba(168,85,247,.7); transform: translateY(-2px); }

/* 聊天消息流中的图片 */
.live-chat-img {
    display: block;
    max-width: 170px;
    max-height: 170px;
    border-radius: 10px;
    cursor: zoom-in;
    margin-top: 4px;
}

/* 面板通用行 */
.panel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: #ccc; }
.panel-row input, .panel-row select {
    flex: 1;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    color: #eee;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    min-width: 0;
}
.panel-row input:focus { border-color: rgba(168,85,247,.6); }
.panel-tip { font-size: 11px; color: #888; line-height: 1.7; margin-bottom: 12px; }
.panel-preview { font-size: 13px; color: #fbbf24; margin-bottom: 12px; }
.btn-primary-block {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary-block:hover { opacity: .9; }

/* 抢红包结果/明细 */
.grab-result { text-align: center; padding: 18px 0; }
.grab-amount {
    font-size: 42px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251,191,36,.6);
}
.grab-label { font-size: 13px; color: #ccc; margin-top: 6px; }
.grab-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.grab-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #ccc;
    background: rgba(255,255,255,.04);
    border-radius: 8px;
    padding: 7px 10px;
}
.grab-row.best { border: 1px solid rgba(251,191,36,.5); background: rgba(251,191,36,.08); }
.grab-row .grab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grab-row .grab-points { color: #22c55e; flex: none; }
.grab-row.best .grab-points { color: #fbbf24; }

/* H5 移动端适配 */
@media (max-width: 768px) {
    .live-chat { padding: 12px; border-radius: 14px; }
    .live-chat-list { height: 320px; }
    .live-chat-bubble { max-width: 82%; }
    .live-chat-send { padding: 10px 16px; }
    .live-chat-tool-btn { width: 36px; height: 36px; font-size: 16px; }
    .live-chat-gift-card { width: 100%; }
    .live-chat-rp-card { width: 92%; }
    .gift-grid { grid-template-columns: repeat(3, 1fr); }
    .image-grid { grid-template-columns: repeat(3, 1fr); }
    .image-cell img { height: 42px; }
    .live-chat-img { max-width: 130px; max-height: 130px; }
    .live-gift-burst .burst-title { font-size: 20px; }
    .chat-modal { max-width: 100%; }
}
