/* 覆盖 header 全局 * { max-width:100% } 对弹窗的破坏 */
.hcn-float-sidebar,
.hcn-float-sidebar * {
    box-sizing: border-box;
    max-width: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.hcn-float-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    pointer-events: auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hcn-float-bar {
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8e8e8;
    border-right: none;
    border-radius: 6px 0 0 6px;
    overflow: visible;
}

.hcn-float-item {
    position: relative;
    width: 56px;
    border-bottom: 1px solid #f0f0f0;
    overflow: visible;
}

.hcn-float-item:last-child {
    border-bottom: none;
}

.hcn-float-item:first-child .hcn-float-trigger {
    border-radius: 6px 0 0 0;
}

.hcn-float-item:last-child .hcn-float-trigger {
    border-radius: 0 0 0 6px;
}

.hcn-float-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 62px;
    padding: 8px 4px;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #444;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}

.hcn-float-trigger:hover,
.hcn-float-item.is-active .hcn-float-trigger {
    background: #1a3a6b;
    color: #fff;
}

.hcn-float-trigger svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.hcn-float-trigger span {
    font-size: 10px;
    line-height: 1.3;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
}

/* 弹窗面板 */
.hcn-float-panel {
    position: absolute;
    right: 56px;
    top: 0;
    width: 290px !important;
    min-width: 290px !important;
    background: #fff;
    border: 1px solid #dde3ea;
    border-right: none;
    border-radius: 8px 0 0 8px;
    box-shadow: -6px 4px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* 面板与按钮之间的 hover 桥接区，防止鼠标移过去时弹窗消失 */
.hcn-float-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: -12px;
    width: 12px;
    height: 100%;
}

.hcn-float-item:hover .hcn-float-panel,
.hcn-float-item.is-active .hcn-float-panel,
.hcn-float-item.is-open .hcn-float-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.hcn-float-item.is-active .hcn-float-trigger,
.hcn-float-item.is-open .hcn-float-trigger {
    background: #1a3a6b;
    color: #fff;
}

.hcn-float-panel__section {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f2f5;
}

.hcn-float-panel__section:last-of-type {
    border-bottom: none;
}

.hcn-float-panel__title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a6b;
    margin: 0 0 12px;
    white-space: nowrap;
}

.hcn-float-panel__title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #ffc107;
    border-radius: 2px;
    flex-shrink: 0;
}

.hcn-float-panel__btn {
    display: block;
    width: 100% !important;
    padding: 11px 16px;
    background: linear-gradient(135deg, #1a3a6b 0%, #254a85 100%);
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.5px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(26, 58, 107, 0.25);
}

.hcn-float-panel__btn:hover {
    background: linear-gradient(135deg, #254a85 0%, #2d5a9e 100%);
    box-shadow: 0 4px 12px rgba(26, 58, 107, 0.35);
}

.hcn-float-panel__phone {
    display: block;
    width: 100% !important;
    padding: 11px 16px;
    background: #1a3a6b;
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.hcn-float-panel__phone:hover {
    background: #254a85;
}

.hcn-float-panel__qr {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hcn-float-panel__qr img {
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 3px;
    background: #fff;
}

.hcn-float-panel__qr-text {
    font-size: 12px;
    line-height: 1.8;
    color: #666;
    margin: 0;
    white-space: normal;
}

.hcn-float-panel__hours {
    padding: 12px 18px;
    background: linear-gradient(180deg, #f8f9fb 0%, #f2f4f7 100%);
    font-size: 11px;
    line-height: 1.8;
    color: #999;
    text-align: center;
    border-top: 1px solid #eef0f3;
}

.hcn-float-panel--mini {
    width: 220px !important;
    min-width: 220px !important;
    top: auto;
    bottom: 0;
}

@media (max-width: 768px) {
    .hcn-float-sidebar {
        top: auto;
        bottom: 80px;
        transform: none;
    }

    .hcn-float-item {
        width: 46px;
    }

    .hcn-float-trigger {
        width: 46px;
        height: 50px;
    }

    .hcn-float-trigger span {
        display: none;
    }

    .hcn-float-panel {
        right: 46px;
        width: 260px !important;
        min-width: 260px !important;
    }
}
