/* ===================================================================
   联系方式组件样式（contact.css）
   -------------------------------------------------------------------
   由 lib/siteContact.js#patchContact() 注入到全站页面，与 style.css 配合。
   刻意独立成文件（而非并入 style.css）：新文件不存在浏览器缓存问题，
   全站换联系方式时用户无需强制刷新；同时 style.css 不必再被反复改动。

   组成：左侧联系栏 .twc-rail / 右侧顾问卡 .twc-card / 页脚二维码横条
        .twc-qr-band / 顾问弹窗 .twc-modal / 页脚联系列 .twc-footer-col
   依赖 style.css 的变量：--red --red-dark --red-deep --gold --gold-light
        --ink --ink-soft --line
   =================================================================== */

/* ------------------------------ 左侧悬浮联系栏 ------------------------------ */
.twc-rail {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 2px;
}
.twc-rail-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; padding: 14px 16px; border: none; cursor: pointer;
  border-radius: 0 10px 10px 0;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  box-shadow: 4px 4px 16px rgba(200, 16, 46, .25);
  transition: all .25s; white-space: nowrap;
}
.twc-rail-btn:hover { background: linear-gradient(135deg, var(--red-dark), var(--red-deep)); padding-left: 22px; color: #fff; }
.twc-rail-btn svg { flex-shrink: 0; }

/* ------------------------------ 右侧顾问卡 ------------------------------ */
.twc-card {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 90; width: 196px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
  box-shadow: -6px 6px 24px rgba(0, 0, 0, .10);
  overflow: hidden;
}
.twc-card-head {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 9px 14px; letter-spacing: .5px;
}
.twc-card-head::before { content: "☎"; margin-right: 6px; }
.twc-card-rows { padding: 4px 0; }
.twc-card-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; color: var(--ink) !important;
  transition: background .2s;
}
.twc-card-row:hover { background: #FFF7F1; color: var(--ink) !important; }
.twc-card-row .twc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.twc-cr-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.twc-cr-txt b { font-size: 13.5px; font-weight: 800; letter-spacing: .2px; }
.twc-cr-txt em { font-style: normal; font-size: 11.5px; color: var(--ink-soft); }
.twc-card-wx {
  display: block; width: calc(100% - 20px); margin: 8px 10px;
  padding: 8px 0; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #2AAE67, #1E8E52);
  color: #fff; font-size: 12.5px; font-weight: 700; font-family: inherit;
  transition: filter .2s;
}
.twc-card-wx:hover { filter: brightness(1.07); }
.twc-card-info {
  padding: 8px 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.55; color: var(--ink-soft);
}
.twc-card-info strong { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.twc-card-info span { color: var(--ink); font-weight: 600; }

/* ------------------------------ 页脚二维码横条 ------------------------------ */
.twc-qr-band {
  max-width: 1200px; margin: 34px auto 0;
  padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .08);
  position: relative; z-index: 2;
}
.twc-qr-head { text-align: center; margin-bottom: 20px; }
.twc-qr-title {
  display: block; color: var(--gold); font-size: 16px; font-weight: 700;
  letter-spacing: .5px;
}
.twc-qr-title::before, .twc-qr-title::after {
  content: ""; display: inline-block; width: 26px; height: 1px;
  background: rgba(212, 175, 55, .55); vertical-align: middle; margin: 0 10px;
}
.twc-qr-sub-line { display: block; color: #8a7670; font-size: 12.5px; margin-top: 5px; }
.twc-qr-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; }
.twc-qr-item { width: 138px; text-align: center; }
.twc-qr-box {
  display: block; width: 138px; height: 138px; padding: 7px;
  background: #fff; border-radius: 12px; box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  transition: transform .25s, box-shadow .25s;
}
.twc-qr-box:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(212, 175, 55, .34); }
.twc-qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.twc-qr-name { color: #e8dcd4; font-size: 13.5px; font-weight: 700; margin-top: 10px; }
.twc-qr-sub { color: #9c8880; font-size: 11.5px; line-height: 1.4; }
.twc-qr-tel { color: var(--gold-light) !important; font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.twc-qr-tel:hover { color: #fff !important; }

/* ------------------------------ 页脚「联系我们」列 ------------------------------ */
.twc-footer-col h4 { color: var(--gold); font-size: 15px; margin-bottom: 12px; font-weight: 700; }
.twc-footer-col .twc-fc-line {
  font-size: 13px; line-height: 1.85; margin-bottom: 2px; color: #bfa99e;
}
.twc-footer-col .twc-fc-line a { color: #d9c9c0; font-size: 13px; }
.twc-footer-col .twc-fc-line a:hover { color: var(--gold-light); }

/* ------------------------------ 顾问弹窗 ------------------------------ */
.twc-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.twc-modal[hidden] { display: none; }
.twc-mask {
  position: absolute; inset: 0; background: rgba(15, 10, 12, .72);
  backdrop-filter: blur(3px);
}
.twc-dialog {
  position: relative; z-index: 1; background: #fff;
  width: 100%; max-width: 900px; max-height: 92vh; overflow: auto;
  border-radius: 18px; padding: 30px 32px 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45);
  animation: twcPop .26s ease-out;
}
@keyframes twcPop {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.twc-x {
  position: absolute; top: 12px; right: 16px; width: 34px; height: 34px;
  border: none; background: transparent; cursor: pointer;
  font-size: 26px; line-height: 1; color: #bbb; border-radius: 50%;
  transition: all .2s;
}
.twc-x:hover { background: #f5f5f5; color: var(--red); }
.twc-dialog-title {
  font-size: 20px; font-weight: 800; color: var(--ink);
  padding-right: 40px;
}
.twc-dialog-title::after {
  content: ""; display: block; width: 46px; height: 3px; margin-top: 10px;
  background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 2px;
}
.twc-dialog-lead {
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.85;
  margin: 14px 0 22px;
}
.twc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.twc-person {
  border: 1px solid var(--line); border-top: 3px solid var(--twc-accent, var(--red));
  border-radius: 14px; padding: 18px 14px 16px; text-align: center;
  background: linear-gradient(180deg, #fff, #FDFBFA);
  transition: box-shadow .25s, transform .25s;
}
.twc-person:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.twc-p-qr {
  display: block; width: 172px; max-width: 100%; margin: 0 auto 14px;
  padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.twc-p-qr img { width: 100%; height: auto; display: block; }
.twc-p-role { font-size: 12.5px; color: #fff; background: var(--twc-accent, var(--red)); display: inline-block; padding: 2px 10px; border-radius: 20px; }
.twc-p-name { font-size: 19px; font-weight: 800; color: var(--ink); margin: 9px 0 2px; }
.twc-p-tel {
  display: block; font-size: 16px; font-weight: 800; letter-spacing: .6px;
  color: var(--twc-accent, var(--red)) !important;
}
.twc-p-call {
  display: block; margin: 12px 0 6px; padding: 9px 0;
  border-radius: 9px; color: #fff !important; font-size: 14px; font-weight: 700;
  background: var(--twc-accent, var(--red));
  transition: filter .2s;
}
.twc-p-call:hover { filter: brightness(1.1); color: #fff !important; }
.twc-p-hint { font-size: 11.5px; color: var(--ink-soft); }
.twc-dialog-foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft);
}
.twc-dialog-foot a { color: var(--red); }

/* 关于我们页：咨询热线行旁的补充说明 */
.twc-ci-note { font-size: 12.5px; color: var(--ink-soft); margin-left: 10px; }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 960px) {
  /* 右侧卡片过宽会压住正文，直接隐藏；联系方式改由底部悬浮按钮 + 页脚二维码承载 */
  .twc-card { display: none; }

  /* 左侧栏缩成右下角圆形悬浮按钮 */
  .twc-rail {
    left: auto; right: 14px; top: auto; bottom: 18px;
    transform: none; gap: 8px;
  }
  .twc-rail-btn {
    width: 48px; height: 48px; padding: 0; justify-content: center;
    border-radius: 50%; box-shadow: 0 6px 20px rgba(200, 16, 46, .38);
  }
  .twc-rail-btn span { display: none; }
  .twc-rail-btn:hover { padding-left: 0; }

  .twc-dialog { padding: 24px 18px 18px; border-radius: 14px; }
  .twc-grid { grid-template-columns: 1fr; gap: 14px; }
  .twc-person { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; text-align: left; padding: 14px; }
  .twc-p-qr { width: 104px; margin: 0; flex: none; }
  .twc-p-role { order: -1; }
  .twc-p-name { margin: 0; font-size: 17px; }
  .twc-p-tel { font-size: 15px; }
  .twc-p-call { flex: 1 1 100%; margin: 6px 0 0; }
  .twc-p-hint { flex: 1 1 100%; }

  .twc-qr-grid { gap: 18px; }
  .twc-qr-item { width: 128px; }
  .twc-qr-box { width: 128px; height: 128px; }
}

@media (max-width: 560px) {
  .twc-qr-item { width: calc(50% - 9px); }
  .twc-qr-box { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

@media print {
  .twc-rail, .twc-card, .twc-modal { display: none !important; }
}
