/* ============================================================
   华信生活通 H5 · 设计系统（与小程序视觉一致：主色 #FF6B35）
   移动端优先，单位用 px（配合 vw 缩放由 viewport 控制）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* 主色只作强调：价格 / 主按钮 / tab 激活 / 标签，不做大面积填充 */
  --primary: #FF6B35;
  --primary-strong: #E04E14;   /* 按钮、价格等需要对比度的场景 */
  --primary-light: #FFF1E8;
  --hero-bg: linear-gradient(180deg, #FFF4EC 0%, #FFF9F6 100%);
  --text: #1F2226;
  --text-sub: #6B7280;         /* 白底对比度 ≈ 4.8:1 */
  --text-weak: #9AA0A6;        /* 仅次要装饰（箭头、占位） */
  --bg: #F5F6F8;
  --card: #fff;
  --border: #EFF0F2;
  --green: #3F8F4A;
  --red: #D93B36;
  --radius: 12px;              /* 卡片 */
  --radius-sm: 8px;            /* 小控件、标签 */
  --radius-pill: 999px;
  --tabbar-h: 56px;
  --sa-top: env(safe-area-inset-top, 0px);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .04);
}

html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
input, textarea, button, select { font-family: inherit; font-size: inherit; outline: none; }
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + 12px); }
.page { min-height: 100vh; }
.page.no-tab { padding-bottom: 12px; }
.wrap { padding: 0 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }

