/* ==========================================================================
   xin-contact-tools — 客服侧边工具栏
   命名空间：.xct-slide-bar
   ========================================================================== */

.xct-slide-bar {
    position: fixed;
    width: var(--xct-bar-width, 70px);
    right: var(--xct-bar-offset-x, 10px);
    bottom: var(--xct-bar-bottom, 10%);
    z-index: 999;
    background-color: var(--xct-bar-bg, #1a1a1a);
    border-radius: var(--xct-bar-radius, 4px);
    box-shadow: var(--xct-bar-shadow, 0 2px 10px rgba(0, 0, 0, .3));
    overflow: visible;
}

.xct-slide-bar--left {
    right: auto;
    left: var(--xct-bar-offset-x, 10px);
}

/* ── 条目通用 ── */
.xct-item {
    position: relative;
    display: block;
    width: var(--xct-bar-width, 70px);
    height: var(--xct-bar-item-height, 70px);
    text-align: center;
    cursor: pointer;
    color: var(--xct-bar-text, #fff);
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, .1);
    line-height: 1.6;
    transition: background-color .2s;
}

.xct-item:first-child { border-top: none; border-radius: var(--xct-bar-radius, 4px) var(--xct-bar-radius, 4px) 0 0; }
.xct-item:last-child  { border-radius: 0 0 var(--xct-bar-radius, 4px) var(--xct-bar-radius, 4px); }

.xct-item:hover {
    background-color: var(--xct-bar-hover, #cc0000);
    color: var(--xct-bar-text, #fff);
    text-decoration: none;
}

/* hover 时滑出提示框 / 图片框 */
.xct-item:hover .xct-item__tips {
    visibility: visible;
    left: calc((var(--xct-bar-tips-width, 170px) + 10px) * -1);
    opacity: 1;
}
.xct-item:hover .xct-item__img {
    visibility: visible;
    left: -160px;
    opacity: 1;
}

.xct-slide-bar--left .xct-item:hover .xct-item__tips {
    right: calc((var(--xct-bar-tips-width, 170px) + 10px) * -1);
    left: auto;
}

.xct-slide-bar--left .xct-item:hover .xct-item__img {
    right: -160px;
    left: auto;
}

/* ── 图标 ── */
.xct-item__icon {
    display: block;
    width: var(--xct-bar-icon-size, 33px);
    height: auto;
    margin: 0 auto;
    padding-top: 10px;
}

.xct-item__icon.xct-icon-svg {
    height: var(--xct-bar-icon-size, 33px);
}

.xct-item__icon.xct-icon-svg svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── 文字标签 ── */
.xct-item__text {
    display: block;
    font-size: var(--xct-bar-text-size, 12px);
    line-height: 1.4;
    margin-top: 2px;
    color: var(--xct-bar-text, #fff);
}

/* ── 文字提示框 ── */
.xct-item__tips {
    position: absolute;
    top: 0;
    left: calc((var(--xct-bar-tips-width, 170px) + 40px) * -1);
    width: var(--xct-bar-tips-width, 170px);
    height: var(--xct-bar-item-height, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    color: #fff;
    background-color: var(--xct-bar-hover, #cc0000);
    border-radius: 3px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    transition: left .25s ease, right .25s ease, opacity .25s ease, visibility .25s;
    pointer-events: none;
}

.xct-slide-bar--left .xct-item__tips {
    right: calc((var(--xct-bar-tips-width, 170px) + 40px) * -1);
    left: auto;
}

.xct-item__tips::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--xct-bar-hover, #cc0000);
}

.xct-slide-bar--left .xct-item__tips::after {
    right: auto;
    left: -6px;
    border-right: 6px solid var(--xct-bar-hover, #cc0000);
    border-left: none;
}

.xct-item__tips p {
    margin: 0;
    padding: 0 10px;
    color: #fff;
    line-height: 1.4;
    font-size: 13px;
}

/* ── 图片弹出框 ── */
.xct-item__img {
    position: absolute;
    bottom: 0;
    left: -180px;
    width: 150px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    transition: left .25s ease, opacity .25s ease, visibility .25s;
    pointer-events: none;
}

.xct-slide-bar--left .xct-item__img {
    right: -180px;
    left: auto;
}

.xct-item__img::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 20px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ddd;
}

.xct-slide-bar--left .xct-item__img::after {
    right: auto;
    left: -7px;
    border-right: 6px solid #ddd;
    border-left: none;
}

.xct-item__img img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
}

/* ── 返回顶部 ── */
.xct-slide-bar .xct-scrollup {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.xct-slide-bar .xct-scrollup svg {
    display: block;
    margin: 0 auto;
    width: var(--xct-bar-icon-size, 28px);
    height: var(--xct-bar-icon-size, 28px);
    fill: none;
    stroke: var(--xct-bar-text, #fff);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xct-slide-bar .xct-scrollup .xct-item__icon {
    padding-top: 0;
}

.xct-slide-bar .xct-scrollup .xct-item__text {
    margin-top: 4px;
}

.xct-slide-bar .xct-scrollup .xct-item__tips { width: 100px; left: -130px; }
.xct-slide-bar .xct-scrollup:hover .xct-item__tips { left: -110px; }
.xct-slide-bar--left .xct-scrollup .xct-item__tips { right: -130px; left: auto; }
.xct-slide-bar--left .xct-scrollup:hover .xct-item__tips { right: -110px; left: auto; }

/* ── 弹窗表单容器 ── */
.xct-fancybox-form { padding: 20px 30px; min-width: 320px; }
.xct-fancybox-form h3 { margin: 0 0 15px; font-size: 18px; }

html.xct-modal-open { overflow: hidden; }

.xct-modal-fallback {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.xct-modal-fallback__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
}

.xct-modal-fallback__box {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    color: #222;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.xct-modal-fallback__close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 28px;
    line-height: 34px;
    cursor: pointer;
}

.xct-modal-fallback__content .xct-fancybox-form {
    min-width: 0;
    padding: 30px;
}

.xct-modal-fallback__content .xct-fancybox-form h3 {
    padding-right: 36px;
}

/* ── 移动端隐藏 ── */
@media screen and (max-width: 767px) {
    .xct-slide-bar { display: var(--xct-bar-mobile-display, none); }
    .xct-modal-fallback { padding: 14px; }
    .xct-modal-fallback__box { max-height: calc(100vh - 28px); }
    .xct-modal-fallback__content .xct-fancybox-form { padding: 24px 18px; }
}
