/* ═══════════════════════════════════════════════════════════
   Phone —— 手机外壳、微信框架、群聊与私聊
   屏幕采用微信深色模式：深夜 21:40，谁的手机不是深色的。
   ═══════════════════════════════════════════════════════════ */

.phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  max-height: calc(100dvh - 96px);
  flex: none;
}

.phone-halo {
  position: absolute;
  inset: -70px;
  background: radial-gradient(closest-side, rgba(139, 127, 212, 0.14), transparent 72%);
  filter: blur(24px);
  z-index: -1;
  pointer-events: none;
}

.phone-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -34px;
  height: 44px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.72), transparent 75%);
  filter: blur(10px);
  z-index: -1;
}

.phone-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 52px;
  padding: 11px;
  background: linear-gradient(150deg, #4a5060 0%, #23272f 16%, #14171d 50%, #2b3038 84%, #4a5060 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 34px 90px rgba(0, 0, 0, 0.78),
    0 0 0 12px rgba(0, 0, 0, 0.28),
    inset 2px 2px 3px rgba(255, 255, 255, 0.16),
    inset -2px -3px 4px rgba(0, 0, 0, 0.6);
}

.phone-island {
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 25px;
  border-radius: var(--r-pill);
  background: #05060a;
  z-index: 30;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.phone-island::after {
  content: '';
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #26323f, #070a0f 70%);
  box-shadow: inset 0 0 2px rgba(80, 160, 220, 0.5);
}

.phone-btn {
  position: absolute;
  background: linear-gradient(90deg, #39404c, #23272f);
  border-radius: 2px;
}
.phone-btn-r { right: -3px; top: 190px; width: 4px; height: 86px; }
.phone-btn-l1 { left: -3px; top: 150px; width: 4px; height: 34px; }
.phone-btn-l2 { left: -3px; top: 200px; width: 4px; height: 58px; }

.phone-reflect {
  position: absolute;
  inset: 11px;
  border-radius: 42px;
  pointer-events: none;
  z-index: 25;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.035) 16%,
    transparent 34%,
    transparent 74%,
    rgba(255, 255, 255, 0.028) 92%
  );
  mix-blend-mode: screen;
}

/* ─────────────── 屏幕 ─────────────── */

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background: var(--wx-bg-dark);
  display: flex;
  flex-direction: column;
  color: var(--wx-text-dark);
}

.statusbar {
  flex: none;
  height: 46px;
  padding: 20px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #e6e6e6;
  background: var(--wx-bar);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 20;
}
.statusbar .sb-bat {
  display: inline-block;
  width: 20px;
  height: 10px;
  border: 1.4px solid rgba(230, 230, 230, 0.55);
  border-radius: 3px;
  position: relative;
  vertical-align: -1px;
  margin-left: 4px;
}
.statusbar .sb-bat::after {
  content: '';
  position: absolute;
  left: 1.5px;
  top: 1.5px;
  bottom: 1.5px;
  width: 66%;
  background: #e6e6e6;
  border-radius: 1px;
}

.navbar {
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--wx-bar);
  border-bottom: 0.5px solid var(--wx-bar-line);
  position: relative;
  z-index: 20;
}
.nb-back {
  font-size: 26px;
  line-height: 1;
  color: #d6d6d6;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background var(--t-fast);
  margin-left: -4px;
}
.nb-back:hover { background: rgba(255, 255, 255, 0.08); }
.nb-title {
  font-size: 15.5px;
  font-weight: 500;
  color: #ececec;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-sub {
  font-size: 9.5px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  flex: none;
}

