/* 海外寻房 UI v2 —— 消费级搜索产品形态
   暖纸底色 + 松绿点缀，首页居中大搜索卡 / 结果页吸顶摘要条 + 网格 / 追问滑出面板 */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --border: #e7e4dc;
  --border-strong: #d6d2c6;
  --text: #1d1b16;
  --text-2: #57534a;
  --muted: #8a857a;
  --accent: #0f6e56;
  --accent-hover: #0c5c48;
  --accent-dim: rgba(15, 110, 86, 0.09);
  --accent-dim-strong: rgba(15, 110, 86, 0.22);
  --star: #e8a13c;
  --success-bg: #e9f4ee;
  --success-text: #14532d;
  --warn-bg: #faf3e3;
  --warn-text: #8a5a00;
  --danger: #c13327;
  --danger-bg: #fcefec;
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(26, 24, 18, 0.05);
  --shadow-md: 0 8px 24px rgba(26, 24, 18, 0.07);
  --shadow-pop: 0 16px 48px rgba(26, 24, 18, 0.16);
  --topbar-h: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
button { font-family: inherit; }
svg { display: inline-block; vertical-align: middle; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 780px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  background: rgba(246, 245, 241, 0.85);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #12805f 0%, #0a5541 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 110, 86, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }

.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.topbar-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 视图切换（只动位移不动透明度：动画异常时内容也始终可见） ---------- */
.view { animation: fade-up 0.3s ease; }
@keyframes fade-up {
  from { transform: translateY(10px); }
  to { transform: none; }
}

/* 首页底部留白，搜索卡不贴边 */
#view-home .wrap { padding-bottom: 72px; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 26px 16px 20px; }
.hero h1 { font-size: 30px; font-weight: 740; letter-spacing: -0.02em; margin-bottom: 8px; }
.hero p { color: var(--text-2); max-width: 520px; margin: 0 auto; }

/* ---------- 搜索卡 ---------- */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.sc-row { display: grid; gap: 12px; margin-bottom: 14px; }
.sc-row.two { grid-template-columns: 1fr 1fr; }
.sc-row.three { grid-template-columns: 1fr 0.7fr 1.3fr; }
.sc-row .field { margin-bottom: 0; }

.field { display: block; margin-bottom: 14px; }
.label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 550; }
.label i { color: var(--danger); font-style: normal; }
.label .opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

input, select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a857a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-dim); }
input::placeholder { color: #b3aea2; }
input[type="date"] { min-height: 46px; }

/* 预算连体输入 */
.combo { display: flex; }
.combo input { border-radius: var(--r-md) 0 0 var(--r-md); border-right: 0; }
.combo select {
  width: 112px; flex-shrink: 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background-color: var(--surface-2);
}

/* 地址补全 */
.addr-wrap { position: relative; }
.suggestions {
  position: absolute; top: 50px; left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  max-height: 250px; overflow-y: auto;
  padding: 4px;
}
.suggestions button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 10px 11px; font-size: 13.5px; cursor: pointer; line-height: 1.45;
  border-radius: var(--r-sm); color: var(--text);
}
.suggestions button:hover { background: var(--accent-dim); }

/* 办公地点快捷按钮 */
.office-shortcut { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.office-btn {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%;
  font-size: 12px; line-height: 1.4;
  border: 1px solid var(--accent-dim-strong); color: var(--accent);
  background: var(--accent-dim); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; transition: background 0.15s;
}
.office-btn:hover { background: var(--accent-dim-strong); }
.office-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 更多筛选 */
.more-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-2); font-size: 13.5px; font-weight: 550;
  padding: 4px 0; margin-bottom: 4px;
}
.more-toggle:hover { color: var(--accent); }
.more-toggle svg { transition: transform 0.2s; }
.more-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.more { padding-top: 10px; border-top: 1px dashed var(--border); }

