/**
 * 公开私信提示条公共样式
 * 用于 client/index.html 和 zhuotai/7272.html
 */

/* 公开私信提示条样式 */
.public-mention-notice {
    position: fixed;
    top: 480px;
    left: 0;
    right: 0;
    transform: none;
    /* 外层仅负责定位与居中：不带背景，避免微信把它当成“整屏背景条” */
    background: transparent;
    color: white;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 10000;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    /* 外层点击穿透，避免挡住弹幕/输入；内部气泡恢复 pointer-events */
    pointer-events: none;
    cursor: default;
    transition: all 0.3s ease;
}

.public-mention-content {
    /* 真正的粉红气泡：按内容收缩 + 限制最大宽度 */
    background: linear-gradient(135deg, rgba(255, 102, 153, 0.95), rgba(238, 51, 119, 0.95));
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(255, 102, 153, 0.5),
                0 0 20px rgba(255, 102, 153, 0.3),
                inset 0 0 15px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    max-width: min(92vw, 520px);
    /* 关键：微信里用 inline-flex 比 fit-content 稳定 */
    display: inline-flex;
    flex-direction: column;
    /* 头部行需要占满气泡宽度来做“左右固定+标题居中”的布局 */
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    /* 内层可点击 */
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    animation: mentionGlow 2s ease-in-out infinite, mentionShake 0.5s ease-in-out;
}

.public-mention-content:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 102, 153, 0.6),
                0 0 30px rgba(255, 102, 153, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.public-mention-header-row {
    /* 倒计时靠左、标题居中、关闭 X 靠右（主站/桌台统一） */
    display: grid;
    grid-template-columns: 36px 1fr 24px;
    align-items: center;
    column-gap: 8px;
    width: 100%;
    min-width: 0;
}

.public-mention-header-text {
    font-size: 11px;
    font-weight: bold;
    color: #ffd700;
    opacity: 0.95;
    /* 中间列：真正居中，过长省略 */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.public-mention-countdown {
    font-size: 11px;
    font-weight: bold;
    color: #ffd700;
    white-space: nowrap;
    width: 36px; /* 固定宽度，避免数字变化影响布局 */
    text-align: center;
    font-variant-numeric: tabular-nums; /* 等宽数字 */
    font-family: 'Courier New', monospace; /* 等宽字体 */
}

.public-mention-text {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
    /* 不要用 flex:1 撑满，让整体宽度尽量由内容决定 */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.public-mention-sender {
    color: #00cc00;
    font-weight: 600;
}

.public-mention-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.8),
                 0 0 12px rgba(76, 175, 80, 0.6),
                 0 0 16px rgba(76, 175, 80, 0.4);
}

.public-mention-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@keyframes mentionGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 102, 153, 0.5),
                    0 0 30px rgba(255, 102, 153, 0.3),
                    inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 102, 153, 0.7),
                    0 0 40px rgba(255, 102, 153, 0.5),
                    inset 0 0 25px rgba(255, 255, 255, 0.3);
    }
}

@keyframes mentionShake {
    0%, 100% { transform: translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateY(-2px); }
    20%, 40%, 60%, 80% { transform: translateY(2px); }
}

/* 移动端公开私信提示条优化 */
@media (max-width: 480px) {
    .public-mention-notice {
        /* 外层不做居中/内边距覆盖，避免把气泡撑成整屏条 */
    }
    .public-mention-content {
        max-width: calc(100% - 2px);
        padding: 6px 6px;
    }
    .public-mention-countdown {
        font-size: 10px;
        width: 32px; /* 移动端固定宽度 */
    }
    .public-mention-header-text {
        font-size: 10px;
    }
    .public-mention-text {
        font-size: 11px;
    }
    .public-mention-close {
        width: 20px;
        height: 20px;
        font-size: 16px;
        font-weight: bold;
        text-shadow: 0 0 5px rgba(76, 175, 80, 0.8),
                     0 0 8px rgba(76, 175, 80, 0.6),
                     0 0 12px rgba(76, 175, 80, 0.4);
    }
}

/* 移动端公开私信提示条优化（中等屏幕） */
@media (max-width: 768px) {
    .public-mention-notice {
        /* 移动端更合理的位置：贴近底部输入区上方，避免遮挡内容/不随机型变化 */
        top: auto;
        bottom: calc(76px + env(safe-area-inset-bottom));
    }
    .public-mention-content {
        max-width: calc(100% - 10px);
        padding: 7px 10px;
    }
    .public-mention-countdown {
        width: 34px; /* 中等屏幕固定宽度 */
    }
    .public-mention-header-text {
        font-size: 10px;
    }
    .public-mention-close {
        width: 22px;
        height: 22px;
        font-size: 18px;
        font-weight: bold;
        text-shadow: 0 0 6px rgba(76, 175, 80, 0.8),
                     0 0 10px rgba(76, 175, 80, 0.6),
                     0 0 14px rgba(76, 175, 80, 0.4);
    }
}

