/* ============================================================
 * 排版精修层 —— polish.css（由 tools/apply_polish.py 注入，排在 pages.css 之后）
 *
 * 目标（用户要求："排版整齐"）：
 *   1. 标题层级统一（字号/字重/行高/截断行数）
 *   2. 卡片内距与间距统一到同一套刻度（4 / 8 / 12 / 16 / 24）
 *   3. 网格对齐：两列卡等高等宽、图标列宽一致
 *   4. 防"孤字行"：中文两字不落单行
 *   5. 安全区与底部固定条的让位统一
 *
 * 原则：只做**收敛与对齐**，不改结构、不动品牌色。
 * ============================================================ */

/* ---------- 1. 统一行高与断行规则 ---------- */
.hero-title, .sec-title, .card-title, .svc-title, .list-title,
.pkg-name, .goods-title, .plan-name, .price-num {
  line-height: 1.42;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-wrap: pretty;           /* 现代浏览器：避免孤字行 */
}

/* 卡片类标题最多两行，超出省略（防止长标题把卡片撑高、破坏网格） */
.svc-title, .goods-title, .pkg-name, .plan-name, .card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-title, .sec-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-desc, .goods-desc, .card-desc, .list-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 2. 间距刻度统一 ---------- */
.card, .sec, .panel, .pkg-card, .plan-card, .goods-card, .price-card { padding: 16px; }
.card + .card, .sec + .sec, .panel + .panel { margin-top: 12px; }
.grid-2, .grid-3, .card-list, .list { gap: 12px; }
.grid-2 > *, .grid-3 > * { height: 100%; }        /* 同行等高 */
.grid-2, .grid-3 { align-items: stretch; }

/* 列表项内距统一，且图标列固定宽，标题不再挤图标 */
.list-item { padding: 14px 16px; gap: 12px; }
.list-ico, .menu-ico, .card-ico { flex: 0 0 auto; width: 38px; height: 38px; }
.list-item .grow, .list-item .list-title { min-width: 0; }
.list-desc, .svc-desc { margin-top: 4px; }

/* ---------- 3. 底部固定条与安全区 ---------- */
.page { padding-bottom: calc(var(--tabbar-h, 52px) + var(--safe-b, 0px) + 16px); }
.page.has-cta { padding-bottom: calc(var(--tabbar-h, 52px) + 68px + var(--safe-b, 0px) + 16px); }
.disclaimer { padding-bottom: calc(var(--tabbar-h, 52px) + var(--safe-b, 0px) + 20px); }

/* ---------- 4. 价格 / 数字不折行 ---------- */
.svc-price, .price-num, .pkg-price, .goods-price, .stat-val, .kpi .v {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;    /* 数字等宽，表格更整齐 */
}
.svc-price, .price-num, .pkg-price, .goods-price { display: inline-flex; align-items: baseline; gap: 2px; }

/* ---------- 5. 按钮与标签 ---------- */
.btn { white-space: nowrap; }
.tag { white-space: nowrap; }
.btn-row, .meta, .svc-meta, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 6. 表格与键值行对齐 ---------- */
table { border-collapse: collapse; }
th, td { vertical-align: middle; }
.text-right, .tr, td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 7. 长英文/URL 不撑破容器 ---------- */
a, p, span, div, li, td { overflow-wrap: anywhere; }
.src, .link, .url { word-break: break-all; }

