/* ==========================================================================
   「联系客服」右侧全局悬浮入口 + 全站共用竖排浮层
   - 独立文件，不被 tools/harvest_theme.py 覆盖，可安全重跑主题。
   - 不依赖原站 CSS 变量 / 外部字体 / 图片 / 图标字体，断网也完整可用。
   - 桌面：右侧悬浮「图标+文字」胶囊，点击居中弹窗。
   - 手机：右侧悬浮圆形图标，点击从底部弹出 bottom sheet，可滚动。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) 右侧全局悬浮入口（FAB）。与右下角语言胶囊错开：放其正上方。
   -------------------------------------------------------------------------- */
.wb-contact-fab {
  position: fixed;
  right: 24px;
  bottom: 88px;                 /* 语言胶囊 bottom:24px + 高度约 44px + 间距 */
  z-index: 9999;                /* 低于浮层遮罩 10000，高于语言胶囊 9998 */
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 26px;
  background: #1a1a1a;
  color: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.wb-contact-fab:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}
.wb-contact-fab:focus-visible { outline: 3px solid #7a5cff; outline-offset: 3px; }
.wb-contact-fab__icon { flex: 0 0 auto; }
.wb-contact-fab__label { white-space: nowrap; }

/* --------------------------------------------------------------------------
   2) 遮罩层
   -------------------------------------------------------------------------- */
.wb-contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.wb-contact-overlay.is-open { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   3) 对话框
   -------------------------------------------------------------------------- */
.wb-contact-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 36px 34px 30px;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  transform: translateY(14px) scale(.985);
  transition: transform .22s ease;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wb-contact-overlay.is-open .wb-contact-dialog { transform: translateY(0) scale(1); }
.wb-contact-dialog:focus { outline: none; }

.wb-contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: color .15s ease, transform .15s ease;
}
.wb-contact-close:hover { color: #000; transform: rotate(90deg); }

.wb-contact-title {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.wb-contact-intro {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: #6a6a6a;
}

/* --------------------------------------------------------------------------
   4) 竖排联系方式列表（每渠道一行）
   -------------------------------------------------------------------------- */
.wb-contact-channels { display: flex; flex-direction: column; gap: 9px; }
.wb-contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e6e6e6;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.wb-contact-row:hover { border-color: #1a1a1a; background: #fafafa; }

/* 占位行：渠道尚未在后台配置账号，灰色不可点，图标去色 */
.wb-contact-row.is-pending {
  cursor: default;
  border-style: dashed;
  background: #fcfcfc;
}
.wb-contact-row.is-pending:hover { border-color: #e6e6e6; background: #fcfcfc; }
.wb-contact-row.is-pending .wb-contact-ico {
  filter: grayscale(1);
  opacity: .55;
}
.wb-contact-row.is-pending .wb-contact-label { color: #a8a8a8; }
.wb-contact-row.is-pending .wb-contact-value {
  color: #9a9a9a;
  font-weight: 500;
  font-style: italic;
}

/* 品牌图标：各平台品牌色背景 + 白色 currentColor 图标 */
.wb-contact-ico {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #1a1a1a;
}
.wb-contact-ico--mail     { background: #4a4a4a; }
.wb-contact-ico--phone    { background: #2f7d4f; }
.wb-contact-ico--whatsapp { background: #25d366; }
.wb-contact-ico--telegram { background: #229ed9; }
.wb-contact-ico--instagram{ background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 55%, #cc2366 80%, #bc1888); }
.wb-contact-ico--facebook { background: #1877f2; }
.wb-contact-ico--tiktok   { background: #010101; }
.wb-contact-ico--youtube  { background: #ff0033; }

.wb-contact-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wb-contact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a8a8a;
  margin-bottom: 3px;
}
.wb-contact-value {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-contact-arrow { flex: 0 0 auto; color: #aaa; }
.wb-contact-empty {
  margin: 0;
  padding: 16px;
  background: #fafafa;
  font-size: 14px;
  color: #777;
  text-align: center;
}

/* --------------------------------------------------------------------------
   5) 浮层打开时锁定背景滚动
   -------------------------------------------------------------------------- */
body.wb-contact-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   6) 手机 / 小屏：悬浮按钮收成圆形图标；浮层改为底部弹出 bottom sheet
   -------------------------------------------------------------------------- */
@media (max-width: 749px) {
  .wb-contact-fab {
    right: 12px;
    bottom: 76px;               /* 手机语言胶囊 right:12 bottom:12 */
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .wb-contact-fab__label { display: none; }
  .wb-contact-fab__icon { width: 26px; height: 26px; }

  .wb-contact-overlay { align-items: flex-end; padding: 0; }
  .wb-contact-dialog {
    max-width: none;
    max-height: 86vh;
    padding: 28px 22px calc(26px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }
  .wb-contact-overlay.is-open .wb-contact-dialog { transform: translateY(0); }
  .wb-contact-title { font-size: 22px; }
  .wb-contact-intro { margin-bottom: 18px; }
  .wb-contact-row { padding: 11px 12px; gap: 12px; }
  .wb-contact-ico { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   7) 尊重系统减少动态效果设置
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wb-contact-overlay, .wb-contact-dialog, .wb-contact-fab,
  .wb-contact-close, .wb-contact-row { transition: none; }
}
