/* kefu-widget.css —— 在线客服组件独立样式（B83）
   前段取自 style-geo2026.css 的 1899-2120 行（B54/B72/B73 三段）原样复制，
   后段是移动端加固；主题 CSS 本体未改动。 */

/* ========== B54 在线客服（右下角悬浮 + 气泡留资面板） ==========
   现有 .float-phone 占 right:24px / bottom:32px / 52x52，客服按钮排在它上方 bottom:96px。
   蜜罐字段用移出视口的方式隐藏（不用 display:none，机器人更容易识别不到但也拿不到值）。 */

.kefu-wrap { position: fixed; right: 24px; bottom: 96px; z-index: 1000; }
.kefu-fab {
    position: relative;
    width: 52px; height: 52px;
    border: 0; padding: 0; cursor: pointer;
    border-radius: 50%;
    background: linear-gradient(135deg, #12171d 0%, #2a3038 100%);
    color: #f3e7cf;
    font-size: 1.4rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px -12px rgba(18, 23, 29, .55);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: kefuBreath 3.2s ease-in-out infinite;
}
.kefu-fab:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -10px rgba(18, 23, 29, .68); }
.kefu-fab svg { width: 20px; height: 20px; stroke: #c9a86a; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kefu-fab-tip {
    position: absolute; right: 64px; top: 50%; transform: translateY(-50%);
    background: #fff; color: #9c763c;
    padding: 6px 14px; border-radius: 6px;
    font-size: .8rem; font-weight: 600; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.kefu-fab:hover .kefu-fab-tip, .kefu-fab:focus .kefu-fab-tip { opacity: 1; visibility: visible; }
@keyframes kefuBreath {
    0%, 100% { box-shadow: 0 10px 30px -12px rgba(18, 23, 29, .55); }
    50%      { box-shadow: 0 12px 34px -10px rgba(178, 138, 76, .45); }
}

.kefu-panel {
    position: absolute; right: 0; bottom: 64px;
    width: 322px; max-width: calc(100vw - 32px);
    background: #fff; border-radius: 4px; overflow: hidden;
    box-shadow: 0 24px 60px -28px rgba(18, 23, 29, .35);
    border: 1px solid #e7e2d8;
}
.kefu-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1f4e5f 0%, #12171d 100%);
    color: #fff;
}
.kefu-head-t { font-size: .95rem; font-weight: 700; }
.kefu-head-s { font-size: .72rem; opacity: .9; margin-left: auto; }
.kefu-close {
    border: 0; background: rgba(255, 255, 255, .18); color: #fff;
    width: 22px; height: 22px; line-height: 20px; border-radius: 50%;
    font-size: 1rem; cursor: pointer; flex: 0 0 auto;
}
.kefu-close:hover { background: rgba(255, 255, 255, .32); }
.kefu-body { padding: 14px; }
.kefu-msg {
    background: #f6f3ec; color: #2a3038;
    font-size: .82rem; line-height: 1.7;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 12px;
}
.kefu-label { display: block; font-size: .8rem; font-weight: 600; color: #4e5969; margin-bottom: 6px; }
.kefu-label em { color: #f53f3f; font-style: normal; margin-left: 2px; }
.kefu-input {
    width: 100%; box-sizing: border-box;
    border: 1px solid #e7e2d8; border-radius: 4px;
    padding: 9px 11px; font-size: .88rem; color: #12171d;
    font-family: inherit; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.kefu-input:focus { outline: 0; border-color: #b28a4c; box-shadow: 0 0 0 3px rgba(178, 138, 76, .14); }
.kefu-textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.kefu-err { color: #f53f3f; font-size: .76rem; min-height: 18px; line-height: 18px; margin: 4px 0 8px; }
.kefu-submit {
    width: 100%; border: 0; cursor: pointer;
    background: #b28a4c;
    color: #fff; font-size: .92rem; font-weight: 700;
    padding: 11px 0; border-radius: 2px;
    transition: filter .15s ease, transform .15s ease;
}
.kefu-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.kefu-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.kefu-tip { color: #86909c; font-size: .72rem; text-align: center; margin-top: 8px; }
.kefu-done {
    background: #efe9dd; color: #12171d;
    border-radius: 8px; padding: 14px;
    font-size: .86rem; line-height: 1.7; text-align: center;
}
/* 蜜罐：移出视口而非 display:none */
.kefu-hp {
    position: absolute !important;
    left: -9999px; top: -9999px;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .kefu-wrap { right: 14px; bottom: 84px; }
    .kefu-fab { width: 46px; height: 46px; font-size: 1.2rem; }
    .kefu-panel { width: calc(100vw - 28px); bottom: 56px; }
    .kefu-fab-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .kefu-fab { animation: none; transition: none; }
    .kefu-fab:hover { transform: none; }
    .kefu-submit:hover { transform: none; }
}

/* ========== B72 在线客服：标签常显 + 胶囊按钮 + 层级修正 ==========
   问题：B54 版把「在线客服」四个字做成 hover 才出现的浮标（.kefu-fab-tip 默认
   opacity:0/visibility:hidden），且 @media(max-width:768px) 里直接 display:none，
   手机上永远看不到；另外 .kefu-wrap 与 .navbar 同为 z-index:1000，靠源码顺序才没被压住。
   改法：按钮由圆形改胶囊（图标+文字常显），文字改为 pill 内联标签，层级提到 1300。
   定位仍是 position:fixed（body 直接子级、祖先无 transform/filter/contain），滚动时始终跟随视口。 */

.kefu-wrap { z-index: 1300; }

.kefu-fab {
    width: auto;
    height: 52px;
    padding: 0 18px 0 15px;
    gap: 9px;
    border-radius: 999px;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 10px 30px -12px rgba(18, 23, 29, .55);
}

/* 原 hover 浮标 → 胶囊内的常显文字 */
.kefu-fab-tip {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    color: #f3e7cf;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .5px;
    white-space: nowrap;
    display: inline;
}

.kefu-panel { bottom: 64px; }

@media (max-width: 768px) {
    .kefu-fab { height: 46px; padding: 0 14px 0 12px; gap: 7px; font-size: 1.15rem; }
    .kefu-fab-tip { display: inline; font-size: .86rem; letter-spacing: .3px; }
}

@media (max-width: 520px) {
    .kefu-fab { height: 42px; padding: 0 12px 0 10px; gap: 6px; font-size: 1.05rem; }
    .kefu-fab-tip { font-size: .8rem; }
    .kefu-panel { bottom: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    .kefu-fab { box-shadow: 0 10px 30px -12px rgba(18, 23, 29, .55); }
}

/* ========== B73 在线客服：去掉闪烁，只留金色细描边 ==========
   旧版每 1.8s 呼吸一次亮度/缩放，配上新的深色极简风格显得吵闹，
   改成静态：常态无外扩光环，悬停时才浮出一圈金色描边。 */

.kefu-fab {
    position: relative;
    animation: none;
    border: 1px solid rgba(201, 168, 106, .55);
}

.kefu-fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 1px solid #c9a86a;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* 悬停时不抢动画：停在外扩状态并加亮，避免 hover 与闪烁互相打架 */
.kefu-fab:hover { animation-play-state: paused; }
.kefu-fab:hover::after { opacity: .9; }

@media (prefers-reduced-motion: reduce) {
    .kefu-fab { animation: none; box-shadow: 0 10px 30px -12px rgba(18, 23, 29, .55); }
    .kefu-fab::after { transition: none; }
    .kefu-fab:hover { transform: none; }
}


/* ========== B82 在线客服：全站挂载 + 移动端可见性加固 ==========
   1) 本文件是组件的唯一样式来源：企业主页（/template/pinpai）、论坛（/template/bbs）、
      招聘（geojob）这些页面不加载 style-geo2026.css，只引这份就能正常显示。
   2) 手机端强制可见：把 B54 遗留的「hover 才显形」和 @media(max-width:768px) 里的
      display:none 用 !important 彻底压掉（主题 CSS 保持原样，不改动它）。
   3) bottom 带 env(safe-area-inset-bottom)：iPhone 底部横条、浏览器工具栏不再压住胶囊。
   4) 层级 2100：高于导航抽屉 nav-menu(1202) 与遮罩 nav-mask(1201)，抽屉动画期间也不被盖。 */
.kefu-wrap { z-index: 2100; }
.kefu-panel { max-height: calc(100vh - 160px); overflow-y: auto; }
.kefu-fab { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (max-width: 768px) {
    .kefu-wrap {
        right: 12px;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .kefu-fab {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .kefu-fab-tip {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .kefu-panel { width: calc(100vw - 24px); right: 0; }
}

@media (max-width: 520px) {
    .kefu-wrap { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
    .kefu-fab { max-width: calc(100vw - 24px); }
}

/* 咨询窗改为默认展开：矮屏（横屏手机/笔记本）下限制高度并内部滚动，避免挡住整页 */
.kefu-panel { max-height: calc(100vh - 190px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
    .kefu-panel { max-height: calc(100vh - 170px); }
}

/* 默认展开时不能吃掉整屏首屏：收起悬浮胶囊、面板压扁贴住屏幕底边，
   只让出下方数据条，标题/引导语/三个 CTA 按钮保持在面板上方。
   769—1023px（平板/小笔记本）同样走压扁版，否则竖着的卡片会盖住整段标题。 */
@media (max-width: 1023px) {
    .kefu-wrap[data-open="1"] { bottom: 6px !important; }
    /* B82 里 .kefu-fab 有 display:flex !important，这里必须同级加 !important 才压得住 */
    .kefu-wrap[data-open="1"] .kefu-fab { display: none !important; }
    .kefu-wrap[data-open="1"] .kefu-panel {
        bottom: 0;
        max-height: calc(100vh - 300px);
    }
    .kefu-wrap[data-open="1"] .kefu-head { padding: 7px 10px; }
    .kefu-wrap[data-open="1"] .kefu-head-s { display: none; }
    .kefu-wrap[data-open="1"] .kefu-msg { display: none; }
    .kefu-wrap[data-open="1"] .kefu-body { padding: 8px 10px 9px; }
    .kefu-wrap[data-open="1"] .kefu-label { margin-bottom: 3px; font-size: .76rem; }
    .kefu-wrap[data-open="1"] .kefu-input { padding: 7px 10px; }
    .kefu-wrap[data-open="1"] .kefu-textarea { min-height: 38px; height: 38px; }
    .kefu-wrap[data-open="1"] .kefu-err { min-height: 0; margin: 0; }
    .kefu-wrap[data-open="1"] .kefu-submit { padding: 8px 0; }
    .kefu-wrap[data-open="1"] .kefu-tip { display: none; }
}
