/* ============================================================================
 * AutoMind 官网 · 客服 + 支付 UI 样式
 * 变量沿用 assets/style.css 的 :root；此处只补充本模块需要的局部变量。
 * ==========================================================================*/
:root {
  --am-bg: #ffffff;
  --am-fg: #0f172a;
  --am-mut: #64748b;
  --am-line: rgba(15, 23, 42, .1);
  --am-brand: #2563eb;
  --am-brand-2: #7c3aed;
  --am-ok: #16a34a;
  --am-bad: #dc2626;
  --am-qq: #12b7f5;
  --am-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  --am-radius: 16px;
}
html[data-theme="dark"] {
  --am-bg: #0f1623;
  --am-fg: #e6edf7;
  --am-mut: #93a3b8;
  --am-line: rgba(255, 255, 255, .12);
  --am-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

body.am-lock { overflow: hidden; }

/* ---------------- 悬浮按钮 ---------------- */
.am-fab {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 9000;
}
.am-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 12px 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--am-brand), var(--am-brand-2));
  box-shadow: 0 10px 26px rgba(37, 99, 235, .38);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.am-fab-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37, 99, 235, .48); }
.am-fab-btn:active { transform: translateY(0) scale(.98); }
.am-fab-btn.is-open { opacity: 0; pointer-events: none; }
.am-fab-btn svg { flex: 0 0 auto; }
.am-fab-dot {
  position: absolute;
  top: 6px; right: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .25);
  animation: am-pulse 2.4s infinite;
}
@keyframes am-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .08); }
}

/* ---------------- 客服面板 ---------------- */
.am-support {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9100;
  width: min(360px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  background: var(--am-bg);
  color: var(--am-fg);
  border: 1px solid var(--am-line);
  border-radius: var(--am-radius);
  box-shadow: var(--am-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.am-support.in { opacity: 1; transform: none; pointer-events: auto; }

.am-support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--am-brand), var(--am-brand-2));
}
.am-support-head strong { display: block; font-size: 15px; }
.am-support-head small { display: block; margin-top: 3px; font-size: 11.5px; opacity: .85; }
.am-support-x {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 17px; line-height: 1;
  cursor: pointer;
}
.am-support-x:hover { background: rgba(255, 255, 255, .3); }

.am-support-body { padding: 14px 16px 6px; overflow-y: auto; }

.am-support-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(127, 127, 127, .1);
}
.am-support-tabs button {
  flex: 1;
  padding: 7px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--am-mut);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.am-support-tabs button.on {
  background: var(--am-bg);
  color: var(--am-fg);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
.am-tab { display: none; }
.am-tab.on { display: block; }

/* 二维码 */
.am-qr {
  position: relative;
  margin: 0 0 12px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--am-line);
  border-radius: 12px;
  background: #fff;
}
.am-qr img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}
.am-qr figcaption { margin-top: 8px; font-size: 11.5px; color: #64748b; line-height: 1.5; }
.am-qr-fallback { display: none; padding: 22px 8px; color: #64748b; font-size: 12px; }
.am-qr-fallback small { display: block; margin-top: 6px; opacity: .8; font-size: 11px; }
.am-qr.is-broken img, .am-qr.is-broken figcaption { display: none; }
.am-qr.is-broken .am-qr-fallback { display: block; }
.am-qr.small { max-width: 230px; margin-left: auto; margin-right: auto; }
.am-qr-empty {
  padding: 26px 12px;
  margin-bottom: 12px;
  text-align: center;
  border: 1px dashed var(--am-line);
  border-radius: 12px;
  color: var(--am-mut);
  font-size: 12.5px;
}
.am-qr-empty small { display: block; margin-top: 6px; font-size: 11px; opacity: .8; }

/* 账号行 */
.am-idrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 10px;
  border: 1px solid var(--am-line);
  border-radius: 10px;
  font-size: 12.5px;
}
.am-idlabel { color: var(--am-mut); flex: 0 0 auto; }
.am-id {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--am-fg);
  overflow-wrap: anywhere;
}
.am-mini {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--am-line);
  border-radius: 7px;
  background: transparent;
  color: var(--am-mut);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s;
}
.am-mini:hover { color: var(--am-brand); border-color: var(--am-brand); }
.am-mini.is-ok { color: var(--am-ok); border-color: var(--am-ok); }

