/* ============================================================
   在线客服信息层（导航「在线客服」触发）
   全部选择器以 .cs- 前缀作用域化，避免与站点既有样式冲突
   ============================================================ */

/* 按钮/链接基础重置（:where() 零特异性，不会覆盖下方组件样式）
   作用：清掉浏览器默认的按钮边框、灰色背景、居中文字与内边距，
   保证「在线客服」等 <button> 行与普通信息行完全一致。 */
.cs-layer :where(button) {
  font: inherit; color: inherit; background: none;
  border: 0; margin: 0; padding: 0; border-radius: 0;
  text-align: left; cursor: pointer; width: auto;
  -webkit-appearance: none; appearance: none;
}
.cs-layer :where(a) { color: inherit; text-decoration: none; }
.cs-layer :where(button, a) { -webkit-tap-highlight-color: transparent; }

.cs-layer {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity .26s ease, visibility .26s ease;
}
.cs-layer.open { opacity: 1; visibility: visible; }

.cs-layer-mask {
  position: absolute; inset: 0;
  background: rgba(10, 12, 20, .5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}

.cs-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(10, 12, 20, .28);
  transform: translateY(14px) scale(.97); opacity: 0;
  transition: transform .3s cubic-bezier(.22, .68, .36, 1), opacity .3s;
  font-family: inherit;
}
.cs-layer.open .cs-panel { transform: none; opacity: 1; }

/* ---------- 头部 ---------- */
.cs-head {
  position: relative;
  padding: 22px 56px 20px 24px;
  background: linear-gradient(135deg, #23262e 0%, #14161c 100%);
  color: #fff;
}
.cs-head h3 { margin: 0; font-size: 17.5px; font-weight: 700; line-height: 1.4; letter-spacing: .2px; }
.cs-head p { margin: 7px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .58); }
.cs-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .85);
  border: none; cursor: pointer; transition: background .2s, color .2s, transform .2s;
}
.cs-close:hover { background: rgba(255, 255, 255, .24); color: #fff; transform: rotate(90deg); }
.cs-close svg { width: 15px; height: 15px; }

/* ---------- 列表 ---------- */
.cs-body { flex: 1; overflow-y: auto; padding: 6px 24px; }

.cs-item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%; /* button 行默认 width:auto 会收缩到内容宽度，需强制撑满保证各行对齐 */
  padding: 14px 0;
  border-bottom: 1px solid #f2f3f5;
  text-decoration: none;
}
.cs-item:last-child { border-bottom: none; }
a.cs-item, button.cs-item { cursor: pointer; }

.cs-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 6px 14px rgba(24, 24, 40, .14);
}
.cs-ico svg { width: 24px; height: 24px; }
.cs-ico-qq { background: linear-gradient(135deg, #4aa8ff, #1677ff); }
.cs-ico-wx { background: linear-gradient(135deg, #3cdd7c, #12b85a); }
.cs-ico-tel { background: linear-gradient(135deg, #ffb04a, #f97316); }
.cs-ico-ticket { background: linear-gradient(135deg, #b07cff, #7c3aed); }
.cs-ico-chat { background: linear-gradient(135deg, #ff7a7a, #e60012); }

.cs-txt { flex: 1; min-width: 0; }
.cs-txt b { display: block; font-size: 14.5px; font-weight: 600; color: #1f2329; line-height: 1.4; }
.cs-txt .cs-val {
  display: block; margin-top: 3px;
  font-size: 13px; color: #86909c; line-height: 1.5;
  word-break: break-all;
}
.cs-txt .cs-val em { font-style: normal; color: #b0b6bf; font-size: 12px; }

/* 复制按钮 */
.cs-copy {
  flex: none;
  padding: 5px 15px; border-radius: 8px;
  border: 1px solid rgba(230, 0, 18, .45);
  background: #fff; color: #e60012;
  font-size: 12.5px; line-height: 1.5; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.cs-copy:hover { background: #e60012; border-color: #e60012; color: #fff; }
.cs-copy.is-done { background: #12b85a; border-color: #12b85a; color: #fff; }

/* 操作型行（提交工单 / 在线客服） */
.cs-go {
  flex: none; font-size: 12.5px; color: #e60012; font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
  transition: transform .2s;
}
.cs-item:hover .cs-go { transform: translateX(3px); }
.cs-item-link:hover .cs-txt b { color: #e60012; }

/* ---------- 微信号二维码（hover 显示） ---------- */
.cs-item-qr { position: relative; }
.cs-qr {
  position: absolute; left: 50%; top: calc(100% - 6px);
  transform: translateX(-50%) translateY(6px);
  z-index: 5; width: 176px; padding: 10px 10px 8px;
  background: #fff; border: 1px solid #eef0f7; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(24, 24, 40, .18);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  text-align: center;
}
.cs-qr::before {
  content: ""; position: absolute; top: -6px; left: 50%;
  width: 10px; height: 10px; margin-left: -5px;
  background: #fff; border-left: 1px solid #eef0f7; border-top: 1px solid #eef0f7;
  transform: rotate(45deg);
}
.cs-qr img { display: block; width: 100%; height: auto; border-radius: 6px; }
.cs-qr span { display: block; margin-top: 6px; font-size: 11.5px; color: #86909c; }
/* 二维码为纯展示层（pointer-events 始终为 none），淡出瞬间也不会遮挡下方按钮点击 */
.cs-item-qr:hover .cs-qr,
.cs-item-qr:focus-within .cs-qr,
.cs-item-qr.show-qr .cs-qr {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 底部提示 ---------- */
.cs-foot {
  padding: 13px 24px 15px;
  background: #fafbfc; border-top: 1px solid #f2f3f5;
  text-align: center; font-size: 12px; color: #9aa3af; line-height: 1.6;
}

/* ---------- 响应式 ---------- */
@media (max-width: 520px) {
  .cs-layer { padding: 12px; align-items: flex-end; }
  .cs-panel { max-height: calc(100vh - 24px); border-radius: 16px 16px 12px 12px; }
  .cs-head { padding: 18px 52px 16px 18px; }
  .cs-head h3 { font-size: 16px; }
  .cs-body { padding: 4px 18px; }
  .cs-item { gap: 12px; padding: 12px 0; }
  .cs-ico { flex-basis: 40px; width: 40px; height: 40px; border-radius: 12px; }
  .cs-ico svg { width: 22px; height: 22px; }
  .cs-copy { padding: 5px 12px; }
  .cs-qr { width: 158px; }
}
