/* ============================================================
   微信小程序体验布局（预览模式 = 小程序 时生效）
   ------------------------------------------------------------
   还原小程序三段式结构：状态栏 → 导航栏（标题 + 胶囊）→ 页面 → tabBar
   组件风格贴近 WeUI：cell 列表、宫格、圆角卡片、无侧边栏无顶栏
   ============================================================ */

.wxapp {
  width: 100%;
  max-width: 375px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  border: 1px solid var(--border-hi);
  font-size: 14px;
}

/* ---------- 状态栏 ---------- */
.wxapp-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px 4px; font-size: 12px; color: var(--txt-2);
  background: var(--panel); letter-spacing: .3px;
}
.wxapp-status .st-time { font-weight: 600; color: var(--txt); }
.wxapp-status .st-right { display: flex; align-items: center; gap: 5px; }
.wxapp-status .st-battery {
  width: 22px; height: 11px; border: 1px solid currentColor; border-radius: 3px;
  position: relative; padding: 1px;
}
.wxapp-status .st-battery::after {
  content: ""; position: absolute; right: -3px; top: 3px;
  width: 2px; height: 4px; background: currentColor; border-radius: 0 2px 2px 0;
}
.wxapp-status .st-battery i { display: block; height: 100%; width: 72%; background: currentColor; border-radius: 1px; }

/* ---------- 导航栏 ---------- */
.wxapp-nav {
  display: flex; align-items: center; height: 44px; padding: 0 10px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: relative;
}
.wxapp-nav .nv-back {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--txt); flex-shrink: 0;
}
.wxapp-nav .nv-title {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 16px; font-weight: 600; color: var(--txt); pointer-events: none;
}
.wxapp-nav .nv-capsule {
  margin-left: auto; display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border-hi); border-radius: 16px; height: 30px;
  background: var(--panel-2); overflow: hidden; flex-shrink: 0;
}
.wxapp-nav .nv-capsule span {
  width: 40px; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--txt);
}
.wxapp-nav .nv-capsule span:first-child { border-right: 1px solid var(--border); font-size: 15px; }

/* ---------- 页面容器 ---------- */
.wxapp-page {
  height: 620px; overflow-y: auto; overflow-x: hidden;
  background: var(--bg); padding-bottom: 12px;
}
.wxapp-page::-webkit-scrollbar { width: 0; }
.wxapp-body { padding: 12px; }

/* ---------- 底部 tabBar ---------- */
.wxapp-tabbar {
  display: flex; background: var(--panel); border-top: 1px solid var(--border);
  padding: 5px 0 calc(5px + env(safe-area-inset-bottom, 0px));
}
.wxapp-tabbar .tb-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 3px 0; cursor: pointer; color: var(--txt-3); font-size: 10px;
}
.wxapp-tabbar .tb-item .tb-icon { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .65; }
.wxapp-tabbar .tb-item.on { color: var(--accent); }
.wxapp-tabbar .tb-item.on .tb-icon { filter: none; opacity: 1; }

/* ---------- 用户卡（首页头部） ---------- */
.wxapp-hero {
  margin: 12px; padding: 16px; border-radius: 14px; color: #fff;
  background: var(--grad); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.wxapp-hero .wh-top { display: flex; align-items: center; gap: 12px; }
.wxapp-hero .wh-avatar {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.wxapp-hero .wh-name { font-size: 16px; font-weight: 600; }
.wxapp-hero .wh-sub { font-size: 11.5px; opacity: .85; margin-top: 3px; }
.wxapp-hero .wh-chip {
  margin-left: auto; background: rgba(255, 255, 255, .22); border-radius: 12px;
  padding: 3px 10px; font-size: 11px; white-space: nowrap;
}
.wxapp-hero .wh-stats { display: flex; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .22); }
.wxapp-hero .wh-stat { flex: 1; text-align: center; }
.wxapp-hero .wh-stat b { display: block; font-size: 17px; font-weight: 700; }
.wxapp-hero .wh-stat span { font-size: 10.5px; opacity: .85; }

/* ---------- 宫格入口 ---------- */
.wxapp-grid {
  margin: 0 12px; background: var(--panel); border-radius: 14px; padding: 6px 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.wxapp-grid .wg-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 2px; cursor: pointer; gap: 5px;
}
.wxapp-grid .wg-icon {
  width: 38px; height: 38px; border-radius: 12px; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--accent);
}
.wxapp-grid .wg-text { font-size: 11px; color: var(--txt-2); }

