/* ===== 居住环境评估 H5 样式（多页面版） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #eef0f4;
  --brand: #0f766e;
  --brand2: #14b8a6;
  --shadow: 0 6px 20px rgba(15, 23, 42, .08);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100%; padding-bottom: 28px; background: var(--bg); }

/* 顶部品牌栏 */
.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; padding: 16px 18px 18px; border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.logo {
  font-size: 30px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); border-radius: 14px;
}
.brand-text h1 { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand-text p { font-size: 12px; opacity: .9; margin-top: 2px; }

/* 通用区块 */
.page { padding: 14px; }
.page-tip { font-size: 13px; color: var(--muted); background: #ecfdf5; border: 1px solid #d1fae5; border-radius: 12px; padding: 11px 13px; margin: 14px 14px 0; line-height: 1.6; }

/* 地图 */
.map-wrap { position: relative; height: 230px; margin: 14px 14px 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
#map, #map-traffic, #map-compare { width: 100%; height: 100%; background: #dfe6ee; }
.mini-map { height: 240px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #dfe6ee; }
.map-banner {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(220,38,38,.92); color: #fff;
  font-size: 12px; padding: 8px 12px; line-height: 1.4; z-index: 6;
}
.fab {
  position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border: none; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); font-size: 20px; cursor: pointer; z-index: 5;
}
.fab:active { transform: scale(.94); }
.traffic-toggle {
  position: absolute; left: 12px; top: 12px; z-index: 5; border: none; border-radius: 20px;
  background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); font-size: 12px; padding: 7px 12px; cursor: pointer; color: var(--ink);
}
.traffic-toggle.on { background: var(--brand); color: #fff; }

/* 搜索 */
.search-bar { margin: 12px 14px 0; position: relative; z-index: 10; }
.search-input-wrap {
  display: flex; align-items: center; background: #fff; border-radius: 14px; padding: 0 12px; box-shadow: var(--shadow);
}
.search-icon { font-size: 14px; opacity: .6; }
.search-input-wrap input {
  flex: 1; border: none; outline: none; padding: 13px 10px; font-size: 15px; background: transparent; color: var(--ink);
}
.clear-btn { border: none; background: #e5e7eb; color: #6b7280; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; cursor: pointer; }
.suggest-list {
  list-style: none; background: #fff; border-radius: 14px; margin-top: 8px; box-shadow: var(--shadow); overflow: hidden;
  max-height: 300px; overflow-y: auto;
}
.suggest-list li { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest-list li:last-child { border-bottom: none; }
.suggest-list li:active { background: #f1f5f9; }
.suggest-list .s-title { font-size: 14px; font-weight: 500; }
.suggest-list .s-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 加载 */
.loading { text-align: center; padding: 26px 0; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 10px; border: 3px solid #d1d5db; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 结果卡片 */
.result { padding: 0 14px; margin-top: 14px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card-title::before { content: ""; display: inline-block; width: 4px; height: 14px; background: var(--brand); border-radius: 3px; margin-right: 8px; vertical-align: -2px; }
.card-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }

.score-card { display: flex; align-items: center; gap: 16px; }
.gauge-wrap { flex: 0 0 auto; }
.gauge { width: 130px; height: 130px; }
.score-meta { flex: 1; min-width: 0; }
.addr-line { font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-all; }
.grade-line { margin-top: 6px; font-size: 13px; font-weight: 700; }
.score-tip { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* 雷达 / 分项条 */
.radar { display: flex; justify-content: center; }
.radar svg { max-width: 100%; }
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row .bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bar-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.bar-score { font-size: 15px; font-weight: 700; }
.bar-track { height: 9px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .6s ease; }
.bar-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.bar-advice { font-size: 12px; color: #374151; margin-top: 4px; background: #f8fafc; border-radius: 8px; padding: 7px 9px; }

/* 周边设施（分类折叠） */
.poi-list { display: flex; flex-direction: column; gap: 12px; }
.poi-group { background: #fafbfc; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.poi-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 700; color: var(--ink);
}
.poi-group-head:active { background: #f1f5f9; }
.poi-group-head .gh-left { display: flex; align-items: center; gap: 7px; }
.poi-group-head .gh-count { font-size: 11px; font-weight: 600; color: var(--muted); background: #eef2f7; padding: 1px 8px; border-radius: 10px; }
.poi-chevron { transition: transform .25s ease; color: var(--muted); font-size: 12px; }
.poi-group.collapsed .poi-chevron { transform: rotate(-90deg); }
.poi-group-body { display: flex; flex-direction: column; }
.poi-group.collapsed .poi-group-body { display: none; }
.poi-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 13px; border-top: 1px dashed var(--line); }
.poi-item:first-child { border-top: none; }
.poi-main { min-width: 0; }
.poi-title { font-size: 14px; font-weight: 500; }
.poi-addr { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-dist { flex: 0 0 auto; font-size: 12px; color: var(--brand); font-weight: 600; align-self: center; }

/* 引导 */
.intro { text-align: center; padding: 22px 30px; color: var(--muted); }
.intro-emoji { font-size: 40px; margin-bottom: 8px; }
.intro p { font-size: 14px; }
.intro .intro-sub { font-size: 12px; margin-top: 8px; line-height: 1.6; }

/* 底部导航 */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  display: flex; background: #fff; box-shadow: 0 -4px 18px rgba(15,23,42,.08);
  border-top: 1px solid var(--line); z-index: 50;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 9px;
  text-decoration: none; color: #9ca3af; font-size: 11px;
}
.tab .tab-ico { font-size: 19px; line-height: 1; }
.tab.active { color: var(--brand); font-weight: 700; }
.tab.active .tab-ico { transform: translateY(-1px); }

/* ===== 对比页 ===== */
.cmp-add { margin: 14px 14px 0; position: relative; z-index: 10; }
.btn-block {
  display: block; width: calc(100% - 28px); margin: 12px 14px 0; padding: 12px; border: none; border-radius: 12px;
  background: #e6fffb; color: var(--brand); font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-block:active { background: #c7f9f1; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 20px;
  font-size: 13px; color: #fff; font-weight: 600;
}
.chip .chip-x { cursor: pointer; opacity: .85; font-size: 13px; }
.chip .chip-x:active { opacity: 1; }
.btn-primary {
  display: block; width: calc(100% - 28px); margin: 14px 14px 0; padding: 14px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-primary:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { opacity: .92; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--ink); }
.cmp-legend .lg { display: flex; align-items: center; gap: 5px; }
.cmp-legend .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-table th, .cmp-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.cmp-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp-table td:first-child, .cmp-table th:first-child { text-align: left; color: var(--ink); font-weight: 600; }
.cmp-table .best { background: #ecfdf5; color: #15803d; font-weight: 700; border-radius: 6px; }
.cmp-table .total-row td { font-weight: 700; border-top: 2px solid var(--brand); }
.cmp-table .w { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.cmp-poslist { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.cmp-poslist .cpl-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; }
.cmp-poslist .cpl-dot { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cmp-poslist .cpl-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.cmp-poslist .cpl-meta { font-size: 11px; color: var(--muted); flex: 0 0 auto; text-align: right; }
.cmp-rank { display: flex; flex-direction: column; gap: 10px; }
.cmp-rank-item { display: flex; align-items: center; gap: 10px; }
.cmp-rank-badge { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.cmp-rank-bar { flex: 1; height: 10px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.cmp-rank-bar > div { height: 100%; border-radius: 6px; }
.cmp-rank-score { font-size: 13px; font-weight: 700; flex: 0 0 auto; min-width: 36px; text-align: right; }

/* 各楼盘单独评分卡片 */
.cmp-cards { display: flex; flex-direction: column; gap: 12px; }
.cmp-card { background: #fafbfc; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; padding: 12px 13px; }
.cmp-card-head { display: flex; align-items: center; gap: 10px; }
.cmp-card-badge { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cmp-card-id { flex: 1; min-width: 0; }
.cmp-card-name { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-cached { font-size: 10px; font-weight: 600; color: #0f766e; background: #d1fae5; padding: 1px 6px; border-radius: 8px; margin-left: 6px; vertical-align: 1px; }
.cmp-card-addr { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-card-score { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cmp-card-total { font-size: 24px; font-weight: 800; line-height: 1; }
.cmp-card-grade { font-size: 11px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 10px; }
.cmp-card-dims { margin-top: 11px; display: flex; flex-direction: column; gap: 8px; }
.cmpd-row { display: flex; align-items: center; gap: 9px; }
.cmpd-name { flex: 0 0 86px; font-size: 12px; color: var(--ink); font-weight: 500; }
.cmpd-name .w { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.cmpd-bar { flex: 1; height: 8px; background: #eef0f4; border-radius: 5px; overflow: hidden; }
.cmpd-bar > span { display: block; height: 100%; border-radius: 5px; }
.cmpd-score { flex: 0 0 28px; text-align: right; font-size: 13px; font-weight: 700; }

/* ===== 交通页 ===== */
.traffic-chart { width: 100%; }
.traffic-chart svg { width: 100%; height: auto; }
.traffic-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--ink); }
.traffic-legend span { display: flex; align-items: center; gap: 5px; }
.traffic-legend .dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.traffic-summary { display: flex; flex-direction: column; gap: 8px; }
.ts-row { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ts-row:last-child { border-bottom: none; }
.ts-row .ts-k { color: var(--muted); }
.ts-row .ts-v { font-weight: 700; }
.traffic-advice { font-size: 13px; color: #374151; background: #f0fdfa; border: 1px solid #cffafe; border-radius: 10px; padding: 11px 12px; line-height: 1.6; margin-top: 4px; }
.bar-sub { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ===== 更多页 ===== */
.more-cards { display: flex; flex-direction: column; gap: 12px; margin: 14px 14px 0; }
.more-card { background: var(--card); border-radius: 16px; padding: 15px; box-shadow: var(--shadow); border-left: 4px solid var(--brand); }
.more-card .mc-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.more-card .mc-ico { font-size: 22px; }
.more-card .mc-title { font-size: 15px; font-weight: 700; }
.more-card .mc-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.more-card .mc-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; margin-top: 8px; }
.mc-tag.plan { background: #eef2f7; color: #64748b; }
.mc-tag.soon { background: #fef3c7; color: #b45309; }
.mc-tag.doing { background: #dbeafe; color: #1d4ed8; }

/* 页脚 */
.footer { text-align: center; font-size: 11px; color: #9ca3af; padding: 8px 0 0; }

.hidden { display: none !important; }
