/* 在线客服浮动挂件 */
.service-bar {
    position: fixed;
    bottom: 120px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: inherit;
}
.service-side-right { right: 0; align-items: flex-end; }
.service-side-left  { left: 0;  align-items: flex-start; }

.service-item { position: relative; }

.service-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--svc-bg, #27a8e1);
    color: var(--svc-fc, #fff);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    transition: background .2s, filter .2s;
}
.service-btn:hover { filter: brightness(.93); text-decoration: none; color: var(--svc-fc, #fff); }
.service-btn i { font-size: 22px; margin-bottom: 2px; color: var(--svc-ic, var(--svc-fc)); }
.service-btn span { word-break: break-all; max-width: 56px; }

.service-top { margin-top: 6px; }

/* 弹出面板 */
.service-panel {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    max-width: 80vw;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
    padding: 14px;
    color: #333;
    text-align: left;
    z-index: 10000;
}
.service-side-right .service-panel { right: 70px; }
.service-side-left  .service-panel { left: 70px; }

.service-item.open .service-panel { display: block; }

.service-close {
    position: absolute;
    top: 4px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}
.service-close:hover { color: #333; }

.service-text { font-size: 13px; line-height: 1.7; color: #333; padding-right: 16px; }
.service-media img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.service-empty { color: #999; }

/* 嵌入式模板外层：与全局样式共用，同时做隔离约束，避免撑破挂件布局 */
.service-embed {
    max-height: 70vh;
    overflow: auto;
    font-size: 14px;
    color: #333;
    padding-right: 16px;
}
.service-embed img { max-width: 100%; height: auto; }
.service-embed a { color: var(--svc-bg, #27a8e1); }
.service-embed * { box-sizing: border-box; }

/* 移动端 */
@media (max-width: 575.98px) {
    .service-bar { bottom: 80px; }
    .service-btn { width: 50px; height: 50px; font-size: 11px; }
    .service-btn i { font-size: 18px; }
    .service-panel { width: 220px; }
    .service-side-right .service-panel { right: 56px; }
    .service-side-left  .service-panel { left: 56px; }
}
