* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #ececea;
  color: #1f1f1f;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
.app { display: flex; gap: 32px; justify-content: center; align-items: flex-start; padding: 28px 20px 40px; min-height: 100vh; }
.stage { position: sticky; top: 28px; display: flex; flex-direction: column; align-items: center; }
.phone-wrap { box-shadow: 0 18px 50px rgba(0,0,0,.18); border-radius: 6px; overflow: hidden; }
.hint { color: #777; font-size: 12px; margin: 12px 0 0; }

/* ---------- 微信聊天页：360px 宽，导出 1008px ---------- */
.phone {
  --bg: #111111; --fg: #e7e7e7; --sb: #ffffff; --nav: #e4e4e4;
  --left: #2c2c2c; --left-fg: #e7e7e7; --right: #3eb676; --right-fg: #000;
  --card: #2c2c2c; --card-fg: #e7e7e7; --card-sub: #a6a6a6;
  --time: #6a6a6a; --name: #8a8a8a; --link: #93a2b4;
  --bar: #1e1e1e; --input: #292929; --icon: #e9e9e9; --mic: #959595;
  --pay: #e18d35; --pay-done: #af6f2a; --red: #f25f4a;
  --pill: #303030; --pill-fg: #d6d6d6; --newmsg: #2c2c2c; --newmsg-line: #3a3a3a; --newmsg-fg: #3eb676;
  --navline: transparent;
  position: relative;
  width: 360px;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Source Han Sans SC", -apple-system, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.phone.light {
  --bg: #eeeeee; --fg: #111; --sb: #333333; --nav: #090909;
  --left: #ffffff; --left-fg: #111; --right: #95ec69; --right-fg: #000;
  --card: #ffffff; --card-fg: #111; --card-sub: #626262;
  --time: #949494; --name: #767676; --link: #576b95;
  --bar: #f7f7f7; --input: #ffffff; --icon: #111; --mic: #656565;
  --pay: #fa9f3c; --pay-done: #fccf9d; --red: #f95352;
  --pill: #d9d9d9; --pill-fg: #070707; --newmsg: #fefefe; --newmsg-line: #cfcfcf; --newmsg-fg: #01a754;
  --navline: #e6e6e6;
}
.phone.full { height: 797.15px; }

.statusbar { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px 0 9.6px; flex: none; color: var(--sb); }
.sb-left { display: flex; align-items: center; }
.sb-time { font-size: 17.5px; font-weight: 500; letter-spacing: -.2px; font-family: Roboto, "HarmonyOS Sans", -apple-system, "Helvetica Neue", Arial, sans-serif; }
.sb-wx { margin-left: 5px; }
.sb-icons { display: flex; align-items: center; height: 38px; }
.sb-icons svg { display: block; flex: none; }
.sb-speed { font-family: Roboto, -apple-system, Arial, sans-serif; font-size: 7.4px; line-height: 7.6px; font-weight: 600; text-align: center; margin-right: 3px; }
.sb-batt { position: relative; width: 26px; height: 13px; border: 1.3px solid currentColor; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-left: 4px; }
.sb-batt::after { content: ""; position: absolute; right: -3.5px; top: 3.5px; width: 2px; height: 4.5px; background: currentColor; border-radius: 0 1px 1px 0; }
.sb-batt span { font-family: Roboto, -apple-system, Arial, sans-serif; font-size: 10.8px; font-weight: 600; line-height: 1; }

.navbar { height: 42px; position: relative; display: flex; align-items: center; justify-content: center; flex: none; color: var(--nav); box-shadow: 0 .5px 0 var(--navline); z-index: 1; }
.nav-back { position: absolute; left: 15.5px; top: 12.6px; width: 9.5px; height: 17px; }
.nav-unread { position: absolute; left: 29px; top: 12px; min-width: 24.5px; height: 17.5px; padding: 0 6px; border-radius: 9px; background: var(--pill); color: var(--pill-fg); font-family: Roboto, -apple-system, Arial, sans-serif; font-size: 13.4px; font-weight: 500; line-height: 17.5px; text-align: center; }
.nav-more { position: absolute; right: 17.5px; top: 19.6px; width: 15.5px; height: 3.2px; fill: currentColor; }
.nav-title { display: flex; align-items: center; max-width: 230px; }
.nav-title span { font-size: 16.4px; font-weight: 500; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-mute { width: 12px; height: 13px; margin-left: 7.5px; flex: none; color: #9e9e9e; }

.newmsg { position: absolute; right: 0; top: 96px; height: 35px; padding: 0 12.5px 0 17px; display: flex; align-items: center; gap: 6px; background: var(--newmsg); border: 1px solid var(--newmsg-line); border-right: 0; border-radius: 17.5px 0 0 17.5px; color: var(--newmsg-fg); font-size: 13.6px; font-weight: 500; z-index: 2; }
.newmsg svg { width: 8px; height: 9px; }

.msgs { flex: 1 1 auto; overflow: hidden; padding: 10px 0 6px; display: flex; flex-direction: column; min-height: 120px; }
.phone.full .msgs.overflow { justify-content: flex-end; }
.row { display: flex; align-items: flex-start; padding: 0 11px; margin-bottom: 11px; flex: none; }
.row.right { flex-direction: row-reverse; }
.avatar { width: 36px; height: 36px; border-radius: 3px; object-fit: cover; flex: none; cursor: pointer; display: block; }
.col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.row.right .col { align-items: flex-end; }
.sender { font-size: 10.8px; line-height: 16px; color: var(--name); margin: 0 0 0 12.4px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.bubble {
  position: relative;
  margin: 0 10.4px;
  max-width: 250.5px;
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 4px;
  font-size: 15.2px;
  line-height: 20px;
  letter-spacing: 0;
  word-break: break-word;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
}
.row.left .bubble { background: var(--left); color: var(--left-fg); }
.row.right .bubble { background: var(--right); color: var(--right-fg); }
.bubble.emoji { font-size: 19px; padding: 8px 10px; letter-spacing: 0; }
.bubble:focus { box-shadow: 0 0 0 1.5px rgba(127,127,127,.45); }
.lnk { color: var(--link); }
.call { display: flex; align-items: center; gap: 7px; cursor: default; }
.row.left .call { flex-direction: row-reverse; }
.call svg { width: 17px; height: 13px; flex: none; }

/* 右侧气泡与左侧卡片的小尖角 */
.tail::after {
  content: ""; position: absolute; top: 12.6px;
  border-style: solid; border-color: transparent;
}
.row.right .tail::after { right: -4.4px; border-width: 5.4px 0 5.4px 5px; border-left-color: var(--tail); }
.row.left .tail::after { left: -4.4px; border-width: 5.4px 5px 5.4px 0; border-right-color: var(--tail); }
.row.right .bubble.tail { --tail: var(--right); }

.pic { margin: 0 10.4px; border-radius: 2px; display: block; cursor: pointer; object-fit: cover; }
.tdiv { text-align: center; font-size: 11.2px; line-height: 14px; color: var(--time); padding: 15.5px 0 21.6px; flex: none; outline: none; letter-spacing: .2px; }

/* 转账 / 红包 */
.pay { position: relative; margin: 0 10.4px; width: 192px; height: 77px; border-radius: 4px; background: var(--pay); --tail: var(--pay); color: #fff; padding: 9px 10px 0; }
.pay.done { background: var(--pay-done); --tail: var(--pay-done); }
.pay.red-pack { width: 192px; }
.pay-main { display: flex; align-items: center; height: 42px; }
.pay-ic { width: 40px; height: 40px; flex: none; }
.pay-txt { margin-left: 7.6px; min-width: 0; }
.pay-amt { font-family: Roboto, "DIN Alternate", -apple-system, Arial, sans-serif; font-size: 15.6px; font-weight: 700; line-height: 18px; }
.pay-note { font-size: 13px; line-height: 17px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-foot { font-size: 10.6px; line-height: 14px; margin-top: 8.4px; opacity: .78; }
.pay.done .pay-main, .pay.done .pay-foot { opacity: .45; }
.phone.light .pay.done .pay-main, .phone.light .pay.done .pay-foot { opacity: .9; }
.rp-ic { width: 32px; height: 40px; flex: none; border-radius: 2px; background: var(--red); position: relative; overflow: hidden; margin-left: 4px; }
.rp-ic::before { content: ""; position: absolute; left: -6px; right: -6px; top: -22px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.08); }
.rp-ic::after { content: "¥"; position: absolute; left: 10.5px; top: 13px; width: 11px; height: 11px; border-radius: 50%; background: #f2c14e; color: #e0892c; font-size: 7px; font-weight: 700; line-height: 11px; text-align: center; }
.rp-txt { font-size: 15.2px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* 聊天记录卡片 */
.record { position: relative; margin: 0 10.4px; width: 197px; border-radius: 4px; background: var(--card); --tail: var(--card); color: var(--card-fg); padding: 8px 9.5px 9px; }
.rec-title { font-size: 15.2px; line-height: 24px; word-break: break-word; margin-bottom: 4px; }
.rec-line { font-size: 13px; line-height: 29.5px; color: var(--card-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-foot { font-size: 10.8px; line-height: 14px; color: var(--card-sub); margin-top: 6px; }

.inputbar { height: 53.5px; background: var(--bar); display: flex; align-items: center; padding: 3px 8.5px 0 9.5px; flex: none; }
.ib-icon { width: 24.2px; height: 24.2px; color: var(--icon); flex: none; }
.ib-input { flex: 1; height: 36px; margin: 0 8.6px 0 9.4px; background: var(--input); border-radius: 4px; position: relative; }
.ib-mic { position: absolute; right: 13.6px; top: 9.4px; width: 11px; height: 16px; color: var(--mic); }
.inputbar .ib-icon + .ib-icon { margin-left: 12.3px; }

/* ---------- 编辑面板 ---------- */
.panel { width: 460px; max-width: 100%; background: #fff; border-radius: 12px; padding: 20px 20px 24px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel h1 { font-size: 18px; margin: 0; font-weight: 600; }
.head-actions { display: flex; gap: 8px; }
.group { border-top: 1px solid #eee; padding-top: 14px; margin-top: 14px; }
.group h2 { font-size: 13px; color: #888; font-weight: 500; margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #666; }
input[type=text], input[type=number], textarea, select {
  font: inherit; font-size: 14px; color: #222; border: 1px solid #dcdcdc; border-radius: 6px; padding: 7px 9px; background: #fff; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #3eb676; }
.seg { display: inline-flex; border: 1px solid #dcdcdc; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.seg button { font: inherit; font-size: 13px; border: 0; background: #fff; padding: 6px 16px; cursor: pointer; color: #444; }
.seg button.on { background: #222; color: #fff; }
.checks { display: flex; gap: 8px 18px; margin-top: 10px; flex-wrap: wrap; }
.checks label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.btn { font: inherit; font-size: 13px; border: 1px solid #d6d6d6; background: #fafafa; color: #222; border-radius: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f0f0f0; }
.btn.primary { background: #07c160; border-color: #07c160; color: #fff; }
.btn.primary:hover { background: #06ad56; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }
.avatars { display: flex; gap: 24px; flex-wrap: wrap; }
.av-item { display: flex; align-items: center; gap: 10px; }
.av-item img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: #ddd; }
.note { font-size: 12px; color: #999; margin: 8px 0 0; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid #ececec; border-radius: 8px; background: #fcfcfc; }
.item .tag { flex: none; width: 44px; text-align: center; font-size: 12px; border-radius: 4px; padding: 7px 0; cursor: pointer; user-select: none; }
.tag.left { background: #e9e9e9; color: #333; }
.tag.right { background: #d5f2e2; color: #157a45; }
.tag.time { background: transparent; color: #999; cursor: default; }
.item textarea { resize: vertical; min-height: 34px; height: 34px; line-height: 1.4; padding: 6px 8px; }
.item textarea.tall { height: 76px; }
.item input[type=text] { padding: 6px 8px; }
.item .thumb { height: 48px; border-radius: 4px; cursor: pointer; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item .kind { font-size: 11px; color: #999; }
.item .inline { display: flex; gap: 6px; align-items: center; }
.item .inline label { flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: #444; }
.item .ops { display: flex; flex: none; gap: 2px; }
.ops button { border: 0; background: transparent; color: #999; width: 24px; height: 30px; cursor: pointer; border-radius: 4px; font-size: 14px; }
.ops button:hover { background: #eee; color: #333; }
.adds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.side-pick { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: #666; margin-top: 12px; }
.side-pick select { width: auto; padding: 5px 8px; font-size: 13px; }

@media (max-width: 860px) {
  .app { flex-direction: column; align-items: center; padding: 16px 12px 32px; }
  .stage { position: static; }
  .panel { width: 100%; max-width: 480px; }
}
