/* 客服：整页 /support 和各页右下角的小弹窗共用。颜色沿用官网的墨色和黄铜色。 */
.support-avatar { display: block; width: 48px; height: 48px; flex: none; }
.support-avatar-dots circle { animation: support-typing 2.4s ease-in-out infinite; }
.support-avatar-dots circle:nth-child(2) { animation-delay: .2s; }
.support-avatar-dots circle:nth-child(3) { animation-delay: .4s; }
.support-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* —— 右下角按钮 —— */
.support-widget { font: 14px/1.6 var(--sans); color: #1a2422; }
.support-widget button, .support-widget textarea, .support-widget input { font: inherit; }
.support-fab { position: fixed; z-index: 90; right: max(24px, calc(env(safe-area-inset-right) + 12px)); bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; color: #0f1615; }
.support-fab .support-avatar { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 10px 30px rgba(11, 16, 15, .28); transition: transform .3s var(--ease); }
.support-fab:hover .support-avatar { transform: translateY(-2px); }
.support-fab-label { padding: 6px 14px; border: 1px solid rgba(185, 148, 92, .35); border-radius: 999px; background: rgba(246, 245, 240, .94); box-shadow: 0 6px 20px rgba(11, 16, 15, .08); font: 500 13px/1.6 var(--sans); letter-spacing: .04em; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.support-fab:focus-visible { outline: none; }
.support-fab:focus-visible .support-avatar { outline: 2px solid #b9945c; outline-offset: 4px; }
.support-widget.is-open .support-fab-label { display: none; }

/* —— 对话框（两种模式共用） —— */
.support-chat { position: relative; display: flex; flex-direction: column; min-height: 0; background: #fff; color: #1a2422; }
.support-chat button { cursor: pointer; }
.support-chat button:disabled { opacity: .5; cursor: default; }
.support-chat :focus-visible { outline: 2px solid #b9945c; outline-offset: 2px; }
.support-heading { display: flex; align-items: center; gap: 14px; padding: 20px 24px; background: #0f1615; color: #f3efe4; }
.support-heading-text { flex: 1; min-width: 0; }
.support-heading h1, .support-heading h2 { margin: 0; font: 600 20px/1.4 var(--sans); color: #f3efe4; }
.support-kicker { margin: 0; color: #dcc396; font-size: 11px; letter-spacing: .14em; }
.support-connection { margin: 2px 0 0; font-size: 12px; color: rgba(243, 239, 228, .68); }
.support-connection::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #8fbf8a; vertical-align: 1px; }
.support-chat.is-offline .support-connection::before { background: rgba(243, 239, 228, .4); }
.support-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(243, 239, 228, .08); color: #f3efe4; font-size: 22px; line-height: 1; }
.support-close:hover { background: rgba(243, 239, 228, .16); }
.support-history { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 24px 22px; background: #f6f5f0; }
.support-older-wrap { text-align: center; }
.support-text-button { border: 0; padding: 8px 2px; background: transparent; color: #8a6d3e; font-size: 12px; }
.support-text-button:hover:not(:disabled) { color: #5e4826; text-decoration: underline; text-underline-offset: 3px; }
.support-empty, .support-offline { text-align: center; padding: 22px 6px 24px; }
.support-empty-mark { display: block; width: 56px; margin: 0 auto 14px; }
.support-empty-mark .support-avatar { width: 56px; height: 56px; box-shadow: 0 12px 30px rgba(11, 16, 15, .18); border-radius: 50%; }
.support-empty h3, .support-offline h3 { margin: 6px 0 10px; font: 600 20px/1.5 var(--sans); }
.support-empty p, .support-offline p { margin: 0; color: #5e6966; font-size: 12px; line-height: 1.9; }
.support-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.support-topics button { padding: 6px 14px; border: 1px solid #dcdad0; border-radius: 999px; background: #fff; color: #1a2422; font-size: 12px; }
.support-topics button:hover { border-color: #b9945c; }
.support-offline-list { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 6px 14px; margin: 16px 0 0; font-size: 14px; }
.support-offline-list dt { color: #5e6966; }
.support-offline-list dd { margin: 0; font-weight: 600; text-align: left; }
.support-offline-list a { color: #1a2422; }
.support-messages { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.support-time { align-self: center; margin: 14px 0 8px; padding: 2px 10px; border-radius: 10px; background: rgba(15, 22, 21, .045); color: #8a908a; font-size: 11px; }
.support-message { display: flex; align-items: flex-end; gap: 8px; }
.support-message.is-first { margin-top: 8px; }
.support-message-avatar { flex: none; align-self: flex-start; width: 28px; height: 28px; }
.support-message-avatar .support-avatar { width: 28px; height: 28px; }
.support-message.is-visitor { justify-content: flex-end; }
.support-message-bubble { max-width: min(80%, 560px); margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 6px; background: #fff; border: 1px solid #e9e7df; box-shadow: 0 1px 2px rgba(15, 22, 21, .04); color: #1a2422; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.is-visitor .support-message-bubble { border-radius: 16px 16px 6px 16px; border-color: #0f1615; background: #0f1615; color: #f3efe4; }
.support-error { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 24px; color: #98432e; background: #fdf2ea; font-size: 12px; }
.support-error p { margin: 0; }
.support-error button { flex: none; border: 0; padding: 6px 0; color: #98432e; background: transparent; font-weight: 600; }
.support-composer { padding: 12px 16px 12px; border-top: 1px solid #ecebe4; background: #fff; }
.support-field { display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 16px; border: 1px solid #dcdad0; border-radius: 24px; background: #f6f5f0; transition: border-color .2s, box-shadow .2s, background .2s; }
.support-field:focus-within { border-color: #b9945c; background: #fff; box-shadow: 0 0 0 4px rgba(185, 148, 92, .14); }
.support-composer textarea { flex: 1; min-width: 0; height: 40px; min-height: 40px; max-height: 140px; resize: none; margin: 0; padding: 9px 0; border: 0; background: transparent; color: #1a2422; line-height: 1.6; outline: none; }
.support-composer textarea::placeholder { color: #9a9f97; }
.support-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #0f1615; color: #f3efe4; transition: background .2s, transform .2s; }
.support-send svg { width: 19px; height: 19px; margin: 1px 1px 0 0; }
.support-send:hover:not(:disabled) { background: #1a2422; transform: translateY(-1px); }
.support-chat .support-send:disabled { opacity: 1; background: #dcdad0; color: #fff; }
.support-send.is-busy svg { animation: support-typing 1s ease-in-out infinite; }
.support-composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-top: 4px; padding: 0 6px; font-size: 11px; color: #9a9f97; }
.support-primary { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 42px; padding: 0 20px; border: 1px solid #0f1615; border-radius: 999px; background: #0f1615; color: #f3efe4; font-weight: 500; letter-spacing: .04em; }
.support-primary:hover:not(:disabled) { background: #1a2422; }
.support-feedback { margin: 8px 0 0; color: #496647; font-size: 12px; }
.support-feedback:empty { display: none; }

/* 在线客服没开通：不摆一个用不了的输入框。 */
.support-chat.is-unavailable .support-composer { display: none; }
.support-chat.is-widget.is-unavailable { height: auto; }
.is-widget.is-unavailable .support-history { flex: none; padding-bottom: 28px; }

/* —— 客服不在线时的“留个联系方式”小卡片：盖在对话框下半部分 —— */
.support-chat.has-contact::after { content: ""; position: absolute; inset: 0; z-index: 2; background: rgba(11, 16, 15, .32); border-radius: inherit; }
.support-contact { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px; padding: 18px 18px 14px; border: 1px solid #e6e4dc; border-radius: 16px; background: #fffdf8; box-shadow: 0 18px 50px rgba(11, 16, 15, .22); }
.support-contact-title { margin: 0; font: 600 16px/1.5 var(--sans); }
.support-contact-lead { margin: 2px 0 12px; color: #5e6966; font-size: 12px; }
.support-contact label { display: block; margin: 8px 0 4px; font-size: 12px; color: #1a2422; }
.support-contact label span { color: #8a908a; }
.support-contact input, .support-contact textarea { display: block; width: 100%; min-height: 42px; margin: 0; padding: 8px 12px; border: 1px solid #dcdad0; border-radius: 10px; background: #fff; color: #1a2422; font: inherit; font-size: 15px; }
.support-contact textarea { min-height: 76px; max-height: 140px; resize: none; line-height: 1.6; }
.support-contact textarea:disabled { color: #8a908a; background: #f4f2ea; }
.support-contact input:focus, .support-contact textarea:focus { border-color: #b9945c; outline: none; box-shadow: 0 0 0 3px rgba(185, 148, 92, .18); }
.support-contact-feedback { margin: 8px 0 0; min-height: 1.6em; color: #98432e; font-size: 12px; }
.support-contact-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }

/* —— 滑块验证 —— */
.support-captcha { width: min(366px, calc(100% - 28px)); border: 1px solid #dcdad0; padding: 22px; border-radius: 16px; color: #1a2422; background: #fffdf8; box-shadow: 0 24px 90px rgba(0, 0, 0, .2); }
.support-captcha::backdrop { background: rgba(7, 12, 11, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.support-captcha-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.support-captcha-heading h2 { margin: 0; font: 600 17px/1.5 var(--sans); }
.support-captcha-heading button { width: 32px; min-height: 36px; border: 0; background: transparent; color: #5e6966; font-size: 26px; }
.support-captcha-text { margin: 8px 0 0; font-size: 12px; color: #5e6966; line-height: 1.8; }
.support-captcha-image { display: block; width: 100%; height: auto; background: #edece5; margin: 16px 0 12px; border-radius: 8px; }
.support-captcha label { display: block; font-size: 12px; }
.support-captcha label span { display: block; color: #8a908a; font-size: 11px; }
.support-captcha-offset { display: block; width: 100%; height: 40px; accent-color: #0f1615; }
.support-captcha-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }

/* —— 小弹窗 —— */
.support-chat.is-widget { position: fixed; z-index: 91; right: max(24px, calc(env(safe-area-inset-right) + 12px)); bottom: calc(92px + env(safe-area-inset-bottom)); width: 372px; height: min(580px, calc(100dvh - 128px - env(safe-area-inset-bottom))); border: 1px solid rgba(15, 22, 21, .1); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(11, 16, 15, .28); transform-origin: bottom right; animation: support-pop .28s var(--ease); }
.support-chat.is-widget[hidden] { display: none; }
.is-widget .support-heading { padding: 14px 14px 14px 16px; gap: 12px; }
.is-widget .support-heading .support-avatar { width: 40px; height: 40px; }
.is-widget .support-heading h2 { font-size: 16px; }
.is-widget .support-history { padding: 12px 16px 16px; }
.is-widget .support-empty { padding: 14px 4px 10px; }
.is-widget .support-empty-mark, .is-widget .support-empty-mark .support-avatar { width: 48px; height: 48px; }
.is-widget .support-empty h3, .is-widget .support-offline h3 { font-size: 17px; }
.is-widget .support-error { padding: 8px 16px; }
.is-widget .support-composer { padding: 10px 12px 12px; }
.is-widget .support-primary { min-height: 38px; padding: 0 18px; }

/* —— 整页 /support —— */
.support-page { background: #f6f5f0; font-size: 14px; }
.support-page button, .support-page textarea, .support-page input { font: inherit; }
.support-site-header { max-width: 1040px; margin: auto; padding: 24px 28px; display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.support-site-header a { text-decoration: none; }
.support-site-brand { font-size: 19px; font-weight: 600; color: #0f1615; }
.support-site-header > a:last-child { font-size: 13px; color: #5e6966; }
.support-main { width: min(820px, calc(100% - 48px)); margin: 6px auto 30px; }
.support-conversation { border: 1px solid #dcdad0; border-radius: 22px; box-shadow: 0 16px 60px rgba(25, 46, 35, .05); overflow: hidden; }
.support-conversation .support-history { height: clamp(280px, 46vh, 540px); flex: none; }
.support-privacy-note { text-align: center; margin-top: 14px; font-size: 11px; color: #8a908a; }
.support-privacy-note a { color: #5e6966; text-underline-offset: 3px; }
.support-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; max-width: 1000px; margin: auto; padding: 0 24px 28px; color: #8a908a; font-size: 10px; }
.support-footer a { text-decoration: none; }
.support-noscript { padding: 20px 28px; color: #98432e; }

@keyframes support-typing { 0%, 60%, 100% { opacity: .45; } 30% { opacity: 1; } }
@keyframes support-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 680px) {
  .support-fab { right: max(16px, calc(env(safe-area-inset-right) + 8px)); bottom: calc(16px + env(safe-area-inset-bottom)); }
  .support-fab .support-avatar { width: 50px; height: 50px; }
  .support-fab-label { display: none; }
  /* 手机上弹窗从底部升起，占满宽度；顶部留出网页导航。 */
  .support-chat.is-widget { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: min(640px, calc(100dvh - 72px - env(safe-area-inset-bottom))); border-radius: 18px; transform-origin: bottom center; }
  .support-widget.is-open .support-fab { display: none; }
  .support-composer textarea, .support-contact input, .support-contact textarea { font-size: 16px; }
  .support-site-header { padding: 18px 20px; }
  .support-site-brand { font-size: 16px; }
  .support-main { width: calc(100% - 24px); margin-top: 0; margin-bottom: 24px; }
  .support-conversation { border-radius: 16px; }
  .support-conversation .support-heading { padding: 16px 18px; }
  .support-conversation .support-history { height: clamp(240px, 42dvh, 440px); padding: 12px 16px 20px; }
  .support-conversation .support-composer { padding: 12px 16px 14px; }
  .support-empty p br { display: none; }
  .support-message-bubble { max-width: 92%; }
  .support-error { padding: 9px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .support-avatar-dots circle, .support-chat.is-widget { animation: none; }
}