/* ---------- cell 列表（WeUI 风格） ---------- */
.wxapp-cells { margin: 12px; background: var(--panel); border-radius: 14px; overflow: hidden; }
.wxapp-cells .wc-title {
  font-size: 12px; color: var(--txt-3); padding: 12px 14px 6px;
}
.wxapp-cell {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); font-size: 14px; color: var(--txt);
}
.wxapp-cell:last-child { border-bottom: none; }
.wxapp-cell .wc-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.wxapp-cell .wc-main { flex: 1; min-width: 0; }
.wxapp-cell .wc-desc { font-size: 11px; color: var(--txt-3); margin-top: 3px; }
.wxapp-cell .wc-val { font-size: 12.5px; color: var(--txt-3); }
.wxapp-cell .wc-arrow { color: var(--txt-3); font-size: 13px; }
.wxapp-cell.tap { cursor: pointer; }
.wxapp-cell.tap:active { background: var(--panel-2); }

/* ---------- 卡片 ---------- */
.wxapp-card { margin: 12px; background: var(--panel); border-radius: 14px; padding: 14px; }
.wxapp-card .wcard-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; }
.wxapp-card .wcard-title .wt-right { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--txt-3); }

/* ---------- 数据条 ---------- */
.wxapp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.wxapp-bar .wb-label { width: 52px; color: var(--txt-2); flex-shrink: 0; }
.wxapp-bar .wb-track { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.wxapp-bar .wb-fill { height: 100%; background: var(--grad); border-radius: 3px; }
.wxapp-bar .wb-val { width: 76px; text-align: right; color: var(--txt-3); font-size: 11px; }

/* ---------- 评论行 ---------- */
.wxapp-comment { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.wxapp-comment .wc-av { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.wxapp-comment .wc-body { flex: 1; min-width: 0; }
.wxapp-comment .wc-nick { font-size: 13px; color: var(--txt-2); }
.wxapp-comment .wc-text { font-size: 13.5px; margin: 4px 0 6px; line-height: 1.5; }
.wxapp-comment .wc-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--txt-3); flex-wrap: wrap; }
.wxapp-comment .wc-reply { font-size: 12.5px; color: var(--accent); background: var(--panel-2); border-radius: 8px; padding: 6px 9px; margin-top: 6px; }

/* ---------- 标签 ---------- */
.wxapp-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 8px; background: var(--panel-2); color: var(--txt-2); }
.wxapp-tag.ok { color: var(--ok); background: rgba(46, 213, 115, .12); }
.wxapp-tag.warn { color: var(--orange); background: rgba(247, 185, 85, .12); }
/* 先给静态降级色，再用 color-mix 渐进增强（旧版 WebKit/搜狗不识别 color-mix 时仍有底色） */
.wxapp-tag.acc { color: var(--accent); background: rgba(232, 62, 140, .14); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ---------- 小程序内按钮 ---------- */
.wxapp-btn {
  display: block; width: 100%; padding: 11px; border-radius: 10px; text-align: center;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer;
  border: none; font-family: inherit;
}
.wxapp-btn.ghost { background: var(--panel-2); color: var(--txt); }
.wxapp-btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(255, 91, 110, .4); }

/* ---------- 空态 ---------- */
.wxapp-empty { text-align: center; padding: 40px 20px; color: var(--txt-3); font-size: 12.5px; }
.wxapp-empty .we-icon { font-size: 34px; opacity: .5; margin-bottom: 10px; }
