/*
// +----------------------------------------------------------------------
// | 客服悬浮组件 & Toast 组件（前台页面与用户中心共用）
// |
// | 【样式冲突排查结论】用户中心（view/user/pc/default/header.html）公共样式链
// | 中的以下规则会污染本组件，造成按钮/模态框尺寸与样式和前台不一致：
// |   1) bootstrap.min.css（定制版 BS3）: html { font-size: 10px }
// |      → 前台根字号为默认 16px，组件内所有 rem 尺寸被整体缩小 37.5%
// |        （如 .cs-btn 图标 1.6rem：前台 25.6px / 用户中心 16px；
// |          .cs-header h3 1.3rem：前台 20.8px / 用户中心 13px）。【尺寸不一致主因】
// |   2) custom.css :root 重定义设计变量（--text-main:#344054、--text-dark:#1d2939、
// |      --shadow-sm/lg/glow、--transition 均与前台 common.css 不同）
// |      → 组件颜色、阴影、过渡效果与前台不一致。【样式不一致主因】
// |   3) bootstrap(BS3): body { line-height: 1.428571429 }（前台为 1.6）；
// |   4) base.css: * { word-wrap: break-word }（前台无此规则）；
// |   5) base.css: body { font-size:14px; font-family... }、html { -webkit-text-size-adjust:100% }
// |      → 继承的字体/字号/文字缩放行为不一致；
// |   6) base.css 全局 img 规则缺失 max-width（前台 common.css 有）。
// |
// | 【规避方案】
// |   a) 全部规则以 #cs-module / #toastContainer（ID 作用域，特异性 1,0,0）前缀，
// |      高于用户中心任何类/元素级公共样式；
// |   b) 组件字号一律使用 px（按 16px 根字号等效换算），不依赖根字号，
// |      彻底规避 html{font-size:10px} 的缩放污染（rem 无法在子作用域重新基准）；
// |   c) 在作用域根节点自带一套组件变量（取值与前台 common.css :root 一致），
// |      屏蔽用户中心 :root 的变量重定义；
// |   d) 显式还原前台继承环境：字体栈、字号 16px、行高 1.6、颜色 #333、
// |      text-align:left、word-wrap:normal、text-size-adjust:auto、box-sizing:border-box。
// | 前台本身即满足上述全部值，因此前台视觉零变化。
// |
// | 【注意】页面级覆盖 ioscheck.css 的 body.ioscheck-active #cs-module ... 已同步
// | 使用 #cs-module 前缀（特异性 1,2,1），且字号已换算为 px。
// +----------------------------------------------------------------------
*/

/* ---------- 作用域归一化 + 组件变量（屏蔽用户中心 :root 变量重定义） ---------- */
#cs-module,
#toastContainer {
    /* 组件设计变量：与前台 common.css :root 保持一致 */
    --cs-primary: #f6c24c;
    --cs-primary-rgb: 246, 194, 76;
    --cs-primary-dark: #dcb000;
    --cs-primary-gradient: linear-gradient(135deg, #fbe96b 0%, #f6c24c 100%);
    --cs-bg-white: #ffffff;
    --cs-text-dark: #1a1a1a;
    --cs-text-main: #333333;
    --cs-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --cs-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.08);
    --cs-shadow-glow: 0 4px 15px rgba(246, 194, 76, 0.3);
    --cs-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* 还原前台继承环境，抵消公共样式污染 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    text-align: left;
    word-wrap: normal;
    overflow-wrap: normal;
    -webkit-text-size-adjust: auto;
    text-size-adjust: auto;
}

#cs-module,
#cs-module *,
#toastContainer,
#toastContainer * {
    box-sizing: border-box;
}

/* 元素级归一化：覆盖 bootstrap(BS3) 对 h1-h6 的 font-family/line-height 直接规则
   与 base.css 的 * { word-wrap: break-word }（继承值无法抵消元素级直接规则）；
   排除 i 元素，避免覆盖 Font Awesome 图标字体 */
#cs-module h3, #cs-module h4, #cs-module p, #cs-module div, #cs-module span,
#toastContainer div, #toastContainer span {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    word-wrap: normal;
    overflow-wrap: normal;
}