/* ---------- 8. 图片位比例统一（避免高矮不一破坏对齐） ---------- */
.svc-thumb, .thumb, .card-thumb, .goods-thumb, .album-thumb {
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- 9. 表单行对齐 ---------- */
.field-input { height: 46px; }
.field-row { align-items: stretch; }
.field-code { flex: 0 0 auto; width: 108px; }
.field-label { line-height: 1.4; }
.field-err { min-height: 16px; }

/* ---------- 10. 小屏（≤360px）收紧内距，避免换行错乱 ---------- */
@media (max-width: 360px) {
  :root { --sp: 10px; --sp-l: 12px; }
  .card, .sec, .panel, .pkg-card, .plan-card, .goods-card, .price-card { padding: 12px; }
  .list-item { padding: 12px; }
  .grid-2, .grid-3, .card-list, .list { gap: 10px; }
  .hero-title { font-size: 21px; }
  .btn { padding: 0 14px; }
}

/* ---------- 11. 大屏（≥480px）不拉长，保持阅读宽度 ---------- */
@media (min-width: 480px) {
  body { max-width: 480px; margin: 0 auto; }
}


/* ===== 视觉修正（iconfix）===== */
/* 1) 顶部空白：.page 的上内边距比 topbar+城市条 的高度多出 52px */
/* topbar 原本是 fixed，会被 sticky 的城市条盖住；改为随文档流排在城市条下面 */
.topbar { position: static !important; z-index: auto !important; }
.page.with-topbar { padding-top: 0 !important; }
.hero { margin-top: 0; }
/* 公告条图标：原来用 emoji，删掉后图标位空转，这里给统一语义 */
.notice .ico, .notice-bar .ico { color: #8a5a10; }
/* 2) 英雄区的 emoji 盾牌已删除，留一个柔和光斑避免右上角空 */
.hero::after {
  content: "";
  position: absolute; right: -40px; top: -30px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,.16), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
/* 3) 卡片配图统一比例，避免不同尺寸图片撑破布局 */
/* 只对真正的 <img> 生效；.svc-thumb 是背景图小图标位，不能设 100% 宽 */
img.biz-thumb, img.card-thumb, img.album-img, img.banner-img {
  width: 100%; height: auto; display: block; object-fit: cover; border-radius: 12px;
}
/* 服务卡片缩略图：固定小方块 + 居中背景图 */
.svc-thumb {
  flex: 0 0 56px !important; width: 56px !important; height: 56px !important;
  display: flex; align-items: center; justify-content: center;
  background-size: contain !important; background-position: center !important;
  background-repeat: no-repeat !important; border-radius: 12px;
}
/* 4) 图标位统一垂直居中 */
.list-ico, .menu-ico, .card-ico, .adv-ico, .type-ico {
  display: inline-flex !important; align-items: center; justify-content: center;
}

/* 信任行 / 公告条：内嵌矢量图标与文字对齐 */
.hero-trust span, .notice .ico + span { display: inline-flex; align-items: center; gap: 5px; }
.hero-trust .dsh-ico, .notice .ico .dsh-ico { flex: none; }
.notice .ico { display: inline-flex !important; align-items: center; color: #8a5a10; }

/* ===== 窄屏防溢出（服务卡片行） ===== */
.svc-card, .svc-body, .svc-title, .svc-desc { min-width: 0; }
.svc-meta, .svc-desc-row, .svc-card .row-between, .svc-card .row {
  flex-wrap: wrap; row-gap: 6px; min-width: 0;
}
.svc-meta > *, .svc-desc-row > *, .svc-card .row > * { min-width: 0; }
.svc-price, .svc-card .tag, .svc-card .btn, .svc-card .fav-btn { flex: 0 0 auto; white-space: nowrap; }
.svc-desc-row .svc-desc { flex: 1 1 0; }
/* 其它常见双列/三列布局在极窄屏也不撑破 */
.row-between > * { min-width: 0; }

/* ===== 服务卡片强制不溢出 ===== */
.svc-card { overflow: hidden; max-width: 100%; }
.svc-card .svc-body { flex: 1 1 0 !important; min-width: 0 !important; overflow: hidden; }
.svc-card .svc-meta,
.svc-card .svc-desc-row,
.svc-card .row-between,
.svc-card .row,
.svc-card .svc-meta > * { flex-wrap: wrap !important; min-width: 0 !important; max-width: 100% !important; }
.svc-card .svc-title, .svc-card .svc-desc { max-width: 100%; word-break: break-word; }
.svc-card .btn, .svc-card .svc-price, .svc-card .tag, .svc-card .fav-btn { flex: 0 0 auto !important; }

/* ===== 页脚遮挡修复（评审：23/28 站页脚被 cta-bar+tabbar 盖住） ===== */
body { padding-bottom: 120px !important; }
.seo-city-links, .seo-siblings { margin-bottom: 8px !important; }
.disclaimer, .footer, footer { padding-bottom: 12px !important; }
/* 次级控件热区 ≥44px（评审：chip 34 / sec-more 19 / cta-tel 35） */
.city-chip, .chip, .flow-tab, .sit-tab, .tag-chip { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.sec-more, .list-arrow { min-height: 40px; display: inline-flex; align-items: center; padding: 6px 4px; }
.cta-tel { min-height: 44px; }
.tb-links a, .topbar a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 4px; }
.nav-btn, .btn-sm { min-height: 40px; }
