/* =====================================================
   侧边栏：抽屉式精致设计（红色主题，不死板）
   ===================================================== */
.ws-side-bar {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: row;
    align-items: center;
    /* 关键点：外层必须 overflow: visible，否则悬浮卡片被裁剪导致左下角错位 */
    overflow: visible;
    transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease;
}

/* ===== 侧边栏主体卡片 ===== */
.ws-side-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    /* 多层柔和阴影，更有质感 */
    box-shadow:
        0 12px 36px rgba(175, 9, 14, 0.14),
        0 4px 12px rgba(175, 9, 14, 0.08),
        0 0 0 1px rgba(175, 9, 14, 0.05);
    overflow: visible; /* 关键：不能 hidden，否则内部绝对定位卡片被截（左下角） */
    padding: 8px 6px;
    width: 86px; /* 明确宽度：item 74px + 左右 padding 各 6px，这样折叠时 width:0 才有过渡动画 */
    flex: 0 0 auto;
    /* 红色内发光点缀 */
    background-image:
        radial-gradient(120% 60% at 50% -10%, rgba(246,75,68,0.06), transparent 70%);
    transform-origin: right center;
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        padding 0.35s ease,
        box-shadow 0.35s ease,
        width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 单个按钮：豆包风格 · 黑白灰为主 + 少量品牌红点缀 ===== */
.ws-side-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 76px;            /* 略宽一点，更接近豆包的留白感 */
    padding: 16px 8px 14px;
    border-radius: 14px;
    color: #1f2937;         /* 深灰（近黑）：黑白灰主调，不红不蓝 */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: visible;
}

.ws-side-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    width: 100%;
    cursor: pointer;
}

/* hover：品牌红点缀（文字变红），背景极淡红，不上高饱和 */
.ws-side-item:hover {
    color: #af090e;
    background: rgba(175,9,14,0.04);
    transform: translateY(-1px);
}

/* 分隔线：极淡浅灰，符合黑白灰 */
.ws-side-divider {
    height: 1px;
    margin: 2px 14px;
    background: linear-gradient(90deg,
        transparent, rgba(15,23,42,0.06), transparent);
}

/* 图标：豆包同款——圆角方形淡灰底，尺寸大方 */
.ws-side-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 16px;      /* 大圆角，和豆包一致 */
    background: #f1f3f6;      /* 统一淡灰底，不做蓝绿区分 */
    transition: all 0.3s ease;
}

/* hover 图标框：淡红底 + 红色图标，品牌红的核心点缀 */
.ws-side-item:hover .ws-side-icon {
    transform: scale(1.05);
    background: rgba(175,9,14,0.08);
    box-shadow: 0 4px 10px rgba(175,9,14,0.10);
}

