/* =========================================================
   右侧悬浮客服栏（PC / 移动端自适应）
   与前端主题解耦：默认取 --brand，蓝色主题自动取 --tb-primary
   ========================================================= */
.svc-float {
    --svc-brand: var(--tb-primary, var(--brand, #1e40af));
    --svc-brand-dark: var(--tb-primary-dark, #1e3a8a);
    --svc-line: var(--tb-card-border, #e2e8f0);
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1035;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.svc-cell { position: relative; width: 54px; height: 54px; }

.svc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 1px solid var(--svc-line);
    border-radius: 12px;
    background: #fff;
    color: var(--svc-brand);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.svc-btn i { font-size: 19px; line-height: 1; }
.svc-cap {
    font-size: 10px;
    line-height: 1;
    letter-spacing: .5px;
    color: #64748b;
    transition: color .2s ease;
}
.svc-btn:hover,
.svc-btn:focus-visible,
.svc-cell.is-open .svc-btn {
    background: var(--svc-brand);
    border-color: var(--svc-brand);
    color: #fff;
    transform: translateX(-3px);
    box-shadow: 0 10px 24px rgba(22, 87, 204, .32);
    outline: none;
}
.svc-btn:hover .svc-cap,
.svc-btn:focus-visible .svc-cap,
.svc-cell.is-open .svc-btn .svc-cap { color: rgba(255, 255, 255, .92); }

/* ---------- 客服面板 ---------- */
.svc-panel {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    width: 272px;
    background: #fff;
    border: 1px solid var(--svc-line);
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
    overflow: hidden;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.svc-cell.is-open .svc-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}
.svc-panel-head {
    padding: 14px 16px 13px;
    background: linear-gradient(135deg, var(--svc-brand-dark) 0%, var(--svc-brand) 100%);
    color: #fff;
}
.svc-panel-head strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
}
.svc-panel-head span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .82);
}
.svc-panel-body { padding: 8px; }

.svc-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 9px;
    text-decoration: none;
    transition: background .18s ease;
}
.svc-line:hover { background: rgba(30, 64, 175, .07); }
.svc-line > i {
    flex: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(22, 87, 204, .1);
    color: var(--svc-brand);
    font-size: 15px;
}
.svc-line > span { min-width: 0; display: block; }
.svc-line em {
    display: block;
    font-style: normal;
    font-size: 11px;
    line-height: 1.4;
    color: #7a869c;
}
.svc-line b {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #1e293b;
    word-break: break-all;
}
.svc-panel-foot { padding: 4px 12px 14px; }
.svc-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--svc-brand);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: background .2s ease;
}
.svc-cta:hover { background: var(--svc-brand-dark); color: #fff; }

/* ---------- 微信二维码浮层 ---------- */
.svc-qr-pop {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    width: 168px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--svc-line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.svc-wechat:hover .svc-qr-pop,
.svc-wechat:focus-within .svc-qr-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}
.svc-qr-pop img {
    display: block;
    width: 132px;
    height: 132px;
    margin: 0 auto 8px;
    border-radius: 6px;
    background: #f5f7fb;
    object-fit: contain;
}
.svc-qr-pop span { font-size: 12px; color: #64748b; }
.svc-qr-pop em {
    display: block;
    margin-top: 6px;
    font-style: normal;
    font-size: 12px;
    color: #1e293b;
    word-break: break-all;
}
.svc-copy {
    width: 100%;
    margin-top: 8px;
    padding: 6px 0;
    border: 1px solid var(--svc-line);
    border-radius: 7px;
    background: #f7f9fc;
    color: var(--svc-brand);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.svc-copy:hover { background: var(--svc-brand); border-color: var(--svc-brand); color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
    .svc-float { right: 10px; }
}
@media (max-width: 767.98px) {
    .svc-float { top: auto; bottom: 122px; right: 10px; transform: none; gap: 6px; }
    .svc-cell, .svc-btn { width: 46px; height: 46px; }
    .svc-btn { border-radius: 10px; }
    .svc-btn i { font-size: 17px; }
    .svc-cap { font-size: 9px; }
    .svc-panel { width: 236px; right: calc(100% + 8px); }
    .svc-panel-head { padding: 12px 14px 11px; }
    .svc-qr-pop { right: calc(100% + 8px); width: 156px; }
    .svc-qr-pop img { width: 120px; height: 120px; }
}
@media print {
    .svc-float { display: none !important; }
}