/* 客服手机号 */
.am-phoneblock {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--am-line);
  text-align: center;
}
.am-phoneblock .am-idrow { margin-bottom: 8px; }
.am-id.am-tel {
  text-decoration: none;
  letter-spacing: .5px;
  color: var(--am-brand);
}
.am-id.am-tel:hover { text-decoration: underline; }
.am-btn-phone {
  width: 100%;
  margin-top: 2px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 1px solid rgba(37, 99, 235, .35);
  color: #fff;
  font-weight: 700;
}
.am-btn-phone:hover { filter: brightness(1.06); color: #fff; }
.am-phonetip {
  display: block;
  margin-top: 6px;
  color: var(--am-mut);
  font-size: 11.5px;
}

/* QQ */
.am-qq { text-align: center; padding: 6px 0 4px; color: var(--am-qq); }
.am-qq .am-idrow { color: var(--am-fg); text-align: left; }

/* 按钮 */
.am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.am-btn:active { transform: scale(.985); }
.am-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--am-brand), var(--am-brand-2));
  box-shadow: 0 8px 20px rgba(37, 99, 235, .3);
}
.am-btn-primary:hover { box-shadow: 0 10px 26px rgba(37, 99, 235, .42); }
.am-btn-primary[disabled] { opacity: .6; cursor: progress; box-shadow: none; }
.am-btn-qq { color: #fff; background: var(--am-qq); margin-top: 4px; }
.am-btn-block { display: flex; width: 100%; }

/* 表单 */
.am-form { display: grid; gap: 10px; }
.am-form label { display: grid; gap: 5px; font-size: 12px; color: var(--am-mut); }
.am-form input, .am-form textarea, .am-coupon input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--am-line);
  border-radius: 9px;
  background: transparent;
  color: var(--am-fg);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.am-form input:focus, .am-form textarea:focus, .am-coupon input:focus {
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 1px;
  border-color: var(--am-brand);
}
.am-form-msg { margin: 2px 0 0; font-size: 12px; line-height: 1.5; min-height: 1em; }
.am-form-msg.ok { color: var(--am-ok); }
.am-form-msg.bad { color: var(--am-bad); }
.am-mailrow { margin: 12px 0 6px; font-size: 12px; color: var(--am-mut); overflow-wrap: anywhere; }
.am-mailrow a { color: var(--am-brand); }

.am-support-foot {
  display: flex;
  gap: 14px;
  padding: 10px 16px 13px;
  border-top: 1px solid var(--am-line);
  font-size: 11.5px;
}
.am-link { color: var(--am-mut); text-decoration: none; }
.am-link:hover { color: var(--am-brand); }

/* ---------------- 通用弹窗 ---------------- */
.am-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s ease;
}
.am-modal.in { opacity: 1; }
.am-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 24, .58);
  backdrop-filter: blur(3px);
}
.am-modal-box {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px 24px 18px;
  background: var(--am-bg);
  color: var(--am-fg);
  border: 1px solid var(--am-line);
  border-radius: 18px;
  box-shadow: var(--am-shadow);
  transform: translateY(12px) scale(.98);
  transition: transform .2s ease;
}
.am-modal-box.wide { width: min(560px, 100%); }
.am-modal.in .am-modal-box { transform: none; }
.am-modal-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: rgba(127, 127, 127, .12);
  color: var(--am-mut);
  font-size: 19px; line-height: 1;
  cursor: pointer;
}
.am-modal-x:hover { background: rgba(127, 127, 127, .22); color: var(--am-fg); }
.am-modal-head { margin-bottom: 16px; padding-right: 32px; }
.am-modal-head h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.am-modal-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--am-mut); }
.am-hl { color: var(--am-brand); }