.ws-side-icon svg {
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

/* 电话/微信图标默认：语义色（低饱和），不抢主视觉 */
.ws-side-phone .ws-side-icon {
    color: #5b7bc9;
}
.ws-side-wechat .ws-side-icon {
    color: #2f9e61;
}

/* hover 时图标统一变红：品牌红的少量点缀 */
.ws-side-phone.ws-side-item:hover .ws-side-icon,
.ws-side-wechat.ws-side-item:hover .ws-side-icon {
    color: #af090e;
}

.ws-side-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* ===== 收起/展开：抽屉把手（在主体左侧，靠近页面中心） ===== */
.ws-side-handle {
    flex-shrink: 0;
    width: 18px;
    height: 46px;
    /* 把手在左，主体在右 → margin-right:-1px 让两者右边缘无缝贴合 */
    margin-right: -1px;
    background: #ffffff;
    color: #af090e;
    /* 左半圆（自由侧） + 右直角（贴主体侧） */
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* 阴影投向左侧（页面中心方向），不遮挡主体 */
    box-shadow:
        -4px 0 14px rgba(175,9,14,0.10),
        0 0 0 1px rgba(175,9,14,0.04) inset;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
}

.ws-side-handle:hover {
    width: 22px;
    /* 渐变：右侧（贴主体）深 → 左侧浅，更像从主体伸出来 */
    background: linear-gradient(90deg, #f64b44, #af090e);
    color: #ffffff;
    box-shadow:
        -6px 0 20px rgba(175,9,14,0.28);
}

.ws-handle-arrow {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 收起状态 ===== */
.ws-side-bar.collapsed {
    right: 0; /* 折叠后竖条直接贴紧屏幕右边缘 */
}

.ws-side-bar.collapsed .ws-side-content {
    /* 视觉滑出 + 真正收缩宽度为0，避免 flex 占位让竖条无法贴边 */
    transform: translateX(100%);
    width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
    overflow: hidden;
}

.ws-side-bar.collapsed .ws-handle-arrow {
    transform: rotate(180deg);
}

.ws-side-bar.collapsed .ws-side-handle {
    /* 竖条样式：窄宽 + 高个，紧贴右边缘，左边圆角、右边直角 */
    margin-right: 0;
    border-radius: 8px 0 0 8px;
    width: 12px;
    height: 96px;
    background: linear-gradient(135deg, #af090e, #f64b44);
    color: #ffffff;
    box-shadow:
        -4px 0 18px rgba(175,9,14,0.30),
        0 0 0 1px rgba(175,9,14,0.08) inset;
}

.ws-side-bar.collapsed .ws-side-handle:hover {
    width: 16px;
    background: linear-gradient(135deg, #8e070b, #e23a33);
    box-shadow:
        -6px 0 26px rgba(175,9,14,0.42);
    transform: none;
}

/* =====================================================
   悬浮提示卡片（统一组件：Tip Card）
   修复：定位正确，不被裁剪，不跑到左下角
   ===================================================== */
.ws-tip-card {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    transform: translateY(-50%) translateX(8px);
    min-width: 210px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.28s;
    z-index: 10000;
    /* 精致多层阴影 */
    box-shadow:
        0 16px 48px rgba(15, 23, 42, 0.14),
        0 4px 14px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(175,9,14,0.06);
}

/* 右侧小三角：指向按钮 */
.ws-tip-arrow {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.98);
    box-shadow:
        2px -2px 3px rgba(15,23,42,0.04),
        1px -1px 0 0 rgba(175,9,14,0.05);
}

/* 悬停显示：通过 .ws-side-content 上的 show-phone / show-wechat 类控制
   卡片永远固定在侧边栏垂直中心位置（top:50% 相对 side-content） */
.ws-side-content.show-phone .ws-phone-card,
.ws-side-content.show-wechat .ws-wechat-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
    /* 显示时延迟 180ms，避免展开动画/鼠标快速扫过误触发 */
    transition-delay: 180ms;
}

/* 切换动画期间：主体禁止响应任何鼠标事件，防"扫过鼠标"导致闪烁 */
.ws-side-content.ws-animating {
    pointer-events: none;
}

/* 卡片内通用元素：豆包风格 · 黑白灰主调 */
.ws-tip-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;      /* 中深灰（不再红） */
    margin-bottom: 8px;
    letter-spacing: 0.4px;
}

.ws-tip-hint {
    font-size: 11.5px;
    color: #9ca3af;
    margin-top: 8px;
    line-height: 1.4;
}

/* 图标徽章：和侧边栏一致——淡灰底 + 语义色图标（卡片内不需要 hover 变化） */
.ws-tip-phone-icon,
.ws-tip-wechat-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f6;    /* 统一淡灰底 */
    transition: all 0.3s ease;
}

.ws-tip-phone-icon {
    color: #5b7bc9;
}
.ws-tip-wechat-icon {
    color: #2f9e61;
}

/* 电话号码：品牌红唯一主点缀——这里是红色用的最多的地方 */
.ws-tip-phone-num {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.2px;
    padding: 4px 0;
    cursor: pointer;
    /* 保证一行显示不换行 */
    white-space: nowrap;
    /* 品牌红渐变——视觉核心点缀 */
    background: linear-gradient(135deg, #9e1a1e, #c93b40);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ws-tip-phone-num:hover {
    transform: translateY(-1px);
    /* hover 时稍微提亮一点渐变 */
    filter: brightness(1.08);
}

/* 微信二维码卡片 */
.ws-tip-qrbox {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    padding: 6px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(175,9,14,0.08);
    box-shadow: 0 2px 10px rgba(15,23,42,0.05);
}

.ws-tip-qr {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.ws-tip-qr:hover {
    transform: scale(1.02);
}

/* =====================================================
   手机端底部三按钮栏：豆包风格 · 黑白灰 + 少量品牌红点缀
   ===================================================== */
.ws-mobile-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    /* 白底 + 毛玻璃，和PC侧主体容器风格一致 */
    background: rgba(255,255,255,0.96);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.06), 0 -1px 0 rgba(15,23,42,0.05);
    gap: 8px;
}

/* 单个按钮：透明底 + 深灰文字，不整版跳红 */
.ws-mb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    color: #1f2937;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.ws-mb-item:active {
    transform: scale(0.96);
    background: rgba(15,23,42,0.04);
}

