/* ES WebK — 聊天气泡 v1 (esgram-bubbles-v1), LIVE.
   type2-pair-1 「内嵌色卡 · 左青右紫」(2026-11-18): translation = inner tinted card w/ 1px border;
   source design /workspace/esgram-bubbles-type2-pairs/pair-1.html. Promoted from es-webk-bubbles-test.css.
   Injected on :8790 / account subdomains via snippets/es-tweb-site.conf.
   Light theme only. Loaded after es-webk-skin.css so it wins on equal specificity. */

html:not(.night) {
  --esb-bg: #EEF1FA;
  --esb-bg-img:
    radial-gradient(420px 300px at 15% 20%, rgba(170, 230, 210, .55), transparent 70%),
    radial-gradient(460px 340px at 80% 35%, rgba(200, 190, 250, .55), transparent 70%),
    radial-gradient(480px 320px at 45% 95%, rgba(255, 196, 220, .5), transparent 70%);
  --esb-tint-a: rgba(61, 139, 255, .07);
  --esb-tint-b: rgba(255, 146, 189, .08);
  --esb-text: #111418;
  --esb-text-2: #3F4959;
  --esb-in-bg: #FFFFFF;
  --esb-in-meta: #535D6D;
  --esb-in-quote-bg: #EEF4FF;
  --esb-in-quote-bar: #3D8BFF;
  --esb-in-quote-name: #1D4FA8;
  --esb-out-bg: #D8E6FF;
  --esb-out-meta: #334C73;
  --esb-out-tick: #174AA8;
  --esb-out-quote-bg: rgba(255, 255, 255, .62);
  --esb-out-quote-bar: #D9608F;
  --esb-out-quote-name: #9E3A63;
  --esb-shadow: 0 1px 2px rgba(30, 45, 80, .10), 0 3px 10px rgba(30, 45, 80, .06);
  --esb-bubble-shadow: 0 1px 1.5px rgba(30, 45, 80, .13), 0 3px 7px rgba(30, 45, 80, .07);
  --esb-chip-bg: rgba(255, 255, 255, .92);
  --esb-react-bg: #F1F4FA;
  --esb-react-border: #DCE2EC;
  --esb-react-text: #3A4456;
  --esb-r-big: 18px;
  --esb-r-small: 6px;

  /* tweb theme vars (tail + gradients read these) */
  --message-background-color: var(--esb-in-bg) !important;
  --message-out-background-color: var(--esb-out-bg) !important;
  --message-out-background-color-rgb: 216, 230, 255 !important;
  --light-message-out-background-color: rgba(216, 230, 255, .7) !important;
  --light-filled-message-out-background-color: #D8E6FF !important;
  --dark-message-out-background-color: #C2D6F7 !important;
  --message-out-gradient-under: var(--esb-out-bg) !important;
  --message-out-gradient-content-background: var(--esb-out-bg) !important;
  --message-out-gradient-solid-color: var(--esb-out-bg) !important;
  --message-out-time-color: var(--esb-out-meta) !important;
  --message-out-status-color: var(--esb-out-tick) !important;
  --message-out-primary-color: var(--esb-out-quote-name) !important;
}

/* ===== 聊天背景 ===== */
@media (min-width: 926px) {
  html:not(.night) #column-center .chat.active::before {
    background-color: var(--esb-bg) !important;
    background-image: var(--esb-bg-img) !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
  }
}
@media (max-width: 925px) {
  html:not(.night) #column-center {
    background-color: var(--esb-bg) !important;
    background-image: var(--esb-bg-img) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
  }
}