/* ---------- 顶部导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(48px + var(--sa-top)); display: flex; align-items: center; gap: 8px;
  padding: var(--sa-top) 12px 0; background: var(--primary); color: #fff;
}
.navbar .nav-title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.navbar .nav-btn { width: 40px; font-size: 18px; line-height: 1; }
.navbar.gray { background: #fff; color: var(--text); border-bottom: 1px solid var(--border); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin: 10px 12px; }
.card.tight { padding: 10px 12px; }
.section-title { font-size: 15px; font-weight: 600; margin: 16px 12px 8px; display: flex; align-items: center; gap: 6px; }
.section-title .sec-ico { width: 17px; height: 17px; color: var(--primary); flex-shrink: 0; }
.section-title .sec-ico svg { width: 100%; height: 100%; display: block; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; border: none; border-radius: var(--radius-sm);
  padding: 12px; font-size: 16px; font-weight: 600; text-align: center; cursor: pointer;
  background: var(--primary-strong); color: #fff;
}
.btn:active { opacity: .88; }
.btn.ghost { background: #fff; color: var(--primary-strong); border: 1px solid var(--primary); }
.btn.gray { background: #F2F3F5; color: #666; }
.btn.disabled, .btn[disabled] { background: #E5E6EB; color: #fff; pointer-events: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); width: auto; display: inline-block; }
.btn-row { display: flex; gap: 10px; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; line-height: 18px; }
.tag-orange { background: var(--primary-light); color: var(--primary); }
.tag-blue { background: #EAF2FF; color: #2C7BE5; }
.tag-green { background: #EBF7ED; color: var(--green); }
.tag-gray { background: #F2F3F5; color: #999; }
.tag-red { background: #FFECEC; color: var(--red); }
.tag-purple { background: #F3EDFF; color: #7B5BD6; }

/* ---------- 表单 ---------- */
.field { background: var(--card); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.input, .textarea {
  width: 100%; border: none; background: transparent; font-size: 15px; color: var(--text);
}
.textarea { min-height: 72px; resize: vertical; }
.picker {
  width: 100%; border: none; background: transparent; font-size: 15px; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
.picker-wrap { position: relative; }
.picker-wrap::after { content: '▾'; position: absolute; right: 0; top: 0; color: var(--text-weak); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: #fff; color: #666;
  border: 1px solid #EEE; font-size: 13px;
}
.chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ---------- 列表项 ---------- */
/* 卡片式链接必须块级化：<a> 默认行内，内含块级子元素时外边距失效、卡片会拉满整屏 */
.item { display: block; background: var(--card); border-radius: var(--radius); padding: 14px; margin: 10px 12px; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.item-title { font-size: 15px; font-weight: 600; flex: 1; }
.item-price { color: var(--primary-strong); font-weight: 600; font-size: 16px; white-space: nowrap; }
.item-meta { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.item-desc { font-size: 14px; color: #4B5563; margin-top: 6px; }
.item-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.item-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- 头像 ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; overflow: hidden;
}
.avatar.big { width: 60px; height: 60px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 图片 ---------- */
.thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #EEE; flex-shrink: 0; }
.img-grid { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.img-grid img { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-sub); padding: 56px 20px; }
.empty-ico { width: 42px; height: 42px; margin: 0 auto 12px; color: #C8CDD4; }
.empty-ico svg { width: 100%; height: 100%; display: block; }

/* ---------- 骨架屏 ---------- */
.sk { background: linear-gradient(90deg, #EEE 25%, #F5F5F5 37%, #EEE 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 14px; margin-bottom: 8px; }
.sk-line.short { width: 60%; }
.sk-card { background: #fff; border-radius: var(--radius); padding: 14px; margin: 10px 12px; }
.sk-img { width: 100%; height: 150px; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: var(--tabbar-h); display: flex; background: #fff;
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8A9099; gap: 3px; }
.tabbar .tab.active { color: var(--primary); }
.tabbar .tab-ico { width: 22px; height: 22px; display: block; }
.tabbar .tab-ico svg { width: 100%; height: 100%; display: block; }
.tabbar .tab-txt { font-size: 11px; }

/* ---------- 浮动发布按钮 ---------- */
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px); z-index: 25;
  width: 52px; height: 52px; border-radius: 50%; background: var(--primary-strong); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 4px 14px rgba(224, 78, 20, .35);
}

/* ---------- 底部操作条 ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border);
}
.contact-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border);
}
.contact-bar .contact-val { flex: 1; font-size: 15px; color: var(--primary); font-weight: 600; }

/* ---------- 提示条 ---------- */
.banner { margin: 10px 12px 0; padding: 10px 12px; border-radius: 10px; background: #FFF6EC; color: #C07A3E; font-size: 13px; }
.banner.info { background: #EAF2FF; color: #2C7BE5; }

/* ---------- toast / loading ---------- */
.toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 100;
  background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; max-width: 76vw; text-align: center;
}
.loading-mask {
  position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, .15);
  display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 34px; height: 34px; border: 3px solid rgba(255, 107, 53, .25);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 首页 Hero（浅暖底：橙色退为强调色，避免大面积高饱和） ---------- */
.hero {
  background: var(--hero-bg); color: var(--text);
  padding: calc(14px + var(--sa-top)) 16px 16px;
  border-bottom: 1px solid rgba(255, 107, 53, .08);
}
.hero h2 { font-size: 19px; font-weight: 600; }
.hero p { font-size: 12.5px; color: var(--text-sub); margin-top: 3px; }
.hero .brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hero .brand-mark { margin: 0; }
.hero .brand-name { font-size: 13px; font-weight: 600; color: var(--primary-strong); letter-spacing: .3px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; margin: 0 auto 12px; }
.hero .stats { display: flex; gap: 22px; margin-top: 12px; }
.hero .stat b { font-size: 17px; font-weight: 600; }
.hero .stat span { font-size: 11.5px; color: var(--text-sub); display: block; margin-top: 1px; }

/* ---------- 金刚区 ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid .g-item {
  background: #fff; border-radius: var(--radius); padding: 16px 8px 14px;
  text-align: center; box-shadow: var(--shadow-card);
}
.grid .g-ico { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--primary); }
.grid .g-ico svg { width: 100%; height: 100%; display: block; }
.grid .g-name { font-size: 13px; color: var(--text); }

/* 详情信息行 */
.info-line { display: flex; margin-top: 8px; font-size: 14px; }
.info-line .k { width: 72px; color: var(--text-sub); flex-shrink: 0; }
.notice { margin: 10px 12px; padding: 10px 12px; background: #fff; border-radius: var(--radius); font-size: 14px; }
.notice .n-title { font-weight: 600; }
.notice .n-time { font-size: 12px; color: var(--text-weak); margin-top: 4px; }

/* ---------- 站点页脚（备案信息） ---------- */
.site-footer {
  margin: 22px 12px 8px; padding: 14px 0; text-align: center;
  font-size: 11.5px; color: var(--text-sub); line-height: 1.8;
}
.site-footer a { color: var(--text-sub); text-decoration: underline; text-decoration-color: #D8DDE3; }

/* ---------- 桌面端观感：手机宽度居中，四周留白（仅 >720px 生效） ---------- */
@media (min-width: 720px) {
  body { background: #EDEFF3; }
  .app {
    max-width: 640px; margin: 0 auto; background: var(--bg); min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .05), 0 18px 48px rgba(16, 24, 40, .10);
  }
  .tabbar, .bottom-bar, .contact-bar {
    left: 50%; right: auto; transform: translateX(-50%); width: 640px;
  }
  .fab { right: calc(50% - 304px); }
  .toast { max-width: 420px; }
}

/* 图片占位（列表无图时的中性底色 + 线性图标） */
.thumb-holder { display: flex; align-items: center; justify-content: center; color: #C8CDD4; background: #F2F4F6; }
.thumb-holder svg { width: 28px; height: 28px; }

/* ---------- 我的页 / 消息列表：图标行 ---------- */
.entry-row { padding: 11px 0; border-bottom: 1px solid var(--border); }
.entry-row:last-child { border-bottom: none; }
.entry-ico { width: 19px; height: 19px; color: var(--primary); flex-shrink: 0; display: inline-flex; }
.entry-ico svg { width: 100%; height: 100%; display: block; }
.chev { color: var(--text-weak); font-size: 16px; }

/* ---------- 长文档（隐私政策 / 用户协议） ---------- */
.doc { padding: 4px 16px 32px; font-size: 14px; line-height: 1.75; color: #374151; }
.doc-updated { font-size: 12px; color: var(--text-sub); margin: 10px 0 14px; }
.doc h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 20px 0 6px; }
.doc p { margin: 6px 0; }
.doc ul { margin: 6px 0 6px 18px; }
.doc li { margin: 4px 0; }
.doc b { color: var(--text); font-weight: 600; }
.doc a { color: var(--primary-strong); }

/* ---------- 注册同意条款 ---------- */
.agree-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--text-sub); margin: 4px 0 14px; line-height: 1.6;
}
.agree-row input[type="checkbox"] { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; }
.agree-row a { color: var(--primary-strong); }

/* 次要说明文字（资金/合规提示） */
.note-muted { font-size: 11.5px; color: var(--text-weak); line-height: 1.6; margin-top: 10px; }

/* 静态站脚（在 #app 之外，任何抓取都能读到备案号；为固定 tabbar 留出空间） */
.site-footer { padding-bottom: calc(var(--tabbar-h) + 24px); }
