html {
  scroll-behavior: auto;
  background: #f6f6f5;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #2f2f2f;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景照片层：先用雾感渐变占位，接口留好，随时可以换成真实照片 ---------- */
.bg-photo {
  position: fixed;
  inset: -20px;
  z-index: -2;
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2px) brightness(1) contrast(1.02);
  transform: scale(1.1);
  transition: transform 0.6s ease-out;
  animation: bgFadeIn 0.8s ease-out;
}
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255,255,255,0.12);
  animation: bgFadeIn 0.8s ease-out;
}
@keyframes bgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 顶部悬浮胶囊 ---------- */
.topbar {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 0;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
}
.topbar.hide { transform: translateY(-130%); opacity: 0; }

.navcircle {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid rgba(255,255,255,0.4);
  color: #7a7a7a;
  font-size: 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 10px 35px rgba(0,0,0,0.06);
}

.navtitle {
  flex: 1;
  height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 10px 35px rgba(0,0,0,0.06);
  color: #2f2f2f;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
}

.navside { display: flex; gap: 8px; flex-shrink: 0; }
.navpill {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 10px 35px rgba(0,0,0,0.06);
  font-size: 15px;
  text-decoration: none;
}
.navpill:active, .navcircle:active { transform: scale(0.94); }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 72%;
  max-width: 260px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  border-right: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset -1px 0 1px rgba(255,255,255,0.4), 0 10px 35px rgba(0,0,0,0.08);
  transform: translateX(-105%);
  transition: transform 0.3s ease-out;
  z-index: 30;
  padding: calc(20px + env(safe-area-inset-top,0px)) 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer.open { transform: translateX(0); }
