/* =================================================================
   Online Chat Widget — Frontend Styles
   响应式策略：纯 CSS media query，无 PHP UA 嗅探
   ================================================================= */

/* ── PC 浮动按钮 ───────────────────────────────────────────────── */
.ocw-pc-btn {
    position: fixed;
    right: 24px;
    /* bottom 由 PHP 内联样式注入 */
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    min-width: 60px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    /* background-color / color 由 PHP 内联样式注入 */
}

.ocw-pc-btn:hover,
.ocw-pc-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.ocw-pc-btn-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.ocw-pc-btn-icon-emoji {
    font-size: 24px;
    line-height: 1;
}

.ocw-pc-btn-label {
    font-size: 12px;
    white-space: nowrap;
}

/* ── 遮罩层 ────────────────────────────────────────────────────── */
.ocw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9991;
}

.ocw-overlay.ocw-visible {
    display: block;
}

/* ── 弹窗对话框 ─────────────────────────────────────────────────── */
.ocw-popup {
    display: none;
    position: fixed;
    right: 24px;
    /* bottom 由 PHP 内联样式注入（按钮bottom + 按钮高度） */
    width: 300px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    z-index: 9992;
    padding: 28px 22px 20px;
    animation: ocwSlideUp 0.25s ease forwards;
}

.ocw-popup[aria-hidden="false"] {
    display: block;
}

@keyframes ocwSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ocw-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 17px;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.ocw-popup-close:hover,
.ocw-popup-close:focus {
    background: #f2f2f2;
    color: #333;
    outline: none;
}

.ocw-popup-content {
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.ocw-popup-content p:first-child {
    margin-top: 0;
}

.ocw-popup-content p:last-child {
    margin-bottom: 0;
}

.ocw-popup-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    background: #0073aa;
    color: #ffffff !important;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.ocw-popup-cta:hover,
.ocw-popup-cta:focus {
    background: #005f8a;
    outline: none;
}

/* ── 移动端底部按钮条 ───────────────────────────────────────────── */
.ocw-mobile-bar {
    display: none;   /* 默认隐藏，仅在移动端媒体查询下显示 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    /* background-color / color 由 PHP 内联样式注入 */
    -webkit-tap-highlight-color: transparent;
}

.ocw-mobile-bar:active {
    opacity: 0.85;
}

.ocw-mobile-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.ocw-mobile-icon-emoji {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.ocw-mobile-label {
    white-space: nowrap;
}

/* ── 响应式：移动端显示底部栏，隐藏 PC 按钮和弹窗 ────────────────── */
@media (max-width: 768px) {
    .ocw-pc-btn  { display: none !important; }
    .ocw-popup   { display: none !important; }
    .ocw-overlay { display: none !important; }
    .ocw-mobile-bar { display: flex; }
}

/* ── 响应式：PC 端隐藏移动端底部栏 ──────────────────────────────── */
@media (min-width: 769px) {
    .ocw-mobile-bar { display: none !important; }
}
