* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #191919;
  overscroll-behavior: none;
}

/* ---------- 手机壳 ---------- */
.phone {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 430px; margin: 0 auto;
  height: 100dvh;
  background: #EDEDED;
  overflow: hidden;
}

/* ---------- 状态栏 ---------- */
.statusbar {
  flex: 0 0 auto;
  height: calc(40px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: #EDEDED; color: #000;
}
.sb-left { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.sb-right { display: flex; align-items: center; gap: 6px; }
.sbi { fill: currentColor; display: block; }

/* ---------- 导航 ---------- */
.nav {
  flex: 0 0 auto;
  height: 56px;
  display: grid; grid-template-columns: 70px 1fr 70px;
  align-items: center;
  background: #EDEDED;
  border-bottom: .5px solid #DADADA;
  position: relative; z-index: 3;
}
.nav-left {
  display: flex; align-items: center; gap: 2px;
  padding-left: 10px; color: #181818; font-size: 17px;
}
.nav-left svg { margin-top: -1px; }
.nav-badge {
  font-size: 12px; color: #7E7E7E; font-weight: 400;
  letter-spacing: -.5px; margin-left: 1px;
}
.nav-title {
  text-align: center; font-size: 17.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.2px;
}
.nav-right { display: flex; justify-content: flex-end; padding-right: 16px; color: #181818; }

/* ---------- 聊天区 ---------- */
.chat {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #EDEDED;
  padding: 8px 0 14px;
}
.chat::-webkit-scrollbar { width: 0; }

.timediv {
  text-align: center; font-size: 12.5px; color: #A6A6A6;
  margin: 12px 0 10px; letter-spacing: .2px;
}
.sysmsg {
  text-align: center; font-size: 12.5px; color: #A6A6A6;
  margin: 9px 40px; line-height: 1.5;
  display: flex; align-items: center; justify-content: center; gap: 3px;
}
.sysmsg .hl { color: #E9993D; }
.sysmsg svg { flex: 0 0 auto; }
.rp-2line .rp-status { display: block; }

.row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 3px 12px; margin-bottom: 8px;
}
.row.self { flex-direction: row-reverse; }
.avatar {
  width: 40px; height: 40px; border-radius: 5px; flex: 0 0 auto;
  background: #D8D8D8 center/cover no-repeat;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.ph { display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 600; }

.bubble {
  position: relative;
  max-width: calc(100% - 108px);
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 17px; line-height: 1.4; color: #191919;
  word-break: break-word; white-space: pre-wrap;
  background: #fff;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.03);
}
.row.self .bubble { background: #95EC69; }
.bubble::after {
  content: ''; position: absolute; top: 11px;
  width: 0; height: 0;
  border: 4.5px solid transparent;
}
.row.other .bubble::after { left: -8px; border-right-color: #fff; }
.row.self .bubble::after { right: -8px; border-left-color: #95EC69; }

/* 图片 */
.bubble.img { padding: 0; background: transparent !important; box-shadow: none; }
.bubble.img::after { display: none; }
.bubble.img img { display: block; max-width: 120px; max-height: 160px; border-radius: 0; }

/* 语音 */
.bubble.voice {
  display: flex; align-items: center; gap: 8px;
  min-width: 66px; padding: 10px 12px;
}
.voice .wf { display: flex; align-items: center; gap: 2px; }
.voice .wf i { display: block; width: 2px; background: #4A4A4A; border-radius: 1px; }
.voice-dur { font-size: 13px; color: #6E6E6E; margin-left: 2px; }

/* ---------- 转账 / 红包卡片 ---------- */
.bubble.card { padding: 0; background: transparent !important; width: 246px; box-shadow: none; }
.bubble.card::after { display: block; border-width: 5px; }
.row.other .bubble.tail-tf::after { border-right-color: #FA9D3B; }
.row.other .bubble.tail-rp::after { border-right-color: #FA5151; }
.row.other .bubble.tail-rp.open::after { border-right-color: #FBE7D9; }
.card-inner {
  border-radius: 5px; overflow: hidden;
  cursor: pointer; user-select: none;
  -webkit-user-select: none;
}
.card-inner:active { filter: brightness(.96); }

/* 转账 */
.tf {
  background: #FA9D3B; color: #fff;
  padding: 13px 13px 0;
}
.tf-top { display: flex; align-items: center; gap: 10px; }
.tf-ico {
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: #FA9D3B;
  display: grid; place-items: center; flex: 0 0 auto;
  font-size: 17px; font-weight: 700;
}
.tf-amt { font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.tf-sub { font-size: 13px; opacity: .92; margin-top: 6px; }
.tf-foot {
  margin-top: 12px; padding: 7px 0 8px;
  border-top: .5px solid rgba(255,255,255,.28);
  font-size: 11.5px; opacity: .85;
  display: flex; align-items: center; gap: 4px;
}
.tf.done { background: #F6B97C; }
.tf.done .tf-foot { opacity: .95; }

/* 红包 */
.rp {
  background: #FA5151; color: #fff;
  height: 87px; padding: 12px 14px; position: relative;
  display: flex; flex-direction: column; justify-content: flex-start;
  background-size: cover; background-position: center;
}
.rp.has-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,0) 65%);
  pointer-events: none;
}
.rp-top { display: flex; align-items: center; gap: 10px; }
.rp-ico {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 4px; background: #FDD9A6;
  display: grid; place-items: center;
  color: #C7362C; font-size: 15px; font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.rp-txt { font-size: 16.5px; line-height: 1.25; }
.rp-status { font-size: 13px; opacity: .92; margin-top: 4px; }
.rp-foot {
  position: absolute; left: 14px; bottom: 9px;
  font-size: 11px; opacity: .72; z-index: 1;
}
.rp.open { background: #FBE7D9; color: #9B9B9B; }
.rp.open .rp-ico { background: #F6D6BE; color: #C8A58C; }
.rp.open .rp-foot { border-top-color: rgba(0,0,0,.06); }

/* ---------- 输入栏 ---------- */
.inputbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: .5px solid #DADADA;
  color: #181818;
}
.ib-icon { flex: 0 0 auto; color: #181818; }
.ib-field {
  flex: 1 1 auto; height: 36px; border-radius: 4px;
  background: #fff; display: flex; align-items: center;
  padding: 0 10px; font-size: 16px; color: #B2B2B2;
}

/* ---------- 悬浮编辑按钮 ---------- */
.fab {
  position: absolute; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); opacity: 1; transition: opacity .2s;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.42); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(6px); z-index: 5;
}
.fab:active { transform: scale(.94); }

/* ---------- 编辑面板 ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.42); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88dvh; background: #F7F7F7;
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  animation: up .22s cubic-bezier(.32,.72,0,1);
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: .5px solid #E2E2E2;
  font-size: 15px; background: #fff; border-radius: 14px 14px 0 0;
}
.sheet-head b { font-size: 16px; font-weight: 600; }
.sheet-x, .sheet-done {
  border: 0; background: none; font-size: 15px; color: #576B95;
  padding: 4px 2px; cursor: pointer;
}
.sheet-done { font-weight: 600; }
.sheet-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 28px; }

.grp { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.grp h3 {
  margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: #7A7A7A;
  letter-spacing: .3px;
}
.fld { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.fld + .fld { border-top: .5px solid #F0F0F0; }
.fld label { flex: 0 0 72px; font-size: 14px; color: #444; }
.fld input[type=text], .fld input[type=number], .fld textarea, .fld select {
  flex: 1 1 auto; min-width: 0; border: 1px solid #E4E4E4; border-radius: 7px;
  padding: 7px 9px; font-size: 14px; font-family: inherit; background: #FAFAFA;
  color: #191919;
}
.fld textarea { resize: vertical; min-height: 54px; line-height: 1.45; }
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: none; border-color: #576B95; background: #fff; }
.avatar-pick {
  width: 40px; height: 40px; border-radius: 6px; background: #EFEFEF center/cover no-repeat;
  border: 1px dashed #D2D2D2; cursor: pointer; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; color: #9A9A9A;
}
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.msgs { display: flex; flex-direction: column; gap: 8px; }
.mitem {
  border: 1px solid #ECECEC; border-radius: 9px; padding: 9px 10px; background: #FCFCFC;
}
.mitem-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tag {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: #EEF1F7; color: #576B95; font-weight: 600;
}
.tag.self { background: #E9F7DF; color: #4B8A2A; }
.mitem-head .sp { flex: 1 1 auto; }
.mini {
  border: 0; background: #F2F2F2; color: #555; font-size: 12px;
  padding: 4px 7px; border-radius: 6px; cursor: pointer;
}
.mini:active { background: #E6E6E6; }
.mitem input[type=text], .mitem textarea, .mitem input[type=number], .mitem select {
  width: 100%; border: 1px solid #E8E8E8; border-radius: 7px;
  padding: 7px 9px; font-size: 14px; font-family: inherit; background: #fff;
  margin-bottom: 6px;
}
.mitem textarea { min-height: 52px; resize: none; line-height: 1.45; }
.mitem .row2 { display: flex; gap: 8px; }
.mitem .row2 > * { flex: 1 1 0; min-width: 0; }

.addbar { display: flex; flex-wrap: wrap; gap: 8px; }
.addbar button {
  flex: 1 1 30%; border: 1px solid #DFE3EA; background: #fff; color: #2C3E50;
  border-radius: 9px; padding: 9px 6px; font-size: 13.5px; cursor: pointer;
  font-family: inherit;
}
.addbar button:active { background: #F0F2F6; }

.mini.del { color: #C0392B; background: #FFF1F1; }
.danger { flex: 1 1 0; width: auto; margin-top: 4px; border: 1px solid #F3C9C9; background: #FFF6F6; color: #C0392B; border-radius: 9px; padding: 10px; font-size: 14px; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 26%; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; font-size: 13px;
  padding: 9px 14px; border-radius: 8px; z-index: 99; max-width: 80vw; text-align: center;
}

/* 转账/红包详情 */
.detail { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.detail-card {
  width: 300px; background: #fff; border-radius: 12px; overflow: hidden;
  text-align: center; padding: 26px 20px 0;
}
.detail-card .big { font-size: 32px; font-weight: 600; color: #191919; }
.detail-card .sub { font-size: 13px; color: #8A8A8A; margin-top: 6px; }
.detail-card .line { height: 1px; background: #EEE; margin: 20px 0 0; }
.detail-card .who { font-size: 14px; color: #666; padding: 16px 0; }
.detail-card .ok {
  width: 100%; border: 0; background: #07C160; color: #fff;
  font-size: 16px; padding: 14px; cursor: pointer; font-family: inherit;
}

@media (min-width: 700px) {
  body { background: #111; display: grid; place-items: center; }
  .phone { height: min(880px, 94dvh); border-radius: 40px; box-shadow: 0 30px 80px rgba(0,0,0,.6); border: 1px solid #2A2A2A; }
}


/* 底部 Home 横条 */
.homebar {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 138px; height: 5px; border-radius: 3px; background: #000; opacity: .82;
  pointer-events: none; z-index: 6;
}
.phone.no-ui .statusbar, .phone.no-nav .nav, .phone.no-input .inputbar { display: none; }
.phone.no-home .homebar { display: none; }
.fab.hide { display: none; }


.fab.hide { display: none; }


/* ---------- 安卓状态栏 ---------- */
.sb-kb { font-size: 10.5px; color: #1a1a1a; letter-spacing: .1px; transform: scale(.95); }
.sb-5g { font-size: 11px; font-weight: 600; color: #1a1a1a; }
.sb-bat {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 12px; border-radius: 2.5px; border: 1px solid #1a1a1a;
  font-size: 9px; font-weight: 700; color: #1a1a1a; line-height: 1;
}
.sb-bat i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 66%; background: #1a1a1a; border-radius: 1.5px; }
.sb-bat { color: #fff; }
.sb-bat::after { content: ''; position: absolute; right: -3px; top: 3.5px; width: 2px; height: 4px; background: #1a1a1a; border-radius: 0 1px 1px 0; }

/* 红包卡内部对齐 */
.rp-top { align-items: flex-start; }
.rp-body { display: flex; flex-direction: column; min-width: 0; }
.rp.has-cover .rp-txt, .rp.has-cover .rp-status { text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.rp.has-cover .rp-ico { box-shadow: 0 1px 3px rgba(0,0,0,.18); }