/* ---------- 客服悬浮组件（字号均为 16px 根字号等效 px 值） ---------- */
#cs-module .cs-sidebar { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 990; display: flex; flex-direction: column; gap: 15px; }
@keyframes pulse-gold { 0% { box-shadow: 0 0 0 0 rgba(var(--cs-primary-rgb), 0.7); } 70% { box-shadow: 0 0 0 15px rgba(var(--cs-primary-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--cs-primary-rgb), 0); } }
#cs-module .cs-btn { width: 60px; height: 60px; background: var(--cs-primary-gradient); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--cs-text-main); font-size: 25.6px; position: relative; animation: pulse-gold 2s infinite; transition: color 0.3s ease; }
#cs-module .cs-btn:hover { color: var(--cs-bg-white); }
#cs-module .cs-tooltip { position: absolute; right: 75px; background: var(--cs-text-main); color: var(--cs-bg-white); padding: 6px 12px; border-radius: 6px; font-size: 13.6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.3s; transform: translateX(10px); box-shadow: var(--cs-shadow-sm); }
#cs-module .cs-tooltip::after { content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); border-width: 5px 0 5px 5px; border-style: solid; border-color: transparent transparent transparent var(--cs-text-main); }
#cs-module .cs-btn:hover .cs-tooltip { opacity: 1; transform: translateX(0); }

#cs-module .cs-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
#cs-module .cs-modal-overlay.active { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s linear 0s; }
#cs-module .cs-modal-box { background: var(--cs-bg-white); width: 90%; max-width: 380px; border-radius: 20px; padding: 30px; text-align: center; box-shadow: var(--cs-shadow-lg); transform: scale(0.9); opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); position: relative; overflow: hidden; }
#cs-module .cs-modal-overlay.active .cs-modal-box { transform: scale(1); opacity: 1; }
#cs-module .cs-close-btn { position: absolute; top: 15px; right: 20px; font-size: 24px; color: #ccc; cursor: pointer; transition: 0.3s; z-index: 10; }
#cs-module .cs-close-btn:hover { color: var(--cs-text-main); transform: rotate(90deg); }
#cs-module .cs-header h3 { font-size: 20.8px; color: var(--cs-text-dark); margin-bottom: 5px; font-weight: 800; }
#cs-module .cs-header p { color: #888; font-size: 13.6px; margin-bottom: 25px; }
#cs-module .cs-list { display: flex; flex-direction: column; gap: 12px; }
#cs-module .cs-item { display: flex; align-items: center; padding: 12px 15px; background: var(--cs-bg-white); border-radius: 12px; border: 1px solid #f0f0f0; transition: var(--cs-transition); cursor: pointer; text-align: left; position: relative; overflow: hidden; }
#cs-module .cs-item:hover { border-color: var(--cs-primary); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(var(--cs-primary-rgb), 0.15); }
#cs-module .cs-item-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19.2px; flex-shrink: 0; margin-right: 15px; background: rgba(var(--cs-primary-rgb), 0.15); color: var(--cs-primary-dark); transition: all 0.3s; }
#cs-module .cs-item:hover .cs-item-icon { background: var(--cs-primary-gradient); color: var(--cs-bg-white); transform: scale(1.1); box-shadow: var(--cs-shadow-glow); }
#cs-module .cs-item-info h4 { font-size: 15.2px; color: var(--cs-text-dark); margin-bottom: 2px; font-weight: 700; transition: color 0.3s; }
#cs-module .cs-item:hover .cs-item-info h4 { color: var(--cs-primary-dark); }
#cs-module .cs-item-info p { font-size: 12.8px; color: #888; margin: 0; }
#cs-module .cs-action-icon { margin-left: auto; color: #ddd; font-size: 14.4px; transition: all 0.3s; }
#cs-module .cs-item:hover .cs-action-icon { color: var(--cs-primary); transform: translateX(4px); }
#cs-module .cs-qr-panel { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); background: #fafafa; margin-top: 0; border-radius: 12px; }
#cs-module .cs-qr-panel.show { max-height: 300px; opacity: 1; margin-top: 20px; padding: 20px; border: 1px dashed #e0e0e0; }
#cs-module .cs-qr-img { width: 160px; height: 160px; max-width: 100%; margin: 0 auto 10px; display: block; border-radius: 8px; }
#cs-module .cs-qr-tip { font-size: 13.6px; color: var(--cs-primary-dark); font-weight: 600; }

/* ---------- Toast 组件（供 common.js CommonUtils.showToast 使用） ---------- */
#toastContainer { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 3000; pointer-events: none; }
#toastContainer .toast { background: rgba(0,0,0,0.85); color: var(--cs-bg-white); padding: 12px 24px; border-radius: 50px; font-size: 15.2px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); opacity: 0; transform: translateY(-20px); transition: all 0.3s; }
#toastContainer .toast.show { opacity: 1; transform: translateY(0); }
#toastContainer .toast i { color: var(--cs-primary); }

/* ---------- 响应式调整 ---------- */
@media (max-width: 992px) {
    #cs-module .cs-sidebar { bottom: 30px; top: auto; transform: none; right: 20px; flex-direction: row-reverse; }
    #cs-module .cs-tooltip { display: none; }
}