.drawer-title { font-size: 12px; color: #b6b6b6; letter-spacing: 2px; margin-bottom: 6px; }
.drawer a, .drawer-soon {
  font-size: 14px;
  color: #2f2f2f;
  text-decoration: none;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.drawer-soon { color: #b6b6b6; }
.di { width: 18px; height: 18px; flex-shrink: 0; }
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.12);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

/* ---------- 消息区 ---------- */
.messages {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 92px 22px 10px;
  transition: padding-top 0.3s ease-out;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.messages.topbar-hidden { padding-top: 20px; }

.msggroup { display: flex; flex-direction: column; gap: 12px; }
.msggroup.user { align-items: flex-end; }
.msggroup.assistant { align-items: flex-start; }

.grouptime {
  font-size: 12px;
  color: rgba(0,0,0,0.4);
  padding: 0 48px;
  align-self: center;
  display: flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.grouptime .dot { font-size: 4px; }

.row { display: flex; align-items: flex-start; gap: 8px; }
.row.user { flex-direction: row-reverse; }

.avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: block; }
.avatar-wrap { flex-shrink: 0; }
.avatar-wrap.hidden { visibility: hidden; }

.msg-meta-row { display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }

.thinking-cloud {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #a8a8a8;
  padding: 0;
  cursor: pointer;
}
.thinking-cloud:active { transform: scale(0.9); color: #888; }

.thinking-panel {
  display: none;
  font-size: 12px;
  line-height: 1.5;
  color: #8a8a8a;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 8px 12px;
  max-width: 70vw;
  white-space: pre-wrap;
}
.thinking-panel.open { display: block; }

.tool-chip {
  font-size: 11px;
  color: #b0b0b0;
  padding: 2px 0;
}

.bubble-col { display: flex; flex-direction: column; max-width: 70vw; gap: 4px; }
.row.user .bubble-col { align-items: flex-end; }
.row.assistant .bubble-col { align-items: flex-start; }

.msg {
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2px;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: rise 0.4s ease-out;
  position: relative;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.row.user .msg {
  background: rgba(217,196,198,0.7);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  color: #5a4142;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35), 0 10px 35px rgba(0,0,0,0.08);
  cursor: pointer;
}
.row.assistant .msg {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  color: #2f2f2f;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.65), 0 10px 35px rgba(0,0,0,0.06);
  white-space: normal;
}
.msg p { margin: 0; }
.msg p + p { margin-top: 0.4em; }
.msg.typing { color: #b6b6b6; font-style: italic; }
.msg.typing::after {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: 4px;
  border-radius: 50%;
  background: #b6b6b6;
  animation: pulse 1.1s infinite ease-in-out;
}
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- 底部大圆角毛玻璃卡片 ---------- */
.inputwrap {
  flex-shrink: 0;
  position: sticky;
  bottom: var(--kb, 0px);
  z-index: 20;
  margin: 0 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(30px) saturate(1.7);
  -webkit-backdrop-filter: blur(30px) saturate(1.7);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 32px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 0 10px 35px rgba(0,0,0,0.08);
  padding: 10px 12px 12px;
  animation: slideUp 0.4s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ---------- 图片预览条：选图后显示在输入框上方 ---------- */
.img-preview-strip {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 4px;
}
.img-preview-strip.has-imgs {
  display: flex;
}
.img-preview-item {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  animation: rise 0.25s ease-out;
}
.img-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-preview-item .img-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  border: none;
  cursor: pointer;
}

.inputrow1 { padding: 4px 6px 4px; }
#input {
  width: 100%;
  border: none;
  padding: 6px 4px;
  font-size: 16px;
  background: transparent;
  outline: none;
  color: #2f2f2f;
}
#input::placeholder { color: #b6b6b6; }

.inputrow2 { display: flex; align-items: center; gap: 6px; }
.spacer { flex: 1; }

.iconbtn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #7a7a7a;
  font-size: 17px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}
.iconbtn:active, .iconbtn.active { transform: scale(0.95); opacity: 0.7; }

.modelPicker {
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 10.5px;
  background: rgba(0,0,0,0.04);
  color: #7a7a7a;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.modelMenu {
  position: fixed;
  display: none;
  flex-direction: column;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 60;
  min-width: 110px;
}
.modelMenu.open { display: flex; }
.modelMenu div {
  padding: 9px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modelMenu div b { font-size: 12.5px; font-weight: 600; color: #2f2f2f; }
.modelMenu div span { font-size: 10px; color: #b0b0b0; }
.modelMenu div:active { background: rgba(0,0,0,0.05); }
.modelMenu div + div { border-top: 1px solid rgba(0,0,0,0.05); }

/* ---------- 消息操作条：编辑 / 复制 / 撤回 ---------- */
.msg-actions {
  display: none;
  gap: 6px;
}
.msg-actions.open { display: flex; }
.msg-actions button {
  border: none;
  background: rgba(0,0,0,0.05);
  color: #7a7a7a;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}
.msg-actions button:active { transform: scale(0.95); opacity: 0.7; }

.msg .edit-area {
  width: 100%;
  min-width: 140px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  resize: none;
  outline: none;
}
.msg .edit-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.msg .edit-btns button {
  border: none;
  background: rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  color: inherit;
  cursor: pointer;
}

.sysmsg {
  align-self: center;
  font-size: 11px;
  color: #b6b6b6;
  padding: 2px 0;
}

.msg-img {
  max-width: 60vw;
  max-height: 340px;
  border-radius: 20px;
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 35px rgba(0,0,0,0.1);
  animation: rise 0.4s ease-out;
}
.msg-img-grid {
  display: grid;
  gap: 4px;
  animation: rise 0.4s ease-out;
}
.msg-img-grid.g2 { grid-template-columns: 1fr 1fr; max-width: 60vw; }
.msg-img-grid.g3 { grid-template-columns: 1fr 1fr 1fr; max-width: 60vw; }
.msg-img-grid.g4 { grid-template-columns: 1fr 1fr; max-width: 60vw; }
.msg-img-grid .msg-img {
  max-width: 100%; max-height: 180px;
  width: 100%; height: 100%;
  border-radius: 12px;
}

.searched-badge {
  display: flex;
  align-items: center;
  color: #b0b0b0;
  padding-left: 4px;
  margin-bottom: 1px;
  animation: rise 0.4s ease-out;
}

#actionBtn {
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}
#actionBtn:active { transform: scale(0.95); opacity: 0.7; }
#actionBtn .send-icon { display: none; color: #fff; font-size: 15px; }
#actionBtn .wave-icon { display: flex; color: #fff; }
#actionBtn.callmode { background: #6b6b6b; }
#actionBtn.sendmode { background: #2f2f2f; }
#actionBtn.sendmode .wave-icon { display: none; }
#actionBtn.sendmode .send-icon { display: block; }

::-webkit-scrollbar { width: 0; height: 0; }

/* 晏的语音条：奶白圆条+波形+秒数，播放时波形呼吸 */
.voice-bar { display: inline-flex; align-items: center; gap: 9px; padding: 10px 15px; margin-bottom: 6px;
  background: rgba(255,255,255,.78); border-radius: 999px; box-shadow: 0 1px 8px rgba(60,58,70,.06);
  cursor: pointer; user-select: none; -webkit-user-select: none; max-width: 240px; width: fit-content; }
.voice-bar .vb-play { width: 0; height: 0; border-left: 10px solid #8a8792;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; flex-shrink: 0; }
.voice-bar.playing .vb-play { border: none; width: 9px; height: 13px;
  border-left: 3px solid #8a8792; border-right: 3px solid #8a8792; }
.voice-bar .vb-wave { display: flex; align-items: center; gap: 2.5px; }
.voice-bar .vb-wave span { width: 2.5px; border-radius: 2px; background: #cbc8d1; }
.voice-bar.playing .vb-wave span { background: #a8847c; animation: vbpulse 1s ease-in-out infinite; }
.voice-bar.playing .vb-wave span:nth-child(3n) { animation-delay: .2s; }
.voice-bar.playing .vb-wave span:nth-child(3n+1) { animation-delay: .35s; }
@keyframes vbpulse { 0%,100% { transform: scaleY(.55); } 50% { transform: scaleY(1.2); } }
.voice-bar .vb-dur { font-size: 11.5px; color: #a09da8; font-variant-numeric: tabular-nums; }

/* 语音消息排版：语音条+下方转文字，不走气泡 */
.voice-msg { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.row.user .voice-msg { align-items: flex-end; }
.voice-text { font-size: 13.5px; line-height: 1.75; color: #6b6873; padding: 0 6px; max-width: 76vw; white-space: pre-wrap; }
.row.user .voice-text { text-align: left; }
#micBtn.recording { color: #b06a5e !important; animation: recpulse 1.1s ease-in-out infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(1.15); } }

/* 按住说话（微信式） */
#talkPill { width: 100%; text-align: center; padding: 11px 0; border-radius: 14px;
  background: rgba(255,255,255,.7); color: #8a8792; font-size: 14px; font-weight: 500;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; cursor: pointer; }
#talkPill.talking { background: rgba(168,132,124,.28); color: #5a5862; }
#talkPill.cancel { background: rgba(176,106,94,.32); color: #7a4a42; }
#micBtn.active { color: #a8847c !important; }

/* 静态语音条（通话时用户说的话，没有音频文件，纯视觉） */
.voice-bar.static { cursor: default; }
.voice-bar.static .vb-play { border-left-color: #b8aca7; }
.row.user .voice-bar { background: rgba(168,132,124,.16); }
.row.user .voice-bar .vb-wave span { background: #c4b5af; }

/* vb-wave弹性：自适应宽度下波形填满剩余空间 */
.voice-bar .vb-wave { flex: 1; overflow: hidden; justify-content: center; }

/* 通话界面P30 */
#callOverlay { position: fixed; inset: 0; z-index: 999; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(247,246,243,.82); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
#callOverlay.open { display: flex; }
#callOverlay .co-avatar { width: 108px; height: 108px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 6px 30px rgba(60,58,70,.18); }
#callOverlay .co-name { font-size: 22px; font-weight: 600; color: #4a4852; letter-spacing: 2px; }
#callOverlay .co-status { font-size: 13.5px; color: #a09da8; }
#callOverlay .co-timer { font-size: 13px; color: #8a8792; font-variant-numeric: tabular-nums; min-height: 18px; }
#coHang { position: absolute; bottom: 64px; width: 66px; height: 66px; border-radius: 50%;
  border: none; background: #d97b6c; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 22px rgba(217,123,108,.4); cursor: pointer; }
#coHang:active { transform: scale(.93); }

/* 通话芯片 + 展开记录 */
.call-chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px;
  background: rgba(255,255,255,.72); border-radius: 999px; font-size: 13.5px; color: #6b6873;
  box-shadow: 0 1px 8px rgba(60,58,70,.06); cursor: pointer; user-select: none; width: fit-content; }
.call-log { display: none; margin-top: 8px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.55); max-width: 80vw; }
.call-log.open { display: block; }
.call-log .cl-line { font-size: 12.5px; line-height: 1.7; color: #6b6873; margin: 4px 0; }
.call-log .cl-line b { font-weight: 600; margin-right: 6px; color: #8a8792; }
.call-log .cl-line.user b { color: #a8847c; }

/* 通话实时字幕 */
#callOverlay .co-caption { min-height: 44px; max-width: 78vw; text-align: center;
  font-size: 14px; line-height: 1.7; color: #6b6873; padding: 0 10px; }

/* callBar通话条：聊天内通话模式 */
#callBar { display: none; align-items: center; gap: 9px; padding: 8px 14px; margin-bottom: 8px;
  background: rgba(255,255,255,.72); border-radius: 999px; box-shadow: 0 1px 8px rgba(60,58,70,.06); }
#callBar .cb-dot { width: 8px; height: 8px; border-radius: 50%; background: #7fae8e; flex-shrink: 0;
  animation: cbpulse 1.6s ease-in-out infinite; }
@keyframes cbpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
#cbText { flex: 1; font-size: 12.5px; color: #6b6873; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cbTimer { font-size: 12px; color: #a09da8; font-variant-numeric: tabular-nums; }
#cbHang { border: none; background: #d97b6c; color: #fff; font-size: 12px; padding: 6px 14px;
  border-radius: 999px; cursor: pointer; flex-shrink: 0; }
#actionBtn.oncall { color: #d97b6c !important; }

/* loadOlderBtn 翻旧账按钮 */
#loadOlderBtn { display: block; margin: 6px auto 14px; padding: 7px 18px; border: none;
  border-radius: 999px; background: rgba(255,255,255,.6); color: #a09da8; font-size: 12px; cursor: pointer; }
#loadOlderBtn:active { opacity: .6; }

/* artifact-card 网页小作品卡片 */
.artifact-card { display: flex; align-items: center; gap: 11px; padding: 13px 16px; max-width: 260px;
  background: rgba(255,255,255,.75); border-radius: 18px; box-shadow: 0 1px 8px rgba(60,58,70,.06);
  text-decoration: none; color: inherit; }
.artifact-card .ac-icon { font-size: 20px; }
.artifact-card .ac-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.artifact-card .ac-title { font-size: 13.5px; font-weight: 600; color: #5a5862;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-card .ac-sub { font-size: 11px; color: #a09da8; }
.artifact-card .ac-open { margin-left: auto; color: #a8847c; font-size: 15px; }

/* song-card 点歌卡片 */
.song-card { display: flex; flex-direction: column; gap: 9px; padding: 14px 17px; max-width: 340px;
  margin-left: 14px; background: rgba(255,255,255,.75); border-radius: 18px; box-shadow: 0 1px 8px rgba(60,58,70,.06); }
.song-card .sc-row { display: flex; align-items: center; gap: 11px; }
.song-card .sc-cover { width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: rgba(90,88,100,.1) center/cover no-repeat; }
.song-card .sc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.song-card .sc-title { font-size: 13.5px; font-weight: 600; color: #5a5862;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .sc-sub { font-size: 11px; color: #a09da8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .sc-play { flex: none; width: 32px; height: 32px; border-radius: 50%; border: none;
  background: #a8847c; color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; }
.song-card .sc-play:active { opacity: .75; }
.song-card .sc-bar { height: 3px; border-radius: 2px; background: rgba(90,88,100,.12); overflow: hidden; cursor: pointer; }
.song-card .sc-bar i { display: block; height: 100%; width: 0%; background: #a8847c; }
.song-card.playing .sc-bar i { transition: width .2s linear; }
.song-card .sc-times { display: flex; justify-content: space-between; font-size: 10.5px; color: #a09da8; }

/* 气泡内Markdown */
.msg p { margin: 0; }
.msg p + p, .msg ul, .msg ol, .msg table, .msg pre, .msg blockquote { margin-top: 8px; }
.msg ul, .msg ol { padding-left: 20px; margin-bottom: 0; }
.msg li { margin: 3px 0; }
.msg code { background: rgba(90,88,100,.09); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.msg pre { background: rgba(90,88,100,.08); padding: 10px 12px; border-radius: 12px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.msg pre code { background: none; padding: 0; }
.msg table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 13px; max-width: 100%; }
.msg th, .msg td { border: 1px solid rgba(90,88,100,.16); padding: 5px 10px; white-space: nowrap; }
.msg th { background: rgba(90,88,100,.06); font-weight: 600; }
.msg blockquote { border-left: 3px solid rgba(168,132,124,.5); margin: 8px 0 0; padding: 2px 0 2px 10px; color: #8a8792; }
.msg a { color: #a8847c; }
.msg h1, .msg h2, .msg h3 { font-size: 15px; margin: 10px 0 4px; }

/* cbSense 私密模式开关 */
#cbSense { border: none; background: rgba(90,88,100,.08); color: #a09da8; font-size: 12px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; flex-shrink: 0; }
#cbSense.on { background: rgba(168,132,124,.25); color: #7a5a52; }

/* incomingOverlay 来电卡片 */
#incomingOverlay { position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; background: rgba(60,58,70,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#incomingOverlay.open { display: flex; }
#incomingOverlay .ic-card { width: min(320px, 84vw); padding: 30px 24px 26px; border-radius: 28px;
  background: rgba(247,246,243,.9); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 18px 60px rgba(60,58,70,.25); display: flex; flex-direction: column; align-items: center; }
#incomingOverlay .ic-label { font-size: 10.5px; letter-spacing: 3px; color: #a09da8; margin-bottom: 22px; }
#incomingOverlay .ic-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  background: #fff; box-shadow: 0 6px 24px rgba(60,58,70,.15); }
#incomingOverlay .ic-name { font-size: 24px; font-weight: 600; color: #4a4852; margin-top: 16px; letter-spacing: 2px; }
#incomingOverlay .ic-sub { font-size: 13px; color: #a09da8; margin-top: 8px; }
#incomingOverlay .ic-btns { display: flex; gap: 68px; margin-top: 30px; }
#incomingOverlay .ic-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#incomingOverlay .ic-wrap span { font-size: 12px; color: #8a8792; }
#incomingOverlay .ic-btn { width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
#incomingOverlay .ic-decline { background: #d95f4c; box-shadow: 0 6px 20px rgba(217,95,76,.4); }
#incomingOverlay .ic-accept { background: #4fa06a; box-shadow: 0 6px 20px rgba(79,160,106,.4);
  animation: icring 1.4s ease-in-out infinite; }
@keyframes icring { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.call-chip.missed { color: #b0574a; }
.call-chip.missed svg { stroke: #b0574a; }

/* ═══════════ Checklist: receipt bottom sheet ═══════════ */
.ck-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(40,30,20,0.34);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.ck-scrim.open { opacity: 1; pointer-events: auto; }

.ck-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
  --ck-h: 62vh;
  height: var(--ck-h); max-height: 92vh;
  background: #F0EBE0;
  background-image:
    radial-gradient(ellipse at top, rgba(255,250,235,0.12) 0%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(60,40,20,0.012) 0, rgba(60,40,20,0.012) 1px, transparent 1px, transparent 8px);
  clip-path: polygon(
    0% 8px, 1.667% 0, 3.333% 8px, 5% 0, 6.667% 8px, 8.333% 0,
    10% 8px, 11.667% 0, 13.333% 8px, 15% 0, 16.667% 8px, 18.333% 0,
    20% 8px, 21.667% 0, 23.333% 8px, 25% 0, 26.667% 8px, 28.333% 0,
    30% 8px, 31.667% 0, 33.333% 8px, 35% 0, 36.667% 8px, 38.333% 0,
    40% 8px, 41.667% 0, 43.333% 8px, 45% 0, 46.667% 8px, 48.333% 0,
    50% 8px, 51.667% 0, 53.333% 8px, 55% 0, 56.667% 8px, 58.333% 0,
    60% 8px, 61.667% 0, 63.333% 8px, 65% 0, 66.667% 8px, 68.333% 0,
    70% 8px, 71.667% 0, 73.333% 8px, 75% 0, 76.667% 8px, 78.333% 0,
    80% 8px, 81.667% 0, 83.333% 8px, 85% 0, 86.667% 8px, 88.333% 0,
    90% 8px, 91.667% 0, 93.333% 8px, 95% 0, 96.667% 8px, 98.333% 0,
    100% 8px, 100% 100%, 0% 100%
  );
  box-shadow: 0 -8px 32px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.10);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1),
              height 0.28s cubic-bezier(0.32,0.72,0,1);
  overflow: hidden; display: flex; flex-direction: column;
}
.ck-sheet.open { transform: translateY(0); }

.ck-handle {
  position: absolute; top: 14px; left: 0; right: 0; z-index: 5;
  width: 44px; height: 5px; border-radius: 3px; margin: 0 auto;
  background: #86806E; opacity: 0.4; cursor: grab; touch-action: none;
}
.ck-handle::after {
  content: ""; position: absolute; left: -60px; right: -60px; top: -16px; bottom: -16px;
}
.ck-handle:active { cursor: grabbing; }

.rc-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 46px 22px calc(env(safe-area-inset-bottom, 0px) + 20px);
  font-family: "SF Mono","JetBrains Mono","Menlo","Source Han Mono SC","Consolas",monospace;
}

/* receipt chrome */
.rc-head { text-align: center; margin-bottom: 10px; }
.rc-brand { font-size: 10px; color: #86806E; letter-spacing: 4px; font-weight: 700; }
.rc-title {
  font-family: "Source Han Serif SC","Songti SC","STSong","PT Serif",Georgia,serif;
  font-style: italic; font-size: 30px; font-weight: 700;
  color: #2A2620; margin-top: 4px; letter-spacing: 1px; line-height: 1.1;
}
.rc-date { font-size: 11px; color: #86806E; margin-top: 6px; letter-spacing: 2px; }
.rc-dashes {
  font-size: 11px; color: rgba(60,50,40,0.32); letter-spacing: 1px; text-align: center;
  user-select: none; padding: 4px 0; white-space: nowrap; overflow: hidden;
}
.rc-row {
  display: flex; justify-content: space-between; font-size: 12px; color: #2A2620;
  letter-spacing: 0.5px; padding: 3px 0;
}
.rc-row.rc-faded { color: #86806E; }
.rc-section-label {
  text-align: center; font-size: 11px; color: #86806E;
  letter-spacing: 3px; font-weight: 700; padding: 4px 0 10px;
}

/* checklist items */
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 6px 0;
  border-bottom: 0.5px dashed rgba(60,50,40,0.16);
  -webkit-tap-highlight-color: transparent;
}
.checklist-check {
  flex: 0 0 auto; border: 0; background: transparent; padding: 0; margin: 0;
  font-family: "SF Mono","JetBrains Mono","Menlo","Consolas",monospace;
  font-size: 14px; color: #2A2620; letter-spacing: 0.5px;
  line-height: 1.45; cursor: pointer; transition: transform .12s ease;
}
.checklist-check:active { transform: scale(0.85); }
.checklist-check::before { content: "[ ]"; }
.checklist-item.done .checklist-check::before { content: "[\2713]"; }

.checklist-trigger {
  flex: 0 0 auto; align-self: flex-start; margin-top: 1px;
  font-family: "SF Mono","JetBrains Mono","Menlo","Consolas",monospace;
  font-size: 11.5px; letter-spacing: 0.4px; color: #A8362D;
  padding: 0 5px; border: 0.5px solid rgba(60,50,40,0.16); border-radius: 3px; line-height: 1.6;
}
.checklist-overdue-bang {
  flex: 0 0 auto; align-self: flex-start;
  font-family: "SF Mono","Menlo","Consolas",monospace;
  font-size: 13.5px; font-weight: 700; color: #A8362D; line-height: 1.45;
}
.checklist-body {
  flex: 1; min-width: 0;
  font-family: "SF Mono","JetBrains Mono","Menlo","Consolas",monospace;
  font-size: 13.5px; line-height: 1.45; letter-spacing: 0.2px; color: #2A2620;
  white-space: pre-wrap; word-break: break-word; outline: none;
}
.checklist-item.done .checklist-body {
  color: #BAB4A4; text-decoration: line-through; text-decoration-color: #86806E;
}
.checklist-by {
  flex: 0 0 auto; font-style: italic; font-size: 11px; color: #86806E;
  letter-spacing: 0.5px; line-height: 1.6;
}
.checklist-del-x {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  font-family: "SF Mono","Menlo","Consolas",monospace;
  font-size: 14px; color: #BAB4A4; line-height: 1.45; padding: 0 2px;
}
.checklist-del-x::before { content: "\00d7"; }
.checklist-del-x:hover, .checklist-del-x:active { color: #A8362D; }

.checklist-item-new { border-bottom: 0.5px dashed rgba(60,50,40,0.16); }
.checklist-item-new .checklist-body { color: #86806E; font-size: 13px; }
.checklist-item-new .checklist-body:empty::before { content: "+ 新增一项"; color: #86806E; }
.checklist-item-new .checklist-del-x,
.checklist-item-new .checklist-check { visibility: hidden; }

/* stats */
.rc-progress-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  font-size: 12px; color: #2A2620; letter-spacing: 0.5px;
}
.rc-progress-bar { flex: 1; letter-spacing: -0.5px; overflow: hidden; white-space: nowrap; }
.rc-progress-pct { font-size: 11px; color: #86806E; }

.rc-stamp-wrap { text-align: center; padding: 14px 0 4px; }
.rc-stamp {
  display: inline-block; padding: 6px 14px;
  border: 2.5px solid #A8362D; border-radius: 4px;
  color: #A8362D;
  font-family: "Source Han Serif SC","Songti SC","STSong","PT Serif",Georgia,serif;
  font-style: italic; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; transform: rotate(-4deg); opacity: 0.82;
}
.rc-foot {
  text-align: center; padding: 8px 8px 0;
  font-family: "Source Han Serif SC","Songti SC","STSong","PT Serif",Georgia,serif;
  font-style: italic; font-size: 13px; color: #86806E; line-height: 1.7;
}
.rc-barcode {
  display: flex; align-items: flex-end; gap: 1px; justify-content: center;
  height: 38px; padding: 16px 0 2px;
}
.rc-barcode i { display: block; background: #2A2620; opacity: 0.85; }
.rc-barcode-serial {
  text-align: center; font-size: 10px; color: #86806E;
  letter-spacing: 3px; padding: 2px 0 12px;
}

/* receipt add row */
.rc-add-row {
  display: flex; gap: 8px; padding: 8px 0 6px;
  border-bottom: 0.5px dashed rgba(60,50,40,0.16);
  align-items: center;
}
.rc-add-row input {
  flex: 1; border: none; border-bottom: 1px solid rgba(60,50,40,0.2);
  background: transparent; padding: 6px 2px;
  font-family: "SF Mono","JetBrains Mono","Menlo","Consolas",monospace;
  font-size: 13px; color: #2A2620; outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}
.rc-add-row input::placeholder { color: #BAB4A4; font-size: 12px; }
.rc-add-row input:focus { border-bottom-color: #A8362D; }
.rc-add-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: "SF Mono","Menlo","Consolas",monospace;
  font-size: 18px; color: #86806E; padding: 0 4px;
  line-height: 1; flex-shrink: 0;
}
.rc-add-btn:active { color: #A8362D; }