/* ===== 气泡：颜色 / 阴影 / 圆角分组 ===== */
html:not(.night) .bubble.is-in .bubble-content,
html:not(.night) .bubble.is-in .bubble-content-background {
  background-color: var(--esb-in-bg) !important;
  background-image: none !important;
}
html:not(.night) .bubble.is-out .bubble-content,
html:not(.night) .bubble.is-out .bubble-content-background {
  background-color: var(--esb-out-bg) !important;
  background-image: none !important;
}
html:not(.night) .bubble:not(.service):not(.just-media):not(.sticker):not(.emoji-big):not(.round) .bubble-content {
  box-shadow: var(--esb-bubble-shadow) !important;
}
html:not(.night) .bubble.is-in.can-have-tail .bubble-tail { background-color: var(--esb-in-bg) !important; }
html:not(.night) .bubble.is-out.can-have-tail .bubble-tail { background: var(--esb-out-bg) !important; }
/* Tail gets the same soft shadow as its bubble. */
html:not(.night) .bubble.can-have-tail .bubble-tail {
  filter: drop-shadow(0 1px 1px rgba(30, 45, 80, .10));
}

/* Incoming: inner (left) corners small inside a run, big on first; only the last has the tail. */
html:not(.night) .bubble.is-in {
  --border-start-start-radius: var(--esb-r-small);
  --border-start-end-radius: var(--esb-r-big);
  --border-end-end-radius: var(--esb-r-big);
  --border-end-start-radius: var(--esb-r-small);
}
html:not(.night) .bubble.is-in.is-group-first,
html:not(.night) .bubble.is-in.is-forced-rounded { --border-start-start-radius: var(--esb-r-big); }
html:not(.night) .bubble.is-in.is-group-last:not(.can-have-tail) { --border-end-start-radius: var(--esb-r-big); }

html:not(.night) .bubble.is-out {
  --border-start-start-radius: var(--esb-r-big);
  --border-start-end-radius: var(--esb-r-small);
  --border-end-end-radius: var(--esb-r-small);
  --border-end-start-radius: var(--esb-r-big);
}
html:not(.night) .bubble.is-out.is-group-first,
html:not(.night) .bubble.is-out.is-forced-rounded { --border-start-end-radius: var(--esb-r-big); }
html:not(.night) .bubble.is-out.is-group-last:not(.can-have-tail) { --border-end-end-radius: var(--esb-r-big); }

/* ===== 正文 ===== */
html:not(.night) .bubbles {
  --messages-text-size: 16.5px;
  --messages-time-text-size: 13px;
}
html:not(.night) .bubble .message {
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--esb-text);
}
html:not(.night) .bubble .message a:not(.mention):not(.anchor-url) { color: inherit; }

