/* ============================================================
 * AI零工网 · 四大新增模块统一样式
 * 城市切换 / 会员账号 / 悬浮客服 / GEO 体检
 * 全部复用站点 CSS 变量，自动跟随 html[data-theme] 明暗切换
 * ============================================================ */

/* ---------- 1. 城市切换 ---------- */
.city-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: var(--panel); color: var(--text-2);
  border: 1px solid var(--line); font-size: 13px;
  transition: .2s; white-space: nowrap;
}
.city-trigger:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.city-trigger svg { width: 15px; height: 15px; flex-shrink: 0; }
.city-trigger b { color: var(--brand); font-weight: 700; }
.brand-area .city-trigger { height: 36px; padding: 0 10px; background: var(--brand-soft); border-color: transparent; }
.brand-area .city-trigger:hover { border-color: var(--brand); }

.city-mask { position: fixed; inset: 0; z-index: 160;
  background: rgba(8, 15, 28, .55); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.city-mask[hidden] { display: none; }
.city-modal {
  --xsd-accent: var(--brand);
  width: min(760px, 100%); max-height: min(86vh, 720px);
  display: flex; flex-direction: column;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.cm-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px;
  background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.cm-title { flex: 1; font-size: 17px; font-weight: 800; }
.cm-sub { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 8px; }
.cm-sub b { color: var(--brand); }
.cm-close { background: var(--panel); border: 1px solid var(--line); color: var(--text-2);
  font-size: 15px; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; transition: .2s; }
.cm-close:hover { color: var(--brand); border-color: var(--brand); }
.cm-body { padding: 18px 22px 22px; overflow-y: auto; }
.cm-search { display: flex; align-items: center; gap: 9px;
  background: var(--bg-soft); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 13px; }
.cm-search:focus-within { border-color: var(--brand); }
.cm-search span { color: var(--brand); }
.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(--text-3); }
.cm-result { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.cm-nores { color: var(--text-3); font-size: 13px; padding: 8px 2px; }
.cm-sec { margin-top: 18px; }
.cm-sec h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--text); }
.cm-sec h4 small { font-weight: 400; color: var(--text-3); 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: 99px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); transition: .18s; }
.cm-pill:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.cm-pill.on { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }
.cm-pill.q-green { color: var(--cyan); border-color: var(--cyan); }
.cm-pill.q-blue { color: var(--brand); border-color: var(--brand); }
.cm-res-prov { font-style: normal; font-size: 11px; opacity: .7; margin-left: 4px; }
.cm-prov-cities { margin-top: 11px; padding: 12px; border-radius: 12px;
  background: var(--panel-2); display: flex; flex-wrap: wrap; gap: 8px; }
.cm-prov-name { width: 100%; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.cm-foot { padding: 12px 22px; font-size: 12.5px; color: var(--text-2);
  background: var(--panel-2); border-top: 1px solid var(--line); }
.cm-foot b { color: var(--brand); }
.cm-toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  z-index: 210; padding: 10px 20px; border-radius: 22px;
  background: var(--text); color: var(--panel); font-size: 13.5px;
  box-shadow: var(--shadow-lg); }
.cm-toast[hidden] { display: none; }

/* ---------- 2. 悬浮客服 ---------- */
.sf-wrap {
  --xsd-brand: var(--brand); --xsd-brand-deep: var(--purple);
  --xsd-brand-soft: var(--brand-soft); --xsd-brand-border: var(--line);
  --xsd-accent: var(--cyan);
  position: fixed; right: 22px; bottom: 92px; z-index: 118;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none; /* 容器透明但范围大，不能拦截页面按钮点击 */
}
.sf-fab, .sf-panel, .sf-chatbox { pointer-events: auto; }
.sf-fab { width: 54px; height: 54px; border-radius: 17px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .4); transition: .25s; }
.sf-fab:hover { transform: translateY(-3px); }
.sf-fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sf-fab.on { transform: rotate(90deg); }
.sf-panel { width: 180px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.96);
  transform-origin: bottom right; transition: .2s; }
.sf-panel.open { opacity: 1; visibility: visible; transform: none; }
.sf-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  border-bottom: 1px solid var(--line-2); transition: .16s; }
.sf-item:last-child { border-bottom: 0; }
.sf-item:hover { background: var(--brand-soft); color: var(--brand); }
.sf-item .ico { width: 24px; text-align: center; font-size: 15px; color: var(--brand); }
.sf-contact-line { width: 100%; text-align: left; text-decoration: none; background: var(--panel); font-family: inherit; }
.sf-contact-line > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.sf-contact-line small { font-size: 10px; color: var(--text-3); }
.sf-contact-line b { font-size: 12.5px; color: var(--brand); letter-spacing: .2px; }
.sf-chatbox { width: 350px; max-width: calc(100vw - 36px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transform-origin: bottom right; transition: .22s; }
.sf-chatbox.open { opacity: 1; visibility: visible; transform: none; }
.sf-chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  background: var(--grad); color: #fff; }
.sf-chat-head .ava { width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.22); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; }
.sf-chat-head .ttl { flex: 1; font-size: 14px; font-weight: 700; }
.sf-chat-head .cls { cursor: pointer; font-size: 17px; opacity: .85; }
.sf-chat-body { height: 280px; overflow-y: auto; padding: 14px;
  background: var(--bg-soft); }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 13px; font-size: 13px;
  line-height: 1.7; margin-bottom: 10px; white-space: pre-wrap; }