/* ---------------- 支付弹窗 ---------------- */
.am-pay { display: grid; gap: 14px; }
.am-pay-plans { display: grid; gap: 8px; }
.am-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--am-line);
  border-radius: 11px;
  background: transparent;
  color: var(--am-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.am-plan:hover { border-color: rgba(37, 99, 235, .5); }
.am-plan.on {
  border-color: var(--am-brand);
  background: rgba(37, 99, 235, .07);
  box-shadow: 0 0 0 1px var(--am-brand) inset;
}
.am-plan strong { flex: 1; font-size: 13.5px; font-weight: 600; }
.am-plan-price { font-size: 15px; font-weight: 800; color: var(--am-brand); }
.am-tag {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(127, 127, 127, .14);
  color: var(--am-mut);
  font-size: 10.5px;
  font-style: normal;
}
.am-pay-methods { display: grid; gap: 8px; }
.am-pay-lbl { font-size: 12px; color: var(--am-mut); }
.am-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.am-method {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--am-line);
  border-radius: 10px;
  background: transparent;
  color: var(--am-fg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.am-method .am-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--pc, #888);
}
.am-method.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, transparent); }

.am-coupon { display: flex; gap: 8px; }
.am-coupon input { flex: 1; }
.am-coupon-msg { margin: -6px 0 0; font-size: 11.5px; min-height: 1em; }
.am-coupon-msg.ok { color: var(--am-ok); }
.am-coupon-msg.bad { color: var(--am-bad); }

.am-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(37, 99, 235, .07);
  font-size: 13px;
  color: var(--am-mut);
}
.am-total b { font-size: 21px; font-weight: 800; color: var(--am-brand); }

.am-qr-pay { text-align: center; }
.am-qr-pay-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--am-mut);
}
.am-amount { font-size: 18px; color: var(--am-fg); }
.am-payee { margin: 8px 0 0; font-size: 11.5px; color: var(--am-mut); }
.am-afterpay { margin: 10px 0 0; font-size: 12px; color: var(--am-mut); line-height: 1.6; }
.am-qr-text {
  padding: 12px;
  border: 1px dashed var(--am-line);
  border-radius: 10px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.am-orderid { margin: 8px 0 0; font-size: 11px; color: var(--am-mut); font-family: ui-monospace, monospace; }

.am-bank {
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--am-line);
  border-radius: 11px;
  font-size: 12.5px;
}
.am-bank summary { cursor: pointer; color: var(--am-fg); font-weight: 600; }
.am-bank summary small { font-weight: 400; color: var(--am-mut); margin-left: 6px; }
.am-bank ul { margin: 9px 0 0; padding-left: 16px; color: var(--am-mut); line-height: 1.8; }
.am-bank code { color: var(--am-fg); font-size: 12.5px; }

.am-verify { margin-top: 14px; text-align: left; }

.am-policies {
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  color: var(--am-mut);
}
.am-agree { margin: 0; font-size: 11px; color: var(--am-mut); }
.am-agree a { color: var(--am-brand); }
.am-wait { text-align: center; font-size: 12.5px; color: var(--am-mut); }
.am-paid {
  padding: 16px;
  border-radius: 12px;
  background: rgba(22, 163, 74, .1);
  color: var(--am-ok);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}
.am-licence {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(127, 127, 127, .1);
}
.am-licence code {
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--am-fg);
  overflow-wrap: anywhere;
}

/* ---------------- 订单查询页 ---------------- */
.am-order { display: grid; gap: 18px; }
.am-order-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.am-order-form label { flex: 1 1 260px; }
.am-order-result { min-height: 40px; }
.am-order-card {
  padding: 18px 20px;
  border: 1px solid var(--am-line);
  border-radius: 14px;
  background: var(--am-bg);
}
.am-order-id { font-family: ui-monospace, monospace; font-size: 13px; color: var(--am-mut); margin-bottom: 10px; }
.am-order-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--am-line);
  font-size: 13px;
}
.am-order-row span { color: var(--am-mut); }
.am-order-row b { font-weight: 600; }
.am-order-tip { margin: 12px 0 0; font-size: 12px; color: var(--am-mut); }
.st-pending { color: #d97706; }
.st-paid { color: var(--am-ok); }
.st-closed, .st-refunded { color: var(--am-mut); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .am-fab { right: 14px; bottom: 74px; }
  .am-fab-txt { display: none; }
  .am-fab-btn { padding: 13px; border-radius: 50%; }
  .am-support { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 82vh; }
  .am-modal { padding: 10px; align-items: flex-end; }
  .am-modal-box { padding: 20px 16px 14px; border-radius: 16px; }
  .am-plan { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .am-fab-dot { animation: none; }
  .am-support, .am-modal, .am-modal-box, .am-fab-btn { transition: none; }
}