/* 分段选择器 */
.segmented {
  display: flex; gap: 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 3px;
}
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center;
  height: 34px; border-radius: 9px;
  font-size: 13.5px; color: var(--text-2); cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.segmented input:checked + span {
  background: var(--surface); color: var(--text);
  font-weight: 550; box-shadow: var(--shadow-sm);
}
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-dim); }

/* 设施 chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 15px; font-size: 13.5px; cursor: pointer; user-select: none;
  background: var(--surface); color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-dim); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

/* 主按钮 */
.cta {
  width: 100%; height: 52px; margin-top: 8px;
  border: 0; border-radius: 14px;
  background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.cta:hover:not(:disabled) { background: var(--accent-hover); }
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta:disabled { background: #c9c5ba; cursor: not-allowed; }

.btn {
  height: 38px; border-radius: var(--r-md); border: 1px solid transparent;
  padding: 0 14px; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { height: 32px; font-size: 12.5px; padding: 0 12px; }

.form-error {
  margin-top: 12px; padding: 10px 13px; border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--danger); font-size: 13.5px;
}

/* 上次结果链接 */
.last-result { text-align: center; margin-top: 16px; }
.last-result button {
  border: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 14px; font-weight: 550;
}
.last-result button:hover { text-decoration: underline; }

/* 三步说明（hero 与搜索卡之间，紧凑横排） */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.how-item {
  display: flex; gap: 9px; align-items: flex-start;
  background: rgba(255, 255, 255, 0.55); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
}
.how-num {
  width: 21px; height: 21px; border-radius: 999px; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  font-size: 12px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.how-item b { font-size: 13px; display: block; margin-bottom: 1px; }
.how-item p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 结果页 ---------- */
.result-bar {
  position: sticky; top: var(--topbar-h); z-index: 35;
  background: rgba(246, 245, 241, 0.9);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--border);
}
.result-bar-inner {
  min-height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 6px; padding-bottom: 6px;
}
#result-bar-text {
  font-size: 14px; color: var(--text-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#result-bar-text b { color: var(--text); font-weight: 650; }
/* 底部留白加大，末行卡片不被右下角「追问房源」悬浮按钮遮挡 */
.results-body { padding: 18px 20px 96px; display: grid; gap: 16px; }

/* 搜索进度 */
.steps {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.steps-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  font-size: 13.5px; font-weight: 550;
}
.steps-head .steps-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-toggle {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  padding: 4px; border-radius: 6px; display: inline-flex; transition: transform 0.2s;
}
.steps-toggle:hover { background: var(--surface-2); }
.steps.collapsed .steps-toggle { transform: rotate(-90deg); }
.steps-body { padding: 0 16px 12px; display: grid; gap: 2px; }
.steps.collapsed .steps-body { display: none; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; font-size: 13.5px; }
.step-icon { width: 18px; flex-shrink: 0; display: inline-flex; justify-content: center; margin-top: 3px; }
.step.done .step-icon { color: var(--accent); }
.step.failed .step-icon { color: var(--danger); }
.step-msg { color: var(--text-2); }
.step-extra { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--accent-dim-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 错误 */
.error-box {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid #f2cfc9; border-radius: var(--r-lg);
  padding: 14px 16px; font-size: 13.5px; white-space: pre-wrap;
}

/* 限流等友好提示 */
.notice-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid #f0dfa8; border-radius: var(--r-lg);
  padding: 13px 16px; font-size: 13.5px; line-height: 1.6;
}
.notice-box svg { flex: none; margin-top: 2px; }

/* 整体分析 */
.summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.summary h2 { font-size: 15.5px; font-weight: 650; margin-bottom: 6px; }
.summary p { color: var(--text-2); }
.tips { margin-top: 12px; background: var(--warn-bg); border-radius: var(--r-md); padding: 12px 14px; }
.tips h3 { font-size: 13px; color: var(--warn-text); margin-bottom: 6px; }
.tips ul { padding-left: 18px; color: var(--warn-text); font-size: 13px; display: grid; gap: 3px; }

/* ---------- 房源卡网格 ---------- */
.listings { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .listings { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .listings { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
}
.card-media { position: relative; background: var(--surface-2); }
.card-img-link { display: block; }
.card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.card-img-placeholder {
  width: 100%; aspect-ratio: 4/3;
  display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--accent-dim) 100%);
  font-size: 13px;
}
.card-img-placeholder svg { width: 42px; height: 42px; color: var(--accent); opacity: 0.45; }
.card-img-placeholder span { color: var(--muted); }
.card-index {
  position: absolute; top: 10px; left: 10px;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.93);
  color: var(--text); font-size: 12.5px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.card-badge {
  position: absolute; top: 10px; right: 10px;
  max-width: 62%;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.93); backdrop-filter: blur(4px);
  color: var(--warn-text); font-size: 11.5px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.card-source {
  position: absolute; left: 10px; bottom: 10px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(75, 85, 99, 0.82); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; flex: 1; }
/* grid 子项默认 min-width:auto，长文本（如俄语原始标题）会把卡片撑爆；
   允许收缩后 ellipsis 才生效 */
.card-body > * { min-width: 0; }

.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-price { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.card-price .per { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.card-price-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.card-title { font-size: 15px; font-weight: 600; line-height: 1.45; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-title .title-orig {
  display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.card-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { color: var(--muted); }
.card-meta .star { color: var(--star); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; border-radius: 6px;
  padding: 2px 8px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border);
}
.tag.accent { color: var(--accent); background: var(--accent-dim); border-color: transparent; }

.highlight {
  font-size: 13px; color: var(--accent); background: var(--accent-dim);
  border-radius: var(--r-sm); padding: 7px 10px; line-height: 1.5;
}
.amenities-line {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.findings { display: grid; gap: 8px; }
.findings .col { border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; }
.findings .col h4 { font-size: 12px; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.findings .col ul { padding-left: 16px; display: grid; gap: 2px; }
.col.pros { background: var(--success-bg); color: var(--success-text); }
.col.risks { background: var(--warn-bg); color: var(--warn-text); }

.card-cta {
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 550; text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.card-cta:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* 骨架屏 */
.skeleton { pointer-events: none; }
.skeleton .sk {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, #efece5 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.skeleton .sk-media { aspect-ratio: 4/3; border-radius: 0; }
.skeleton .sk-line { height: 12px; margin: 6px 0; }
.skeleton .sk-line.w40 { width: 40%; }
.skeleton .sk-line.w70 { width: 70%; }
.skeleton .sk-line.w90 { width: 90%; }
.skeleton .card-body { padding: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 追问：浮动按钮 + 滑出面板 ---------- */
.chat-open {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 8px 24px rgba(15, 110, 86, 0.35);
  transition: background 0.15s, transform 0.1s;
}
.chat-open:hover { background: var(--accent-hover); }
.chat-open:active { transform: translateY(1px); }

.chat-backdrop { display: none; }

.chat-panel {
  position: fixed; right: 22px; bottom: 84px; z-index: 65;
  width: 400px; max-width: calc(100vw - 32px);
  height: min(620px, calc(100dvh - 120px));
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: chat-in 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes chat-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.chat-head h2 { font-size: 15px; font-weight: 650; }
.chat-head p { font-size: 12px; color: var(--muted); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 16px; display: grid; gap: 8px; align-content: start;
}
.chat-msg { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.6; }
.chat-msg.user { background: var(--accent); color: #fff; justify-self: end; max-width: 85%; border-bottom-right-radius: 4px; }
.chat-msg.assistant { background: var(--surface-2); border: 1px solid var(--border); justify-self: start; max-width: 94%; border-bottom-left-radius: 4px; }
.chat-msg.error { background: var(--danger-bg); color: var(--danger); }
.chat-input {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.chat-input input { flex: 1; height: 42px; border-radius: 999px; padding: 0 16px; font-size: 14px; }
.send-btn {
  width: 42px; height: 42px; border-radius: 999px; flex-shrink: 0;
  border: 0; background: var(--accent); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { background: #c9c5ba; cursor: not-allowed; }

/* ---------- 统计弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(29, 27, 22, 0.42);
  display: flex; align-items: center; justify-content: center; z-index: 70;
  padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: var(--r-xl); width: min(680px, 100%);
  max-height: 84vh; overflow-y: auto; padding: 20px 22px;
  box-shadow: var(--shadow-pop);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font-size: 16px; font-weight: 650; }
.stats-body { overflow-x: auto; }
.stats-body h3 { font-size: 13px; color: var(--muted); margin: 16px 0 8px; font-weight: 550; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat-cell { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.stat-num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stats-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12.5px; }
.stats-table th, .stats-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.stats-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }

/* ---------- 移动端 ---------- */
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .topbar-inner { padding: 0 14px; }
  #view-home .wrap { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  #view-results .results-body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* iOS 输入防缩放 */
  input, select { font-size: 16px; }

  .hero { padding: 18px 8px 14px; }
  .hero h1 { font-size: 24px; }

  .search-card { padding: 18px; border-radius: var(--r-lg); }
  .sc-row.two, .sc-row.three { grid-template-columns: 1fr; gap: 0; }
  .sc-row .field { margin-bottom: 14px; }
  .sc-row .field:last-child { margin-bottom: 0; }

  .how { grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
  .how-item { padding: 12px 14px; align-items: flex-start; gap: 9px; }
  .how-item b { font-size: 14.5px; }
  .how-item p { font-size: 13px; line-height: 1.5; margin-top: 2px; }
  .how-num { width: 21px; height: 21px; font-size: 12px; margin-top: 1px; }

  .results-body { padding: 14px 14px 100px; gap: 14px; }
  #result-bar-text { font-size: 13px; }

  /* 追问面板 → 底部弹层 */
  .chat-open { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .chat-backdrop { display: block; position: fixed; inset: 0; background: rgba(29, 27, 22, 0.45); z-index: 62; }
  .chat-backdrop.hidden { display: none; }
  .chat-panel {
    right: 0; left: 0; bottom: 0; top: auto;
    width: 100%; max-width: 100%;
    height: 84dvh;
    border-radius: 20px 20px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 统计 → 底部弹层 */
  .modal { align-items: flex-end; padding: 0; }
  .modal-card {
    width: 100%; max-height: 86dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 结果页平台切换栏（横向可滑动，适配移动端） */
.source-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 2px 0 14px; padding: 2px 2px 8px;
  scrollbar-width: none;
}
.source-tabs::-webkit-scrollbar { display: none; }
.source-tab {
  flex: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; user-select: none;
  background: var(--surface); color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.source-tab:hover { border-color: var(--border-strong); }
.source-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 按钮禁用态（搜索中「修改条件」置灰） */
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* 「修改条件」移动端显示短文案 */
#edit-search .short-text { display: none; }
@media (max-width: 767px) {
  #edit-search .full-text { display: none; }
  #edit-search .short-text { display: inline; }
}

/* 外部网站提示弹窗 */
.modal-card.modal-sm { max-width: 440px; }
.ext-body { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.ext-body ul { padding-left: 18px; display: grid; gap: 6px; margin-top: 8px; }
.ext-actions { display: flex; gap: 10px; margin-top: 18px; }
.ext-actions .btn, .ext-actions .btn-accent {
  flex: 1 1 0; min-width: 0; height: 44px; justify-content: center; white-space: nowrap;
}
.btn-accent {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent); color: #fff;
  padding: 0 14px;
  font-size: 14px; font-weight: 550; cursor: pointer;
  transition: filter 0.15s;
}
.btn-accent:hover { filter: brightness(1.06); }

/* 「修改条件/修改」按钮：禁止被挤压换行 */
#edit-search { flex: none; white-space: nowrap; }