.msg.bot { background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-bottom-left-radius: 4px; }
.msg.user { background: var(--grad); color: #fff; margin-left: auto;
  border-bottom-right-radius: 4px; }
.msg-row { display: flex; align-items: flex-start; gap: 8px; }
.chat-avatar { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800;
  display: grid; place-items: center; margin-top: 3px; }
.sf-chat-foot { padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.sf-chat-foot input { width: 100%; height: 38px; border: 1px solid var(--line);
  background: var(--bg-soft); border-radius: 9px; padding: 0 12px; outline: 0;
  color: var(--text); font-size: 16px; }
.sf-chat-foot input:focus { border-color: var(--brand); }
.sf-send { margin-top: 8px; width: 100%; height: 36px; border-radius: 9px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 10px;
  background: var(--panel); }
.chip-q { padding: 4px 9px; border-radius: 99px; font-size: 11px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line); cursor: pointer; }
.chip-q:hover { border-color: var(--brand); }

/* ---------- 3. 会员账号弹窗 ---------- */
.auth-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); margin: 20px 0 4px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700;
  color: var(--text-3); transition: .2s; }
.auth-tab.active { background: var(--panel); color: var(--brand); box-shadow: var(--shadow); }
.auth-box { display: none; }
.auth-box.active { display: block; animation: fadeUp .25s ease; }
.auth-msg { min-height: 18px; margin-top: 10px; font-size: 12px; color: #e11d48; }
.auth-msg.ok { color: #16a34a; }
.auth-identity { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-identity button { padding: 8px 14px; border-radius: 9px; font-size: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2); }
.auth-identity button.on { border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand); font-weight: 700; }
.auth-benefit { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.auth-benefit span { padding: 6px 12px; border-radius: 8px; font-size: 11px;
  background: var(--brand-soft); color: var(--brand); }
.auth-foot-note { margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); font-size: 11px; color: var(--text-3); line-height: 1.7; }

/* ---------- 4. GEO 体检 ---------- */
.geo-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 20px; }
.geo-card { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; }
.geo-score-wrap { display: flex; align-items: center; gap: 24px; margin: 8px 0 22px; }
.geo-ring { width: 132px; height: 132px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(closest-side, var(--panel) 79%, transparent 80% 100%),
              conic-gradient(var(--brand) 0 var(--p, 0%), var(--purple) var(--p, 0%) calc(var(--p, 0%) + 4%), var(--line) 0);
  transition: --p .8s ease; }
.geo-ring b { font-size: 34px; font-weight: 800; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.geo-ring small { position: absolute; bottom: 26px; font-size: 10px; color: var(--text-3); }
.geo-level { font-size: 18px; font-weight: 800; }
.geo-level em { display: inline-block; margin-left: 8px; padding: 3px 10px;
  border-radius: 99px; font-size: 11px; font-style: normal;
  background: var(--brand-soft); color: var(--brand); }
.geo-desc { font-size: 12px; color: var(--text-2); line-height: 1.8; margin-top: 8px; }
.geo-checks { list-style: none; display: grid; gap: 8px; }
.geo-checks li { display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--panel-2);
  font-size: 12px; color: var(--text-2); }
.geo-checks i { width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; }
.geo-checks li.ok i { background: var(--brand-soft); color: var(--brand); }
.geo-checks li.no i { background: #fee2e2; color: #dc2626; }
html[data-theme="dark"] .geo-checks li.no i { background: rgba(220,38,38,.22); color: #fca5a5; }
.geo-checks b { color: var(--text); display: block; }
.geo-checks small { color: var(--text-3); font-size: 11px; }
.geo-code-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.geo-code-tabs button { padding: 7px 13px; border-radius: 8px; font-size: 12px;
  color: var(--text-3); border: 1px solid var(--line); background: var(--panel); }
.geo-code-tabs button.active { color: var(--brand); border-color: var(--brand);
  background: var(--brand-soft); font-weight: 700; }
.geo-code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; max-height: 290px; overflow: auto; font-family: Consolas, Monaco, monospace;
  font-size: 11.5px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; word-break: break-all; }
.geo-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.geo-note { margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--brand-soft); font-size: 11.5px; color: var(--text-2); line-height: 1.8; }
.geo-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.geo-step { padding: 16px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); }
.geo-step span { font-size: 10px; font-weight: 800; color: var(--brand); }
.geo-step b { display: block; font-size: 13px; margin: 6px 0 5px; }
.geo-step p { font-size: 11px; color: var(--text-3); line-height: 1.7; }

@media (max-width: 900px) {
  .brand-area { gap: 6px; }
  .brand-sep { display: none; }
  .brand-area .city-trigger { height: 34px; padding: 0 8px; font-size: 12px; }
  .geo-grid { grid-template-columns: 1fr; }
  .sf-wrap { right: 14px; bottom: 76px; }
}
@media (max-width: 640px) {
  .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 - 140px); }
  .cm-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .geo-steps { grid-template-columns: 1fr; }
  .geo-score-wrap { gap: 16px; }
  .geo-ring { width: 106px; height: 106px; }
  .geo-ring b { font-size: 27px; }
  .sf-chatbox { max-width: calc(100vw - 28px); }
}