.view-host {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-overlays {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.phone-overlays > * {
  pointer-events: auto;
}

/* ─────────────── 底部标签栏 ─────────────── */

.tabbar {
  flex: none;
  height: 54px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--wx-bar);
  border-top: 0.5px solid var(--wx-bar-line);
  padding-bottom: 2px;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: #8b8b8b;
  position: relative;
  transition: color var(--t-fast);
}
.tab-i {
  font-size: 17px;
  line-height: 1;
  filter: grayscale(1) opacity(0.55);
  transition: filter var(--t-fast);
}
.tab.on {
  color: var(--wechat);
}
.tab.on .tab-i {
  filter: none;
}
.tab-badge {
  position: absolute;
  top: 5px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #fa5151;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
}
/* display:grid 会压过 UA 的 [hidden]{display:none}，必须显式关掉 */
.tab-badge[hidden] {
  display: none;
}

/* ═══════════════ 群聊 ═══════════════ */

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--wx-bg-dark);
}

.chat-topics {
  flex: none;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: #17191d;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.055);
  scrollbar-width: none;
}
.chat-topics::-webkit-scrollbar { display: none; }

.tpill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: #212429;
  color: #9a9a9a;
  font-size: 11.5px;
  white-space: nowrap;
  transition: all var(--t-fast);
  border: 0.5px solid transparent;
}
.tpill:hover { background: #2a2e34; }
.tpill.on {
  background: rgba(62, 207, 142, 0.14);
  border-color: rgba(62, 207, 142, 0.42);
  color: var(--wechat);
}
.tp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fa5151;
  flex: none;
}
.tpill.spoke .tp-dot { background: #4a4a4a; }
.tpill.over .tp-dot { background: #4a4a4a; }
.tpill.spoke { color: #6f6f6f; }
.tp-n {
  font-size: 9px;
  opacity: 0.6;
}
.topics-empty {
  font-size: 11px;
  color: #5f5f5f;
  padding: 4px 6px;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
}

.stream-day {
  text-align: center;
  margin: 8px 0 10px;
}
.stream-day span {
  font-size: 10.5px;
  color: #6b6b6b;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 4px;
}

/* 消息气泡 */
.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
  padding: 3px 0;
}
.msg.enter {
  animation: msgIn 0.34s var(--ease-spring) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(9px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.msg .av { border-radius: 5px; flex: none; }

.msg-body {
  min-width: 0;
  max-width: 74%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-name {
  font-size: 10.5px;
  color: #7a7a7a;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.core-dot {
  font-style: normal;
  font-size: 8.5px;
  color: var(--neon);
  border: 0.5px solid rgba(255, 209, 102, 0.45);
  border-radius: 2px;
  padding: 0 3px;
  letter-spacing: 0.06em;
}

.msg-bubble {
  position: relative;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--wx-bubble-other-dark);
  color: var(--wx-text-dark);
  font-size: 14px;
  line-height: 1.56;
  word-break: break-word;
  animation: none;
}
.msg-bubble.sticker {
  background: transparent;
  font-size: 30px;
  padding: 2px 4px;
  line-height: 1.2;
}
.msg-bubble .at {
  font-style: normal;
  color: #7ea6e0;
}
.msg-bubble.mention {
  border-left: 2px solid var(--neon);
}

.msg.me {
  flex-direction: row;
  justify-content: flex-end;
}
.msg.me .msg-body {
  align-items: flex-end;
}
.msg.me .msg-bubble {
  background: var(--wechat);
  color: #06281c;
}

/* 红包 */
.msg-bubble.rp {
  background: linear-gradient(150deg, #e8543c, #c0392b);
  color: #fff;
  padding: 0;
  overflow: hidden;
  min-width: 190px;
}
.rp-top {
  padding: 9px 12px 6px;
  font-size: 13px;
}
.rp-bottom {
  padding: 5px 12px 9px;
  font-size: 11px;
  opacity: 0.82;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.msg-sys {
  text-align: center;
  margin: 7px 0;
}
.msg-sys span {
  font-size: 10.5px;
  color: #6f6f6f;
  background: rgba(255, 255, 255, 0.055);
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  max-width: 88%;
  line-height: 1.5;
}
.msg-sys.rp-me span {
  color: var(--neon);
  background: rgba(255, 209, 102, 0.1);
}

/* ─────────────── 插话面板 ─────────────── */

.chat-sheet {
  flex: none;
  background: #1a1c21;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 4px;
}
.sheet-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--wechat);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.heat {
  display: flex;
  align-items: center;
  gap: 7px;
}
.heat-label {
  font-size: 10px;
  font-family: var(--font-mono);
}
.heat-bar {
  width: 62px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.heat-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width var(--t-mid) var(--ease-out);
}
.heat-hot .heat-label { color: var(--pepper); }
.heat-hot .heat-bar i { background: var(--pepper); }
.heat-warm .heat-label { color: var(--neon); }
.heat-warm .heat-bar i { background: var(--neon); }
.heat-cold .heat-label { color: var(--chili); }
.heat-cold .heat-bar i { background: var(--chili); }

.sheet-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 10px;
  max-height: 268px;
  overflow-y: auto;
}

.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #23262c;
  border: 0.5px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  transition: all var(--t-fast) var(--ease-out);
  animation: optIn 0.34s var(--ease-spring) both;
}
.opt:nth-child(1) { animation-delay: 0.02s; }
.opt:nth-child(2) { animation-delay: 0.06s; }
.opt:nth-child(3) { animation-delay: 0.1s; }
.opt:nth-child(4) { animation-delay: 0.14s; }
.opt:nth-child(5) { animation-delay: 0.18s; }
.opt:nth-child(6) { animation-delay: 0.22s; }
@keyframes optIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.opt:hover {
  background: #2c3037;
  border-color: rgba(62, 207, 142, 0.4);
  transform: translateX(3px);
}
.opt-text {
  font-size: 13.5px;
  color: #dedede;
  line-height: 1.5;
}
.opt-tones {
  display: flex;
  gap: 3px;
  flex: none;
  flex-wrap: wrap;
  max-width: 76px;
  justify-content: flex-end;
}
.tone {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(62, 207, 142, 0.14);
  color: var(--wechat);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.tone.neg {
  background: rgba(255, 77, 61, 0.16);
  color: #ff8b7e;
}

.sheet-foot {
  display: flex;
  gap: 7px;
  padding: 0 12px 12px;
}
.sheet-skip {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  background: transparent;
  border: 0.5px dashed rgba(255, 255, 255, 0.16);
  color: #7a7a7a;
  font-size: 12px;
  transition: all var(--t-fast);
}
.sheet-skip:hover {
  color: #a8a8a8;
  border-color: rgba(255, 255, 255, 0.3);
}
.sheet-free {
  flex: none;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(139, 127, 212, 0.14);
  border: 0.5px solid rgba(139, 127, 212, 0.42);
  color: #c3bbf0;
  font-size: 12px;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.sheet-free:hover {
  background: rgba(139, 127, 212, 0.24);
}

.sheet-done,
.sheet-wait {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: #7a7a7a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dots {
  display: inline-flex;
  gap: 3px;
}
.dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--wechat);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.16s; }
.dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotBounce {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-input {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 9px;
  background: var(--wx-bar);
  border-top: 0.5px solid var(--wx-bar-line);
}
.ci-icons {
  display: flex;
  gap: 8px;
  font-size: 17px;
  opacity: 0.7;
}
.ci-field {
  flex: 1;
  background: #26292e;
  border: 0.5px solid transparent;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--wx-text-dark);
  min-width: 0;
  outline: none;
  font-family: inherit;
  transition: border-color var(--t-fast);
}
.ci-field::placeholder {
  color: #6f6f6f;
}
.ci-field:focus {
  border-color: rgba(62, 207, 142, 0.5);
}
.ci-field:disabled {
  opacity: 0.5;
}
.ci-field.hint-pulse {
  animation: hintPulse 0.9s var(--ease-out);
}
@keyframes hintPulse {
  0%, 100% { border-color: transparent; }
  30% { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 127, 212, 0.18); }
}
.ci-send {
  padding: 7px 13px;
  border-radius: 6px;
  background: var(--wechat-deep);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--t-fast);
}
.ci-send:disabled {
  background: #2f3238;
  color: #5c5c5c;
  cursor: not-allowed;
}

/* 自由发言的反馈卡 */
.report-free .report-title {
  color: var(--violet);
}
.report-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.65;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.report-warn {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--neon);
  font-family: var(--font-mono);
}