/* 图标框：和PC侧同款大圆角淡灰底 */
.ws-mb-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border-radius: 16px;
    background: #f1f3f6;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ws-mb-icon svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.ws-mb-text {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.2px;
}

/* ====== 三个按钮单独配色 ====== */

/* ① 在线咨询：深灰中性色 */
.ws-mb-consult .ws-mb-icon {
    color: #4b5563;
    background: #f1f3f6;
}
.ws-mb-consult:active .ws-mb-icon {
    background: #e6e9ee;
}

/* ② 拨打电话：品牌红主 CTA，核心点缀 */
.ws-mb-phone .ws-mb-icon {
    color: #ffffff;
    background: linear-gradient(135deg, #b4171c, #d42a30);
    box-shadow: 0 4px 12px rgba(175,9,14,0.26);
}
.ws-mb-phone .ws-mb-text {
    color: #af090e;   /* 文字也用品牌红强调 */
    font-weight: 700;
}
.ws-mb-phone:active .ws-mb-icon {
    filter: brightness(0.92);
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(175,9,14,0.22);
}

/* ③ 添加微信：柔和绿 */
.ws-mb-wechat .ws-mb-icon {
    color: #2f9e61;
    background: #e7f6ed;
}
.ws-mb-wechat:active .ws-mb-icon {
    background: #d8f1e2;
}

@media only screen and (max-width: 992px) {
    .ws-side-bar { display: none; }
    .ws-mobile-bar { display: flex; }
    body { padding-bottom: 100px; }
    /* 底部栏高 108px（含安全区），聊天启动按钮原本压在"添加微信"上，抬到栏上方 16px */
    .chat-launcher {
        bottom: calc(108px + 16px + env(safe-area-inset-bottom));
    }
}

/* =====================================================
   二维码放大弹窗
   ===================================================== */
.ws-qr-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ws-qr-modal.active { display: flex; }

.ws-qr-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: wsQrFadeIn 0.25s ease-out;
}

@keyframes wsQrFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ws-qr-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 26px 22px;
    width: min(90vw, 320px);
    text-align: center;
    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(15,23,42,0.06);
    animation: wsQrPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

@keyframes wsQrPop {
    from { opacity: 0; transform: scale(0.9) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ws-qr-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #a6aab0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ws-qr-close:hover {
    background: #fdf2f3;
    color: #af090e;
    transform: rotate(90deg);
}

.ws-qr-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;      /* 深灰，不再红色 */
    margin-bottom: 18px;
    letter-spacing: 0.4px;
}

.ws-qr-img {
    width: 100%;
    max-width: 240px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
    margin: 0 auto 14px;
    display: block;
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.08);   /* 中性灰边框，不再红调 */
    box-shadow: 0 4px 16px rgba(15,23,42,0.06);
}

.ws-qr-tip {
    font-size: 12.5px;
    color: #6b7280;      /* 中深灰，更清晰不糊 */
    letter-spacing: 0.2px;
}
