/* ============================================================
 * apps/qchat.css —— Q聊（js/apps/qchat.js）
 *
 * 由原 css/apps.css 按既有的分节标记切分而来（0.3.1 架构整理）。
 * 内容与切分前逐字节一致 —— 只换了存放位置，没动一个字符。
 * 新增样式请放进对应 App 的分片，不要再往已删除的 apps.css 里堆。
 *
 * ★ 整套 App 分片共用的一条规则（原先写在 phone.css 的 apps.css 段首，
 *   拆目录后没地方挂，移到这里当总纲）：
 *
 *   首页上每个 App 有自己的一块颜色（A.color）。所有 AppBar 都按同一条
 *   规则换算 —— 色块本身就是 AppBar 的底色，底部压 12% 的暗调出体积。
 *   不许各写各的渐变：这样"桌面图标 → 打开后的顶栏"是同一个颜色，
 *   切换时眼睛不用重新对。需要主题色的地方直接写 var(--app-bg, ...)。
 * ============================================================ */
/* ============ Q聊 ============ */
.qchat-root { background: var(--bg); }

/* 顶部：跟聊天页同一条骨架，切换时不跳 */
.qchat-appbar {
  --app-bg: #4A9BC9;
  background: linear-gradient(168deg, color-mix(in srgb, var(--app-bg) 88%, #FFFDFB) 0%, var(--app-bg) 100%);
  box-shadow: 0 1px 2px rgba(42, 49, 56, .10), 0 4px 14px rgba(74, 155, 201, .20);
}
.qchat-appbar .qchat-un {
  margin-right: 12px;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .24);
  border: 1px solid rgba(255, 255, 255, .3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600;
}

.qchat-search {
  margin: 10px 12px;
  background: var(--surface);
  border-radius: var(--r);
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-3);
  font-size: 13px;
  gap: 7px;
  box-shadow: var(--e1);
}
.qchat-search .ic-svg { opacity: .7; flex: none; }
.qchat-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qchat-tabbar {
  display: flex;
  height: 46px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  flex: none;
}
.qchat-tabbar .qt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13.5px;
  color: var(--text-2);
  position: relative;
  transition: color var(--fast);
}
.qchat-tabbar .qt .qt-ic { display: inline-flex; align-items: center; opacity: .8; }
.qchat-tabbar .qt.on { color: #3B7EA8; font-weight: 500; }
.qchat-tabbar .qt.on .qt-ic { opacity: 1; }
.qchat-tabbar .qt.on::after {
  content: ''; position: absolute; bottom: 0; left: 22%; right: 22%; height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #5B90AF, #3B7EA8);
}
.qchat-tabbar .qt .badge { margin-left: 4px; }

/* 列表空态：不再用 62px 的圆角方块兜住图标 —— 空态本来就该"轻" */
.q-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.q-empty .qe-ic {
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  opacity: .42;
}

/* ---------- 收款页 ----------
 * 这是整个 Q聊 里唯一"跟钱有关"的一屏，所以给它一块浅色卡片做底，
 * 让余额从聊天列表的灰白里跳出来 —— 但也只跳一档，不做成金色横幅。
 * 钱这种事，克制比醒目更让人信服。
 */
.pay-hero {
  margin: 12px 12px 4px;
  padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(168deg, #FFFDFB 0%, #F7F6F3 100%);
  box-shadow: var(--e2);
}
.pay-hero .ph-label {
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: 1.6px; text-transform: uppercase;
}
.pay-hero .ph-amount {
  font-size: 34px; font-weight: 300; letter-spacing: -1.3px;
  color: #243038; line-height: 1.1; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.pay-hero .ph-split {
  display: flex; gap: 28px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--divider);
}
.pay-hero .ph-split > div { display: flex; flex-direction: column; gap: 3px; }
.pay-hero .phs-k { font-size: 11px; color: var(--text-3); }
.pay-hero .phs-v {
  font-size: 15px; font-weight: 500; color: #2F6B45;
  font-variant-numeric: tabular-nums;
}
.pay-hero .phs-v.warn { color: #A8762A; }

/* 流水行 */
.pay-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px 11px 16px; background: var(--surface);
  position: relative;
}
.pay-row + .pay-row::before {
  content: ''; position: absolute; left: 42px; right: 0; top: 0;
  height: 1px; background: var(--divider);
}
.pay-row .pr-ic {
  width: 22px; height: 22px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #E8F1EA; color: #3F7A52;
}
.pay-row .pr-main { flex: 1; min-width: 0; }
.pay-row .pr-t {
  font-size: 14.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pay-row .pr-s {
  font-size: 11.5px; color: var(--text-3); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pay-row .pr-amt {
  flex: none; font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.pay-row .pr-amt.in { color: #2F6B45; }

/* 待收行：左侧一道短竖线，跟入账行分开 */
.pay-row.warn::after {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 3px 3px 0; background: #D9A63F;
}
.pay-row.warn .pr-amt { color: #A8762A; }

/*
 * 会话行：头像 + 主体两列。
 * 角标挂在头像右上角（.conv-av 相对定位），不占行尾位置 ——
 * 之前角标和"3月12日"都在右端，谁后渲染谁盖住谁，
 * 结果是时间被红点啃掉半个字。
 */
.conv {
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 12px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.conv:active { background: #EDF0F1; }
.conv + .conv::before {
  content: ''; position: absolute; left: 68px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.conv .conv-av { position: relative; flex: none; isolation: isolate; }
.conv .conv-av .badge {
  position: absolute; top: -4px; right: -5px;
  box-shadow: 0 1px 3px rgba(60, 70, 66, .22);
}
.conv .c-body { flex: 1; min-width: 0; margin-left: 12px; }
.conv .c-top { display: flex; align-items: baseline; gap: 8px; }
.conv .c-name {
  font-size: 15px;
  flex: 1;
  min-width: 0;
  letter-spacing: -.05px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .c-time { font-size: 11px; color: var(--text-3); flex: none; }
.conv .c-msg {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .c-msg.dim { color: var(--text-3); }
.conv .c-msg.draft { color: #C0504A; }
.conv.pin { background: var(--surface-2); }

/* 聊天页 */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-scroll {
  flex: 1; overflow-y: auto; padding: 12px 12px 6px;
  /* 聊天底用暖调网格，比纯色有"纸"的质感 */
  background:
    radial-gradient(circle at 1px 1px, rgba(150, 150, 140, .13) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(178deg, #F2F1EE 0%, #EDECE8 100%);
  scroll-behavior: smooth;
}
.msg-row { display: flex; margin-bottom: 12px; align-items: flex-start; }
.msg-row.me { flex-direction: row-reverse; }
.msg-row .m-av { flex: none; }
.msg-row .m-col { max-width: 74%; margin: 0 9px; min-width: 0; }
.msg-row.me .m-col { text-align: right; }
.msg-row .m-name { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.bubble {
  display: inline-block;
  text-align: left;
  background: var(--surface);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 14.5px;
  line-height: 1.55;
  box-shadow: var(--e1);
  position: relative;
  word-break: break-word;
}
.bubble::before {
  content: ''; position: absolute; top: 13px; left: -5px;
  width: 0; height: 0; border: 5px solid transparent; border-right-color: var(--surface); border-left: 0;
}
/* 自己说的话：暖蓝气泡，跟别人的白气泡分开 */
.msg-row.me .bubble {
  background: linear-gradient(160deg, #C8E2F0 0%, #BCDCEE 100%);
  box-shadow: 0 1px 2px rgba(74, 128, 160, .14), 0 3px 10px rgba(74, 128, 160, .12);
}
.msg-row.me .bubble::before {
  left: auto; right: -5px;
  border-right-color: transparent; border-right: 0;
  border-left-color: #C2DFEF;
}
.bubble.sys {
  background: rgba(90, 110, 122, .08);
  color: var(--text-2);
  font-size: 12px;
  box-shadow: none;
  border-radius: 9px;
  padding: 5px 11px;
}
.bubble.sys::before { display: none; }
.msg-time {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin: 8px 0 12px;
}
.msg-row .m-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-start;
}
.msg-row.me .m-actions { justify-content: flex-end; }
.m-actions .btn { height: 30px; font-size: 12.5px; padding: 0 12px; letter-spacing: 0; font-weight: 400; }
.m-actions .btn.done { color: var(--text-3); box-shadow: none; background: transparent; }

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  flex: none;
}
.chat-input textarea {
  flex: 1;
  border: 0;
  background: #F2F4F5;
  border-radius: var(--r);
  padding: 9px 11px;
  font-size: 14px;
  outline: 0;
  resize: none;
  max-height: 84px;
  line-height: 1.45;
}
.chat-input .ci-send {
  width: 42px; height: 36px; flex: none; border-radius: var(--r);
  background: #E7EAEB; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast), transform var(--mag);
}
.chat-input .ci-send:active { transform: scale(.92); }
.chat-input .ci-send.on { background: #2E7CB8; color: #FFFDFB; }
.quick-replies {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px 0; background: var(--surface); flex: none;
}
.quick-replies .chip { margin-bottom: 6px; background: #EEF1F2; }

.group-members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; padding: 14px 12px; }
.gm { text-align: center; font-size: 11px; color: var(--text-2); }
.gm .avatar { margin: 0 auto 4px; }
.gm .gm-tag { font-size: 10px; color: var(--text-3); }
