/* 中国物流网 · 新增模块样式（城市切换 / 悬浮客服 / GEO 体检 / 会员中心）
   全部复用站点主题变量：白色主色、明暗双主题自动适配 */

/* ============ 城市切换：顶栏触发按钮（贴近 logo） ============ */
#cityTrigger {
  display: inline-flex; align-items: center; gap: 5px;
  flex: none; padding: 5px 11px; margin-left: 6px;
  font-size: 13px; font-weight: 650; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px;
  cursor: pointer; transition: .18s; white-space: nowrap; line-height: 1;
}
#cityTrigger:hover { color: var(--brand); border-color: var(--brand); }
#cityTrigger .ct-ico { color: var(--brand); font-size: 13px; }
#cityTrigger b { color: var(--brand); font-weight: 700; }
@media (max-width: 720px) { #cityTrigger { font-size: 12px; padding: 4px 9px; margin-left: 4px; } #cityTrigger .ct-label { display: none; } }

/* 城市弹窗（主题色统一为站点蓝） */
.city-mask { position: fixed; inset: 0; z-index: 9998; background: rgba(9, 20, 38, .5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.city-mask[hidden] { display: none; }
.city-modal {
  --xsd-brand: var(--brand); --xsd-brand-deep: var(--brand-dark);
  --xsd-brand-soft: var(--brand-soft); --xsd-brand-border: var(--border);
  --xsd-accent: #f5b34c;
  width: min(760px, 100%); max-height: min(86vh, 720px); display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--xsd-brand-deep) 0%, color-mix(in srgb, var(--xsd-brand-deep) 55%, var(--xsd-brand)) 55%, var(--xsd-brand) 100%);
  color: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.cm-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.14); }