/* ===== 时间 + 已读勾 ===== */
html:not(.night) .bubble .time,
html:not(.night) .bubble .time-inner {
  font-variant-numeric: tabular-nums;
}
html:not(.night) .bubble.is-in .time,
html:not(.night) .bubble.is-in .time-inner,
html:not(.night) .bubble.is-in .message-time { color: var(--esb-in-meta) !important; }
html:not(.night) .bubble.is-out .time,
html:not(.night) .bubble.is-out .time-inner,
html:not(.night) .bubble.is-out .message-time { color: var(--esb-out-meta) !important; }
html:not(.night) .bubble.is-out .time-sending-status,
html:not(.night) .bubble.is-out .sending-status,
html:not(.night) .bubble.is-out .sending-status-icon { color: var(--esb-out-tick) !important; }
/* Media-only bubbles keep tweb's dark overlay time chip (white text). */
html:not(.night) .bubble.just-media .time .time-inner,
html:not(.night) .bubble.just-media .time-inner,
html:not(.night) .bubble.just-media .time-sending-status { color: #FFFFFF !important; }

/* ===== 引用块：左色条 + 浅底；对方气泡里=引用自己(蓝)，自己气泡里=引用对方(玫瑰) ===== */
html:not(.night) .bubble .reply.quote-like {
  border-radius: 10px !important;
}
html:not(.night) .bubble.is-in .reply.quote-like {
  --peer-color-rgb: 61, 139, 255 !important;
  --peer-border-background: var(--esb-in-quote-bar) !important;
  background-color: var(--esb-in-quote-bg) !important;
}
html:not(.night) .bubble.is-out .reply.quote-like {
  --peer-color-rgb: 217, 96, 143 !important;
  --peer-border-background: var(--esb-out-quote-bar) !important;
  background-color: var(--esb-out-quote-bg) !important;
}
html:not(.night) .bubble.is-in .reply.quote-like-border:before { background: var(--esb-in-quote-bar) !important; border-radius: 3px; }
html:not(.night) .bubble.is-out .reply.quote-like-border:before { background: var(--esb-out-quote-bar) !important; border-radius: 3px; }
html:not(.night) .bubble .reply .quote-like-pattern { display: none !important; }
html:not(.night) .bubble.is-in .reply-title,
html:not(.night) .bubble.is-in .reply-title .peer-title { color: var(--esb-in-quote-name) !important; font-weight: 600; }
html:not(.night) .bubble.is-out .reply-title,
html:not(.night) .bubble.is-out .reply-title .peer-title { color: var(--esb-out-quote-name) !important; font-weight: 600; }
html:not(.night) .bubble .reply-title { font-size: 14px; }
html:not(.night) .bubble .reply-subtitle {
  font-size: 14px;
  color: var(--esb-text-2) !important;
}
html:not(.night) .bubble .reply-media { border-radius: 7px; overflow: hidden; }

/* ===== 表情回应 ===== */
html:not(.night) .bubble .reactions .reaction-block,
html:not(.night) .bubble .reaction-block {
  --background-color: var(--esb-react-bg) !important;
  --counter-color: var(--esb-react-text) !important;
  --chosen-background-color: #DCE9FF;
  box-shadow: inset 0 0 0 1px var(--esb-react-border);
  color: var(--esb-react-text);
}
html:not(.night) .bubble .reaction-block.is-chosen {
  --background-color: #DCE9FF !important;
  --counter-color: #2361C4 !important;
  box-shadow: inset 0 0 0 1px #B9CFF5;
}
html:not(.night) .bubble .reaction-block .reaction-counter { color: var(--counter-color) !important; }

/* ===== 日期条（今天） ===== */
html:not(.night) .bubble.is-date .service-msg,
html:not(.night) .bubble.service.is-date .service-msg {
  background-color: var(--esb-chip-bg) !important;
  color: var(--esb-text-2) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  padding: 5px 14px !important;
  border-radius: 999px !important;
  box-shadow: var(--esb-shadow) !important;
  backdrop-filter: none !important;
}
html:not(.night) .bubble.is-date .service-msg a,
html:not(.night) .bubble.is-date .service-msg .peer-title,
html:not(.night) .bubble.is-date .service-msg .i18n { color: var(--esb-text-2) !important; }

/* ===== 译文区 type2-pair-1 「内嵌色卡 · 左青右紫」 =====
   DOM emitted by es-webk-translate(-test).js (unchanged):
     <div class="es-webk-tr [es-webk-orig]"><span class="es-webk-tr-label">译|原</span>text</div>
   inserted inside .message right before .time.
   Hooks kept for later JS: .es-webk-tr-label[data-pair], .es-webk-tr.is-pending + .es-webk-tr-skel. */
html:not(.night) {
  --esb-tr-in-card: #E7F1F3;
  --esb-tr-in-edge: #C9E0E4;
  --esb-tr-in-text: #0B7285;
  --esb-tr-out-card: #EFEAFA;
  --esb-tr-out-edge: #D8CDF4;
  --esb-tr-out-text: #6A3FD6;
  --esb-tr-weight: 500;
  --esb-tr-pad-y1: 8px;
  --esb-tr-pad-y2: 7px;
  --esb-tr-pad-x: 10px;
  --esb-skel-in: #C9E0E4;
  --esb-skel-out: #D8CDF4;
  --esb-tr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 5.5h9M8 3.5v2M5.5 5.5c.6 3 2.6 5.3 5.5 6.5M10.5 5.5c-.8 3.3-3 5.8-6.5 7'/%3E%3Cpath d='M12.5 20.5l4-10 4 10M14 17h5'/%3E%3C/svg%3E");
}
html:not(.night) .bubble .es-webk-tr {
  display: block;
  position: relative;
  margin-top: 8px;
  padding: var(--esb-tr-pad-y1) var(--esb-tr-pad-x) var(--esb-tr-pad-y2);
  border: 1px solid var(--esb-tr-in-edge);
  border-radius: 12px;
  background: var(--esb-tr-in-card);
  font-size: 15.5px;
  font-weight: var(--esb-tr-weight);
  line-height: 1.55;
  color: var(--esb-tr-in-text);
  opacity: 1;
  white-space: pre-wrap;
  word-break: break-word;
}
html:not(.night) .bubble.is-out .es-webk-tr {
  border-color: var(--esb-tr-out-edge);
  background: var(--esb-tr-out-card);
  color: var(--esb-tr-out-text);
}
html:not(.night) .bubble .es-webk-tr.es-webk-orig { opacity: 1; }
/* 「译」/「原」 pill: white, text + icon follow the translation colour */
html:not(.night) .bubble .es-webk-tr-label {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  height: 22px;
  margin: 0 0 3px;
  padding: 0 9px 0 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: baseline;
  opacity: 1;
  background: #FFFFFF;
  color: var(--esb-tr-in-text);
}
html:not(.night) .bubble.is-out .es-webk-tr-label { background: #FFFFFF; color: var(--esb-tr-out-text); }
html:not(.night) .bubble .es-webk-tr-label::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--esb-tr-icon) center / contain no-repeat;
  mask: var(--esb-tr-icon) center / contain no-repeat;
}
/* skeleton while translating (pill text 「正在翻译…」) */
html:not(.night) .bubble .es-webk-tr-skel {
  display: block;
  height: 10px;
  border-radius: 5px;
  margin: 8px 0;
  background: var(--esb-skel-in);
  max-width: 100%;
}
html:not(.night) .bubble.is-out .es-webk-tr-skel { background: var(--esb-skel-out); }
html:not(.night) .bubble .es-webk-tr-skel + .es-webk-tr-skel { margin-bottom: 2px; }
html:not(.night) .bubble .es-webk-tr.is-pending { min-width: 150px; }

