:root {
  --green: #2e9e5b;
  --green-d: #1f7d44;
  --orange: #ff7a1a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #222;
  --muted: #8a8f99;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 适老化基线：正文 16px、次要文字不小于 14px；整体放大比例由各页根级 zoom 控制（见 common.js Scale） */
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 16px; }
a { color: inherit; text-decoration: none; }
/* 头部只保留「标题 + 当前页动作 + 自动注入的官网/身份」，右侧动作靠 flex 间距排齐，不再逐个 margin-left:auto */
.app-header { position: sticky; top: 0; z-index: 10; background: var(--green); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 14px; }
.app-header h1 { flex: 1; min-width: 0; font-size: 19px; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .me { font-size: 15px; opacity: .95; white-space: nowrap; }
.app-header .home-link { font-size: 15px; opacity: .95; color: #fff; white-space: nowrap; }
/* 无标准头部的页面：固定悬浮返回官网 */
.home-link-float { position: fixed; left: 12px; bottom: 12px; z-index: 60; background: #fff; color: var(--green); border: 1px solid #cfe3cf; border-radius: 22px; padding: 9px 16px; font-size: 15px; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.container { max-width: 720px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sale-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.sale-card img { width: 100%; height: 140px; object-fit: cover; background: #eee; display: block; }
.sale-card .body { padding: 8px 10px 10px; }
.sale-card .title { font-weight: 600; font-size: 16px; line-height: 1.35; height: 44px; overflow: hidden; }
.sale-card .price { color: var(--orange); font-weight: 700; font-size: 18px; margin-top: 4px; }
.sale-card .origin { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.chip { white-space: nowrap; padding: 8px 14px; border-radius: 18px; background: #fff; color: #555; font-size: 15px; }
.chip.active { background: var(--green); color: #fff; }
/* 多级类目筛选：一级 chip 行 + 选中后展开的二级 chip 行 + 面包屑 */
.chips.sub { padding-top: 0; }
.chip .n { font-style: normal; font-size: 13px; opacity: .65; margin-left: 3px; }
.chip.off { opacity: .45; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); padding: 0 0 8px; }
.crumb a { color: var(--green-d); }
.crumb .sep { color: #ccc; }
.btn { display: inline-block; border: none; border-radius: 24px; padding: 12px 20px; min-height: 44px; font-size: 17px; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; }
.btn.orange { background: var(--orange); color: #fff; }
.btn.ghost { background: #eef; color: var(--green-d); }
.btn.block { display: block; width: 100%; text-align: center; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; color: #555; font-size: 16px; }
.field input, .field textarea, .field select { width: 100%; padding: 12px; border: 1px solid #e3e5e9; border-radius: 8px; font-size: 16px; }
.tag { display: inline-block; background: #eaf7ee; color: var(--green-d); border-radius: 4px; padding: 3px 8px; font-size: 14px; }
.tag.gray { background: #f0f1f3; color: #888; }
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee; padding: 12px 14px; display: flex; gap: 10px; }

/* 登录弹窗 */
.tuhuo-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; align-items: center; justify-content: center; }
.tuhuo-dialog { background: #fff; width: 86%; max-width: 360px; border-radius: 14px; padding: 20px; position: relative; }
.tuhuo-close { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 26px; line-height: 1; color: #999; cursor: pointer; padding: 8px; }
.tuhuo-close:active { color: #333; }
.tuhuo-dialog h3 { margin: 0 0 14px; font-size: 19px; }
.tuhuo-input { width: 100%; padding: 12px; border: 1px solid #e3e5e9; border-radius: 8px; margin-bottom: 10px; font-size: 16px; }
.tuhuo-row { display: flex; gap: 8px; }
.tuhuo-row .tuhuo-input { flex: 1; }
.tuhuo-capimg { width: 100px; height: 44px; border-radius: 6px; cursor: pointer; background: #eee; flex: 0 0 auto; object-fit: cover; }
.tuhuo-btn { border: none; border-radius: 10px; padding: 12px 16px; min-height: 44px; font-size: 16px; cursor: pointer; }
.tuhuo-btn.primary { background: var(--green); color: #fff; width: 100%; margin-top: 6px; }
.tuhuo-btn.ghost { background: #eef; color: var(--green-d); white-space: nowrap; }
.tuhuo-dev { color: var(--orange); font-size: 14px; min-height: 18px; margin-bottom: 6px; }
.tuhuo-msg { color: #e33; font-size: 14px; min-height: 18px; margin-top: 6px; }
.empty { text-align: center; color: var(--muted); font-size: 16px; padding: 40px 0; }

/* 轻量提示 */
.tuhuo-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 10px); z-index: 200;
  max-width: 78%; padding: 11px 18px; border-radius: 22px; background: rgba(30,34,38,.9); color: #fff;
  font-size: 15px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.tuhuo-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= 商城：底部导航 ================= */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; background: #fff;
  border-top: 1px solid #eceef1; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9aa0a8; font-size: 13px; }
.tabbar a .ico { font-size: 24px; line-height: 1; }
.tabbar a.active { color: var(--green); font-weight: 600; }
.tabbar a .dot { position: absolute; margin: -4px 0 0 18px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.has-tabbar { padding-bottom: 92px; }

/* ================= 商城：卡片与列表 ================= */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.goods-row { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 12px; }
.goods-row .thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #eef1f3; flex: 0 0 auto; }
.goods-row .info { flex: 1; min-width: 0; }
.goods-row .name { font-weight: 600; font-size: 16px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goods-row .spec { display: inline-block; margin: 4px 0; padding: 3px 9px; border-radius: 10px; background: #f3f6f4; color: #6b7a70; font-size: 14px; }
.goods-row .price { color: var(--orange); font-weight: 700; font-size: 17px; }
.goods-row .muted { color: var(--muted); font-size: 14px; }
.goods-row.off { opacity: .55; }

/* 勾选圆点 */
.pick { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #d3d8dd; display: inline-flex; align-items: center; justify-content: center; color: transparent; font-size: 15px; }
.pick.on { background: var(--green); border-color: var(--green); color: #fff; }

/* 数量步进器 */
.stepper { display: inline-flex; align-items: center; border: 1px solid #e3e5e9; border-radius: 20px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; height: 38px; border: none; background: #fff; font-size: 20px; color: #444; line-height: 1; }
.stepper button:active { background: #f2f4f6; }
.stepper span { min-width: 40px; text-align: center; font-size: 16px; font-weight: 600; }

/* 底部结算栏 */
.checkout-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  background: #fff; border-top: 1px solid #eceef1; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
.checkout-bar .sum { flex: 1; font-size: 15px; color: #666; }
.checkout-bar .sum b { color: var(--orange); font-size: 20px; }
.checkout-bar .btn { padding: 12px 22px; }

/* 页面同时有底部导航（.tabbar）与操作栏时，操作栏必须上移，否则会被导航盖住 */
.bottom-bar.above-tabbar, .checkout-bar.above-tabbar { bottom: calc(66px + env(safe-area-inset-bottom)); }
.has-tabbar.has-bar { padding-bottom: 156px; }

/* ================= 地址 ================= */
.addr-card { background: #fff; border-radius: 12px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; }
.addr-card .main { flex: 1; min-width: 0; }
.addr-card .who { font-weight: 600; font-size: 18px; }
.addr-card .who .phone { color: #666; font-weight: 400; margin-left: 8px; font-size: 16px; }
.addr-card .where { color: #555; font-size: 16px; line-height: 1.55; margin-top: 4px; }
/* 操作项做成大按钮：≥44px 触控高度 + 描边底色，避免老年人误触 */
.addr-card .ops { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 16px; }
.addr-card .ops a { display: inline-flex; align-items: center; justify-content: center; min-width: 88px;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--green-d); background: #f4f8f5;
  color: var(--green-d); font-weight: 600; text-decoration: none; }
.addr-card .ops a:active { background: #e4efe7; }
.addr-card .ops a[data-act="del"] { border-color: #c0392b; background: #fdf3f2; }
.addr-card .ops a[data-act="del"]:active { background: #fae3e0; }
.addr-card .ops a[data-act="use"] { border-color: var(--orange); background: #fff6ec; }
.tag-pill { display: inline-block; padding: 3px 10px; border-radius: 12px; background: #fff2e4; color: #d9721a; font-size: 15px; margin-left: 6px; vertical-align: 2px; }
.tag-pill.def { background: #e7f6ec; color: var(--green-d); }

/* 底部弹出面板（地址编辑） */
.sheet-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 120; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 121; background: #fff; border-radius: 16px 16px 0 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 地区级联选择（逐层懒加载的底部面板） */
.region-picker { padding: 12px; border: 1px solid #e3e5e9; border-radius: 8px; background: #fff;
  font-size: 16px; color: #9aa0a8; min-height: 46px; display: flex; align-items: center; }
.region-picker::after { content: "›"; margin-left: auto; color: #c3c8cd; font-size: 20px; }
.region-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 130; }
.region-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 131; background: #fff;
  border-radius: 16px 16px 0 0; height: 62vh; display: flex; flex-direction: column; }
.region-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid #f0f1f3; font-weight: 600; font-size: 17px; }
.region-head a { color: var(--green-d); font-size: 16px; }
.region-head a + a { margin-left: 16px; }
.region-crumb { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid #f5f6f7;
  font-size: 15px; color: var(--green-d); }
.region-crumb .sep { color: #c3c8cd; }
.region-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.region-list .ri { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px;
  font-size: 16px; border-bottom: 1px solid #f7f8f9; }
.region-list .ri:active { background: #f4f8f5; }
.region-list .ri .arrow { color: #c3c8cd; font-size: 18px; }
.region-list .ri.on { color: var(--green-d); font-weight: 600; background: #f4f8f5; }
.region-list .ri.on .arrow { color: var(--green); }
.addr-card.pickable:active { background: #f7f9f8; }

/* ================= 订单进度与物流 ================= */
.steps { display: flex; align-items: flex-start; padding: 6px 0 2px; }
.steps .st { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 14px; }
.steps .st .dot { width: 18px; height: 18px; border-radius: 50%; background: #e3e6ea; margin: 0 auto 5px; position: relative; z-index: 2; }
.steps .st.done .dot { background: var(--green); }
.steps .st.done { color: var(--green-d); font-weight: 600; }
.steps .st::before { content: ""; position: absolute; top: 9px; left: 50%; width: 100%; height: 2px; background: #e3e6ea; }
.steps .st:first-child::before { left: 50%; width: 50%; }
.steps .st:last-child::before { width: 50%; }
.steps .st.done::before { background: var(--green); }
.steps .st .t { display: block; font-size: 13px; color: #a3a9b0; font-weight: 400; margin-top: 2px; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #e8ebee; }
.timeline .node { position: relative; padding: 0 0 14px; }
.timeline .node:last-child { padding-bottom: 0; }
.timeline .node::before { content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #d6dbe0; box-shadow: 0 0 0 2px #fff; }
.timeline .node.cur::before { background: var(--green); box-shadow: 0 0 0 3px rgba(46,158,91,.18); }
.timeline .node .d { font-size: 15px; line-height: 1.5; color: #333; }
.timeline .node .t { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ================= 杂项 ================= */
.status-pill { display: inline-block; padding: 4px 11px; border-radius: 13px; font-size: 14px; font-weight: 600; }
.status-pill.s0 { background: #fff1e3; color: #d9721a; }
.status-pill.s1 { background: #e8f2ff; color: #2b6cb0; }
.status-pill.s2 { background: #f0e9ff; color: #6b46c1; }
.status-pill.s3 { background: #e7f6ec; color: var(--green-d); }
.status-pill.s4 { background: #f0f1f3; color: #888; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.line-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.line-actions .btn { padding: 9px 18px; font-size: 15px; min-height: 40px; }
.btn.grey { background: #f0f1f3; color: #777; }
.btn.outline { background: #fff; color: var(--green-d); border: 1px solid #bfe0cb; }
.sec-title { font-size: 15px; color: var(--muted); margin: 2px 0 8px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.tabs .tab { flex: 0 0 auto; padding: 9px 16px; border-radius: 20px; background: #fff; color: #555; font-size: 15px; border: 1px solid #eceef1; }
.tabs .tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.tabs .tab i { font-style: normal; opacity: .7; margin-left: 3px; }

/* 消息通知 */
.notif { cursor: pointer; }
.notif.unread { background: #f3fbff; border-left: 3px solid var(--orange); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; vertical-align: middle; }
.badge { display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 12px; line-height: 18px; text-align: center; margin-left: 3px; }

/* ================= 手机扫码继续（PC 端） ================= */
.qr-link { cursor: pointer; }
.tq-dialog { text-align: center; }
.tq-box { display: flex; align-items: center; justify-content: center; width: 200px; height: 200px; margin: 0 auto 12px; background: #fff; border: 1px solid #eef0f3; border-radius: 10px; }
.tq-box svg { width: 196px; height: 196px; display: block; }
.tq-loading { color: #999; font-size: 15px; }
.tq-tip { text-align: center; font-size: 15px; color: #444; line-height: 1.7; margin: 0 0 6px; }
.tq-meta { text-align: center; font-size: 14px; color: #999; margin: 0; }
.tq-meta a { color: var(--green, #1f7d44); text-decoration: none; }