.cm-title { flex: 1; font-size: 17px; font-weight: 700; }
.cm-sub { font-size: 12px; font-weight: 400; opacity: .82; margin-left: 8px; }
.cm-sub b { color: var(--xsd-accent); }
.cm-close { background: rgba(255,255,255,.14); border: 0; color: #fff; font-size: 15px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.cm-close:hover { background: rgba(255,255,255,.26); }
.cm-body { padding: 16px 22px 20px; overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 14px 14px 0 0; margin-top: 0; }
.cm-search { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 13px; }
.cm-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-size: 14px; }
.cm-search input::placeholder { color: var(--muted); }
.cm-result { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.cm-nores { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.cm-sec { margin-top: 16px; }
.cm-sec h4 { margin: 0 0 9px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.cm-sec h4 small { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 11px; }
.cm-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-pill { padding: 6px 13px; font-size: 13px; border-radius: 20px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); transition: .16s; }
.cm-pill:hover { border-color: var(--brand); color: var(--brand); }
.cm-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.cm-pill.q-green { border-color: var(--green); color: var(--green); }
.cm-pill.q-blue { border-color: var(--brand); color: var(--brand); }
.cm-pill.on.q-blue { color: #fff; } /* 选中态蓝底白字，避免 q-blue 覆盖导致文字隐形 */
.cm-res-prov { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; }
.cm-prov-cities { margin-top: 11px; padding: 12px; border-radius: 11px; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 8px; }
.cm-prov-name { width: 100%; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cm-foot { padding: 12px 22px; font-size: 12.5px; background: rgba(0,0,0,.18); opacity: .95; }
.cm-foot b { color: var(--xsd-accent); }
.cm-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 9999;
  padding: 10px 20px; border-radius: 22px; background: var(--text); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-lg); }
.cm-toast[hidden] { display: none; }
@media (max-width: 768px) {
  .city-mask { padding: 0; align-items: flex-end; }
  .city-modal { width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; }
  .cm-body { max-height: calc(88vh - 130px); }
  .cm-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  #cityTrigger { font-size: 13px; }
}

/* ============ 悬浮客服：圆形图标 + 正下方回到顶部 ============ */
.float-stack { position: fixed; right: 24px; bottom: 24px; z-index: 70; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* 圆形客服图标（替代原来的胶囊形 fab）：强制回到 flex 流内，确保与回顶按钮同心 */
.float-stack .ai-fab {
  position: relative; right: auto; bottom: auto; align-self: center;
  width: 56px; height: 56px; border-radius: 50%; padding: 0; gap: 0;
  background: linear-gradient(135deg, var(--brand), var(--cyan)); color: #fff; border: 0;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 35%, transparent);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .22s ease, box-shadow .22s ease;
}
.float-stack .ai-fab svg { width: 26px; height: 26px; }
.float-stack .ai-fab:hover { transform: translateY(-3px); box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 45%, transparent); }
.float-stack .ai-fab .ai-fab-pulse { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--cyan); opacity: .5; animation: pulse 2.4s infinite; }
.float-stack .ai-fab .ai-fab-text { display: none; } /* 改为纯圆形图标 */
/* 回到顶部：正下方、同中心、不偏不移 */
.sf-top {
  align-self: center; width: 44px; height: 44px; border-radius: 50%; flex: none; cursor: pointer;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; transition: .2s;
}
.sf-top:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.sf-top svg { width: 22px; height: 22px; }
/* 智能客服面板默认在悬浮球上方展开 */
.ai-panel { right: 24px; bottom: 150px; }
/* 面板内快捷动作（拨号 / 微信 / 会员） */
.ai-panel-tools { display: flex; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.ai-panel-tools .tool-btn { flex: 1; min-width: 84px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; transition: .18s; }
.ai-panel-tools .tool-btn:hover { border-color: var(--brand); color: var(--brand); }
.ai-panel-tools .tool-btn .ti { font-size: 14px; }
@media (max-width: 720px) {
  .float-stack { right: 14px; bottom: 80px; gap: 10px; width: 50px; }
  .float-stack .ai-fab { width: 50px; height: 50px; right: auto; bottom: auto; }
  .float-stack .ai-fab svg { width: 24px; height: 24px; }
  .sf-top { width: 40px; height: 40px; }
  .ai-panel { right: 12px; bottom: 188px; width: calc(100vw - 24px); height: min(480px, calc(100vh - 250px)); }
  .mobile-tabbar ~ .float-stack { bottom: 80px; }
}

/* ============ 会员中心 ============ */
.auth-wrap { width: min(620px, 100%); margin: 0 auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 650; padding: 10px; border-radius: 9px; transition: .18s; }
.auth-tabs button.on { background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(20,50,100,.1); }
.auth-box { display: none; } .auth-box.on { display: block; }
.form-msg { display: none; font-size: 13px; margin: 4px 0 10px; padding: 9px 12px; border-radius: 9px; }
.form-msg.ok { display: block; color: var(--green); background: var(--green-soft); }
.form-msg.err { display: block; color: var(--red); background: var(--red-soft); }
.auth-hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; line-height: 1.7; }
.member-dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.member-dash .kpi { text-align: center; }
.member-info { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.member-info dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 14px; }
.member-info dt { color: var(--muted); } .member-info dd { margin: 0; font-weight: 600; color: var(--text); }
.badge-role { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.badge-role.admin { background: var(--purple-soft); color: var(--purple); }
@media (max-width: 720px) { .member-dash { grid-template-columns: 1fr; } }

/* GEO 体检弹窗 */
.geo-score-ring { width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 6px; position: relative; background: conic-gradient(var(--brand) calc(var(--p,0)*1%), var(--surface-3) 0); }
.geo-score-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--surface); }
.geo-score-ring b { position: relative; font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1; }
.geo-score-ring small { position: relative; font-size: 12px; color: var(--muted); }
.geo-list { display: grid; gap: 10px; margin-top: 18px; }
.geo-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.geo-item .gi-ico { width: 26px; height: 26px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.geo-item.ok .gi-ico { background: var(--green-soft); color: var(--green); }
.geo-item.no .gi-ico { background: var(--red-soft); color: var(--red); }
.geo-item .gi-body b { display: block; font-size: 14px; } .geo-item .gi-body small { color: var(--muted); font-size: 12px; }
.geo-level { text-align: center; font-weight: 700; margin-top: 4px; }
