* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #ededed; color: #000;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wx-nav {
  background: #ededed;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 0.5px solid #d6d6d6;
  flex-shrink: 0;
}
.nav-title { font-size: 17px; font-weight: 600; }
.nav-sub { font-size: 12px; color: #07c160; }

.msgs {
  flex: 1; overflow-y: auto;
  background: #ededed;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
}
.msgs::-webkit-scrollbar { width: 0; }
.msg { display: flex; margin-bottom: 12px; align-items: flex-end; }
.msg.mine { flex-direction: row-reverse; }
.bubble {
  max-width: 72%; padding: 9px 12px; border-radius: 12px;
  font-size: 15px; line-height: 1.5; word-break: break-word; white-space: pre-wrap;
}
.msg.other .bubble { background: #fff; color: #000; border-top-left-radius: 3px; }
.msg.mine .bubble { background: #95ec69; color: #000; border-top-right-radius: 3px; }
.bubble img { max-width: 100%; border-radius: 6px; display: block; }
.msg .time { font-size: 10px; color: #999; margin: 0 4px; align-self: flex-end; flex-shrink: 0; }

.wx-inputbar {
  background: #f7f7f7;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 0.5px solid #d6d6d6;
  flex-shrink: 0;
}
.input-wrap { flex: 1; }
#input {
  width: 100%; resize: none; border: none; outline: none;
  background: #fff; border-radius: 6px; padding: 9px 12px;
  font-size: 15px; line-height: 1.4; max-height: 90px;
  font-family: inherit;
}
.send {
  background: #07c160; color: #fff; border-radius: 6px;
  padding: 9px 16px; font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.mic {
  background: #fff; border: 0.5px solid #d6d6d6; border-radius: 6px;
  padding: 8px 12px; font-size: 16px; flex-shrink: 0; cursor: pointer;
}
.mic.active { background: #07c160; }
.hold-talk {
  width: 100%; height: 40px; line-height: 40px; text-align: center;
  background: #fff; border: 0.5px solid #d6d6d6; border-radius: 6px;
  font-size: 15px; color: #333; cursor: pointer; user-select: none;
}
.hold-talk.recording { background: #fde2e2; color: #fa5151; }
.rec-hint {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 14px; background: #fff; border-top: 0.5px solid #d6d6d6;
  font-size: 13px; color: #888; flex-shrink: 0;
}
.rec-hint.cancel { color: #fa5151; }
.rh-timer { font-size: 14px; color: #07c160; }
.voice.playing { opacity: .5; }

/* 引导浮层 */
.guide-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.guide-card {
  background: #fff; border-radius: 16px; padding: 26px 22px;
  width: 100%; max-width: 340px; text-align: center;
}
.guide-icon { font-size: 42px; margin-bottom: 10px; }
.guide-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.guide-text { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 18px; }
.guide-btn { display: block; width: 100%; padding: 11px; border: none; border-radius: 8px; font-size: 15px; margin-bottom: 8px; }
.guide-btn.primary { background: #07c160; color: #fff; font-weight: 600; }
.guide-btn.ghost { background: #f2f2f2; color: #666; }
.hidden { display: none !important; }

/* ---------- 主界面（首页 / 发现） ---------- */
#main { position: fixed; inset: 0; display: flex; flex-direction: column; background: #ededed; }
.main-nav { padding-top: calc(10px + env(safe-area-inset-top)); }
#main .view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; background: #ededed; }
#main .view.active { display: block; }
#tabbar { display: flex; background: #f7f7f7; border-top: 0.5px solid #d6d6d6; padding-bottom: env(safe-area-inset-bottom); flex-shrink: 0; }
#tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 0 6px; color: #999; font-size: 12px; cursor: pointer; }
#tabbar .tab .icon { font-size: 20px; line-height: 1; }
#tabbar .tab.active { color: #07c160; }
.menu { margin-top: 12px; background: #fff; }
.row { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 0.5px solid #eee; }
.row .icon { width: 22px; text-align: center; font-size: 18px; }
.row .name { flex: 1; font-size: 15px; }
/* 首页客服会话行（强制，不可删除） */
#chat-list { padding: 0; }
.vconv { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border-bottom: 0.5px solid #eee; cursor: pointer; }
.vav { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #07c160, #0ab6a8); display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; flex-shrink: 0; }
.vbody { flex: 1; min-width: 0; }
.vname { font-size: 16px; font-weight: 600; }
.vlast { font-size: 13px; color: #999; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtime { color: #bbb; font-size: 20px; }

/* ---------- 聊天全屏 ---------- */
#chat { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: #ededed; }
.nav-back { font-size: 24px; color: #07c160; cursor: pointer; padding-right: 6px; line-height: 1; }

/* ---------- 朋友圈（访客只能看+评论） ---------- */
#moments { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; background: #f5f5f5; }
#mom-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 30px; }
.mom-card { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.mom-head { display: flex; align-items: center; gap: 10px; }
.mav { width: 40px; height: 40px; border-radius: 6px; background: #07c160; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.mhm { flex: 1; min-width: 0; }
.mom-name { font-size: 15px; font-weight: 600; color: #576b95; }
.mom-time { font-size: 12px; color: #bbb; margin-top: 2px; }
.mom-content { font-size: 15px; line-height: 1.5; margin-top: 10px; word-break: break-word; }
.mom-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mom-img { width: calc(33.333% - 4px); aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.mom-foot { display: flex; gap: 12px; margin-top: 10px; border-top: 0.5px solid #eee; padding-top: 8px; }
.mom-like { font-size: 14px; }
.mom-act { font-size: 13px; color: #576b95; cursor: pointer; }
.mom-comments { margin-top: 8px; background: #f7f7f7; border-radius: 6px; padding: 8px 10px; }
.mom-comment { font-size: 14px; line-height: 1.5; word-break: break-word; }
.mc-name { color: #576b95; font-weight: 600; }
#mom-comment-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #f7f7f7; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
#mom-comment-input { flex: 1; border: 1px solid #d6d6d6; border-radius: 18px; padding: 7px 12px; font-size: 14px; }
#mom-comment-send { border: 0; background: #07c160; color: #fff; border-radius: 18px; padding: 0 16px; font-size: 14px; }
/* 图片查看 */
.lb { position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 94%; max-height: 94%; border-radius: 4px; }