/* ─────────────── 发言反馈浮层 ─────────────── */

.report {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  z-index: 20;
  background: rgba(12, 15, 22, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  width: calc(100% - 48px);
  max-width: 340px;
  backdrop-filter: blur(20px);
  box-shadow: var(--sh-3);
  opacity: 0;
  transition: all var(--t-mid) var(--ease-spring);
}
.report.in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.report-title {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--paper);
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.report-row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12.5px;
}
.rr-name { color: var(--text); }
.rr-reason { color: var(--text-mute); font-size: 11px; }
.rr-delta {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-dim);
}
.rr-delta.up { color: var(--pepper); }
.rr-delta.down { color: var(--chili); }
.report-extra {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ═══════════════ 私聊 ═══════════════ */

.dm {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--wx-bg-dark);
}
.dm-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.055);
  background: #17191d;
}
.dm-name {
  flex: 1;
  font-size: 13.5px;
  color: #d6d6d6;
}
.dm-rounds {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}
.dm-rounds.active {
  color: var(--neon);
}
.dm-rounds b {
  font-size: 12px;
}

/* 会话用完了 / 没开 → 重新开始的入口 */
.dm-restart {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.dm-restart-note {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.7;
  padding: 0 2px;
}
.dm-restart .dm-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dm-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.dm-empty {
  color: #5f5f5f;
  font-size: 12.5px;
  text-align: center;
  padding: 30px 0;
}
.dm-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: msgIn 0.3s var(--ease-spring) both;
}
.dm-msg.me {
  justify-content: flex-end;
}
.dm-bubble {
  max-width: 70%;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--wx-bubble-other-dark);
  color: var(--wx-text-dark);
  font-size: 14px;
  line-height: 1.6;
}
.dm-msg.me .dm-bubble {
  background: var(--wechat);
  color: #06281c;
}
.dm-chip {
  align-self: center;
  font-size: 10.5px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mute);
}
.dm-chip.up { color: var(--pepper); background: rgba(47, 211, 168, 0.12); }
.dm-chip.down { color: var(--chili); background: rgba(255, 77, 61, 0.12); }