/* Time + ticks live in the bottom-right corner of the translation CARD (design), never over text.
   tweb's .time is a floated placeholder whose .time-inner is absolutely positioned at the bottom-right of
   .message. When the translation card is the last thing in .message its bottom edge == .message bottom,
   so we collapse the placeholder and pull .time-inner in by the card padding + 1px border.
   An inline spacer at the end of the translation text reserves the room (time wraps to its own line if needed). */
html:not(.night) .bubble .message:has(> .es-webk-tr)::after { content: none; display: none; }
html:not(.night) .bubble .message > .es-webk-tr + .time {
  float: none;
  display: block;
  height: 0;
  margin: 0;
}
html:not(.night) .bubble .message > .es-webk-tr + .time .time-inner {
  inset-inline-end: calc(var(--esb-tr-pad-x) + 1px);
  bottom: calc(var(--esb-tr-pad-y2) + 1px);
  margin: 0 !important;
}
html:not(.night) .bubble .es-webk-tr::after {
  content: "";
  display: inline-block;
  width: 46px;
  height: 1px;
}
html:not(.night) .bubble.is-out .es-webk-tr::after { width: 66px; }
html:not(.night) .bubble .es-webk-tr.is-pending::after { display: none; }
html:not(.night) .bubble .es-webk-tr.is-pending .es-webk-tr-skel:last-child { margin-right: 52px; }
/* when reactions follow the translation, the time rides on the reactions row instead */
html:not(.night) .bubble .es-webk-tr:not(:has(+ .time))::after { display: none; }

/* ===== 消息间距 (v20261118-trfix) =====
   tweb default is 2px between bubbles and 6px after a run, which with the tall translation cards made messages
   look glued together. Service/date chips keep tweb spacing. */
html:not(.night) .bubble:not(.service) { margin-bottom: 5px; }
html:not(.night) .bubble:not(.service).is-group-last { margin-bottom: 10px; }

/* cache-bust marker: bubbles-test-type2-pair1 */
