/* ============================================================================
   定位选点面板 —— **两端共用的一份样式**（网页版和手机端都加载它）
   ----------------------------------------------------------------------------
   跟 share.css 同一个理由：定位面板是「两端长得一样、行为也一样」的组件，
   写成两份必然慢慢分家（上一次定位散在七八处、集体失效却没人说得清为什么，
   就是分家的结果）。所以一份 CSS + 一份 loc.js，两端 base 都引。
   ⚠️ 配套改动：scripts/audit_css.py 的 SHARED_CSS 里已经登记本文件，
      否则模板一用它的类名就会被判成「模板在用、样式没定义」。
   只用 :root 里的**公共令牌**（那 47 个由 audit_mobile_tokens 盯着逐字相同）。
   ============================================================================ */

.lc-mask {
  position: fixed; inset: 0; z-index: 320;
  background: rgba(26, 26, 29, .46);
  display: flex; align-items: flex-end; justify-content: center;
  animation: lc-fade .16s var(--ease-out);
}
.lc-sheet {
  width: 100%; max-width: 460px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-2);
  padding: 14px 16px calc(14px + var(--safe-b, env(safe-area-inset-bottom, 0px)));
  animation: lc-up .22s var(--ease-out);
}
@keyframes lc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lc-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.lc-head { display: flex; align-items: center; gap: 8px; }
.lc-title {
  font-family: var(--f-display); font-weight: 700; font-size: 16px; color: var(--ink);
}
.lc-x {
  margin-left: auto; width: 32px; height: 32px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--surface-2); color: var(--ink-2);
  border-radius: var(--r-pill); cursor: pointer;
}
.lc-x .ic { width: 16px; height: 16px; }

/* 状态行：定位中 / 定到的地址 / 定不到的人话原因。
   「定不到」不是错误提示条，是**如实说明 + 给出下一步**（手输地址搜）——
   旧版这里直接空白，用户只会以为功能坏了。 */
.lc-status {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 10px 0 0; padding: 9px 11px;
  background: var(--surface-2); border-radius: var(--r);
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.lc-status .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--brand); }
.lc-status.is-bad .ic { color: var(--coral); }
.lc-status.is-bad { color: var(--ink); }
.lc-status b { font-weight: 600; color: var(--ink); }

.lc-search { display: flex; gap: 8px; margin: 10px 0 4px; }
.lc-input {
  flex: 1 1 auto; min-width: 0;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  font-family: var(--f-sans); font-size: 14px;
  outline: none;
}
.lc-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lc-go {
  flex: 0 0 auto; height: 38px; padding: 0 16px;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--brand); color: #fff;
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
}
.lc-go:disabled { background: var(--surface-2); color: var(--ink-3); cursor: default; }

.lc-list {
  flex: 1 1 auto; min-height: 96px;
  overflow-y: auto; overscroll-behavior: contain;
  margin: 6px -4px 0; padding: 0 4px;
}
.lc-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer;
  font-family: var(--f-sans);
}
.lc-item:last-child { border-bottom: 0; }
.lc-item:active { background: var(--surface-2); }
.lc-item .lc-ico {
  flex: 0 0 auto; width: 28px; height: 28px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-deep);
}
.lc-item .lc-ico .ic { width: 15px; height: 15px; }
.lc-item .lc-tx { flex: 1 1 auto; min-width: 0; }
.lc-item .lc-nm {
  font-size: 14px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-item .lc-ad {
  margin-top: 2px; font-size: 12px; color: var(--ink-3); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-item .lc-km { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.lc-empty {
  padding: 22px 12px; text-align: center;
  font-size: 13px; line-height: 1.6; color: var(--ink-3);
}
.lc-foot { display: flex; gap: 8px; margin-top: 10px; }
.lc-btn {
  flex: 1 1 0; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface); color: var(--ink);
  font-family: var(--f-sans); font-size: 14px; font-weight: 500;
}
.lc-btn .ic { width: 16px; height: 16px; }
.lc-btn:active { background: var(--surface-2); }
.lc-btn.is-pri { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.lc-btn:disabled { color: var(--ink-4); cursor: default; }

/* 转圈：定位是「点了要马上有反应」的动作，超过 300ms 没有视觉反馈
   用户就会连点（连点＝配额白烧，见服务端限流那条注释）。 */
.lc-spin {
  width: 14px; height: 14px; flex: 0 0 auto;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  border-radius: 50%; animation: lc-spin .7s linear infinite;
}
@keyframes lc-spin { to { transform: rotate(360deg); } }

/* 触发按钮的通用形态（首页城市牌 / 输入框右侧 / 发布页那一行都用它） */
.lc-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--f-sans); font-size: 13px; cursor: pointer;
}
.lc-trigger .ic { width: 15px; height: 15px; color: var(--brand); }
.lc-trigger.is-on { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-deep); }
.lc-trigger.is-on .ic { color: var(--brand-deep); }

/* ---- 位置卡（聊天气泡里发出去的那张「地点」） ----
   两端同一份样式：网页版聊天气泡、App 聊天气泡、订单页商榷/行动气泡都吃它。
   ⚠️ 只许用两端都有的那 47 个 :root token（scripts/audit_mobile_tokens.py 会拦）。
   整张卡可点进高德（T25 卡片口径：能点就必须真能点），没有 url 就退化成不可点的
   span —— 宁可少一个链接，也不给一张点了没反应的假卡。 */
.lc-card {
  display: flex; align-items: flex-start; gap: 9px;
  max-width: 250px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font-family: var(--f-sans); text-align: left; text-decoration: none;
}
a.lc-card { cursor: pointer; }
a.lc-card:active { background: var(--surface-2); }
.lc-card-ico {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep);
}
.lc-card-ico .ic { width: 16px; height: 16px; }
.lc-card-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-card-tx b {
  font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink);
  overflow-wrap: anywhere;
}
.lc-card-tx span {
  font-size: 12px; line-height: 1.45; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}

/* ---- 发布表单里那一行「添加位置」（templates/partials/_loc_field.html） ----
   六个落点（发动态三种形态 / 发需求 / 资料页「在哪儿」）共用这一份样式：
   它们分别长在 m.css 与 app.css 两套表单里，但这一行本身两端必须一模一样 ——
   虚线胶囊＝还没选，实心青底＝选好了，右边那颗 × 才是「去掉位置」。
   行为在 static/js/loc.js 的 wireField()，模板只写 data-loc-* 标记。 */
.lc-field { display: flex; align-items: center; gap: 8px; }
.lc-field-btn {
  flex: 0 1 auto; min-width: 0; max-width: 100%;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px dashed var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--f-sans); font-size: 13px; cursor: pointer;
}
.lc-field-btn .ic { flex: 0 0 auto; width: 15px; height: 15px; color: var(--brand); }
.lc-field-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-field.is-on .lc-field-btn {
  border-style: solid; border-color: var(--brand-soft);
  background: var(--brand-soft); color: var(--brand-deep);
}
.lc-field.is-on .lc-field-btn .ic { color: var(--brand-deep); }
.lc-field-x {
  flex: 0 0 auto; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface-2); color: var(--ink-3);
}
.lc-field-x .ic { width: 13px; height: 13px; }
.lc-field-hint { font-size: 12px; line-height: 1.5; color: var(--ink-3); }