.dm-opts {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  background: #1a1c21;
  border-top: 0.5px solid rgba(255, 255, 255, 0.07);
  max-height: 52%;
  overflow-y: auto;
}
.dm-picks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 自己打字 */
.dm-free {
  display: flex;
  gap: 7px;
  margin-top: 4px;
  padding-top: 9px;
  border-top: 0.5px dashed rgba(255, 255, 255, 0.12);
}
.dm-free-field {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 7px;
  background: #26292e;
  border: 0.5px solid transparent;
  color: var(--wx-text-dark);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--t-fast);
}
.dm-free-field::placeholder {
  color: #6f6f6f;
}
.dm-free-field:focus {
  border-color: rgba(139, 127, 212, 0.55);
}
.dm-free-send {
  flex: none;
  padding: 9px 14px;
  border-radius: 7px;
  background: rgba(139, 127, 212, 0.85);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--t-fast);
}
.dm-free-send:hover {
  background: var(--violet);
}
.dm-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #23262c;
  border: 0.5px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  font-size: 13.5px;
  color: #dedede;
  transition: all var(--t-fast) var(--ease-out);
}
.dm-opt:hover {
  background: #2c3037;
  transform: translateX(3px);
  border-color: rgba(62, 207, 142, 0.4);
}
.dm-opt em {
  font-style: normal;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #6f6f6f;
  flex: none;
}
.dm-opt.invite {
  border-color: rgba(139, 127, 212, 0.45);
}
.dm-opt.invite:hover { border-color: var(--violet); }
.dm-opt.invite em { color: var(--violet); }
.dm-opt.confess {
  border-color: rgba(255, 77, 61, 0.45);
  background: linear-gradient(100deg, rgba(255, 77, 61, 0.1), #23262c 60%);
}
.dm-opt.confess em { color: var(--chili); }
