/* ============================================================
   Tomato AI 助手 · 悬浮挂件样式
   适配 TomdowCMS 前台（原生 PHP / 无框架依赖）
   版本 v1.1   规格见「TomdowCMS-番茄AI助手-UI规格.md」

   双皮肤：默认 data-theme="tomato"（红番茄），
           data-theme="mint"（绿薄荷）。换肤只切一个属性，
           尺寸/间距/动效完全共用，不做两套布局。
   ============================================================ */

/* ============================================================
   几何 / 层级 / 动效：单独一条低特异性规则
   这样你在页面里写 `.tmt-root{ --tmt-gap-y:76px }` 就能直接覆盖，
   不需要去配对 [data-theme="tomato"] 这种更高特异性的选择器。
   ============================================================ */
.tmt-root {
  --tmt-size-launcher: 60px;
  --tmt-size-launcher-m: 56px;
  --tmt-gap-x: 24px;
  --tmt-gap-y: 24px;      /* 站点右下角已有按钮（如「返回顶部」）时，抬高这个值让位 */
  --tmt-gap-x-m: 16px;
  --tmt-gap-y-m: 16px;
  --tmt-panel-w: 384px;
  --tmt-panel-h: 620px;
  --tmt-header-h: 64px;
  --tmt-radius-panel: 20px;
  --tmt-radius-bubble: 16px;
  --tmt-z: 1900;          /* 低于站点弹窗（.link-modal 是 2000） */
  --tmt-ease: cubic-bezier(.2, .8, .3, 1);
  --tmt-dur: 180ms;
}

/* ============================================================
   配色（红番茄，默认）：形状/位置见上一条，这里只管颜色
   ============================================================ */
.tmt-root,
.tmt-root[data-theme="tomato"] {
  /* —— 交互色：承载文字的面必须过 4.5:1 —— */
  --tmt-primary: #DC3B2E;        /* 主色，白字在其上 4.57:1，过 AA */
  --tmt-primary-600: #C53125;    /* hover */
  --tmt-primary-700: #A82A1F;    /* 链接、胶囊文字，5.9:1 */
  --tmt-mint: #F98B80;           /* 浅强调（胶囊 hover 描边） */
  --tmt-mint-soft: #FBE4E0;
  --tmt-mint-bg: #FDF5F4;        /* 消息区底色 */
  --tmt-ink: #2A1512;
  --tmt-text: #4A2C27;
  --tmt-muted: #96756F;
  --tmt-line: #F6E4E1;
  --tmt-white: #FFFFFF;
  --tmt-danger: #1B2A26;         /* 红球上的未读点用深色，红点会隐形 */

  /* —— 头像调色板（内联 SVG 直接吃这些变量） —— */
  --tmt-av-bg-1: #F25448;        /* 圆底渐变上 */
  --tmt-av-bg-2: #E43B2E;        /* 圆底渐变下 */
  --tmt-av-shell-1: #FFD3CD;
  --tmt-av-shell-2: #FFB0A7;
  --tmt-av-shell-3: #F98B80;
  --tmt-av-frame: #F5766A;
  --tmt-av-face-2: #FFF1EF;
  --tmt-av-ear: #FFA79E;
  --tmt-av-ear-2: #FFC8C1;
  --tmt-av-eye: #DD3A2E;
  --tmt-av-hl-1: #FFF0EE;
  --tmt-av-hl-2: #FFD8D2;
  --tmt-av-ball-2: #FFC6C0;

  /* —— 状态辅助色 —— */
  --tmt-surface: #FFFFFF;        /* 面板、页脚、输入容器 */
  --tmt-surface-2: #FFFFFF;      /* 气泡、欢迎卡、胶囊 */
  --tmt-badge-ring: #FFFFFF;
  --tmt-chip-border: #F3D9D4;
  --tmt-chip-hover-bg: #FFF6F4;
  --tmt-disabled: #F0CFCB;
  --tmt-ring: 0 0 0 3px rgba(220, 59, 46, .12);
  --tmt-ring-strong: 3px solid rgba(220, 59, 46, .45);
  --tmt-dot-ring: 0 0 0 3px rgba(220, 59, 46, .16);
  --tmt-shadow-bubble: 0 2px 8px rgba(200, 50, 36, .22);
  --tmt-header-1: #FFF9F8;
  --tmt-header-2: #FFFFFF;

  position: fixed;
  z-index: var(--tmt-z);
  inset: auto var(--tmt-gap-x) var(--tmt-gap-y) auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tmt-text);
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

.tmt-root *,
.tmt-root *::before,
.tmt-root *::after { box-sizing: border-box; }

/* ---------- 第二套皮肤：绿薄荷（对齐站点主色 #00CF8D） ---------- */
.tmt-root[data-theme="mint"] {
  --tmt-primary: #00CF8D;
  --tmt-primary-600: #00B37A;
  --tmt-primary-700: #009A69;
  --tmt-mint: #8DEBCA;
  --tmt-mint-soft: #DFF7EE;
  --tmt-mint-bg: #F1FBF7;
  --tmt-ink: #10322A;
  --tmt-text: #2C4A42;
  --tmt-muted: #7C968E;
  --tmt-line: #E3F2EC;
  --tmt-danger: #F2536B;

  --tmt-av-bg-1: #12D69A;
  --tmt-av-bg-2: #00C685;
  --tmt-av-shell-1: #CAF9E8;
  --tmt-av-shell-2: #9AF0D3;
  --tmt-av-shell-3: #74E6C2;
  --tmt-av-frame: #6BE6BD;
  --tmt-av-face-2: #F4FEFA;
  --tmt-av-ear: #8DEBCA;
  --tmt-av-ear-2: #B7F4DE;
  --tmt-av-eye: #05B87C;
  --tmt-av-hl-1: #E1FCF2;
  --tmt-av-hl-2: #B9F5E1;
  --tmt-av-ball-2: #B0F1DB;

  --tmt-surface: #FFFFFF;
  --tmt-surface-2: #FFFFFF;
  --tmt-badge-ring: #FFFFFF;
  --tmt-chip-border: #C9EBDF;
  --tmt-chip-hover-bg: #F2FDF9;
  --tmt-disabled: #D6ECE4;
  --tmt-ring: 0 0 0 3px rgba(0, 207, 141, .12);
  --tmt-ring-strong: 3px solid rgba(0, 207, 141, .45);
  --tmt-dot-ring: 0 0 0 3px rgba(0, 207, 141, .16);
  --tmt-shadow-bubble: 0 2px 8px rgba(0, 178, 122, .22);
  --tmt-header-1: #F7FEFB;
  --tmt-header-2: #FFFFFF;

  --tmt-shadow-launcher: 0 8px 24px rgba(0, 122, 86, .28), 0 2px 6px rgba(0, 122, 86, .16);
  --tmt-shadow-panel: 0 24px 64px rgba(10, 60, 44, .18), 0 4px 12px rgba(10, 60, 44, .08);
}

/* 防御性重置：宿主主题的全局选择器（如 footer{} / p{} / img{}）不许漏进挂件。
   用 :where() 把特异性压到 0,1,0，组件自身样式一律在其后声明，仍然优先。 */
.tmt-root :where(div, span, p, button, textarea, img, svg, i, b) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  float: none;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  text-indent: 0;
  min-width: 0;
  max-width: none;
  position: static;
  transform: none;
  animation: none;
}
.tmt-root :where(img, svg) { display: block; max-width: 100%; }

/* 用 :where() 保持与组件样式同特异性，组件规则在后即可覆盖 */
.tmt-root :where(button) {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 悬浮球 ---------- */
.tmt-launcher {
  position: relative;
  width: var(--tmt-size-launcher);
  height: var(--tmt-size-launcher);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tmt-av-bg-1) 0%, var(--tmt-av-bg-2) 100%);
  box-shadow: var(--tmt-shadow-launcher);
  display: grid;
  place-items: center;
  transition: transform 200ms var(--tmt-ease), box-shadow 200ms var(--tmt-ease), opacity 200ms var(--tmt-ease);
  animation: tmt-pop 420ms var(--tmt-ease);
  -webkit-tap-highlight-color: transparent;
}
.tmt-launcher:hover { transform: scale(1.06); }
.tmt-launcher:active { transform: scale(.97); }
.tmt-launcher:focus-visible {
  outline: var(--tmt-ring-strong);
  outline-offset: 3px;
}

.tmt-launcher__avatar {
  width: 76%;
  height: 76%;
  display: block;
  pointer-events: none;
}
.tmt-launcher__avatar svg { width: 100%; height: 100%; display: block; }

/* 呼吸光环：6s 一次，不打扰 */
.tmt-launcher__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--tmt-primary);
  opacity: 0;
  pointer-events: none;
  animation: tmt-pulse 6s ease-out infinite;
}

/* 未读红点 */
.tmt-launcher__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--tmt-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--tmt-badge-ring);
  display: none;
}
.tmt-launcher__badge.is-on { display: block; }

/* 首次进入的气泡提示 */
.tmt-teaser {
  position: absolute;
  right: calc(var(--tmt-size-launcher) + 12px);
  bottom: 14px;
  max-width: 220px;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  background: var(--tmt-surface);
  border: 1px solid var(--tmt-line);
  box-shadow: 0 8px 24px rgba(10, 60, 44, .1);
  font-size: 13px;
  color: var(--tmt-text);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 240ms var(--tmt-ease), transform 240ms var(--tmt-ease);
  pointer-events: none;
}
.tmt-teaser.is-on { opacity: 1; transform: none; }

/* ---------- 面板 ---------- */
.tmt-panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--tmt-size-launcher) + 12px);
  width: var(--tmt-panel-w);
  height: min(var(--tmt-panel-h), calc(100dvh - var(--tmt-size-launcher) - 48px));
  display: flex;
  flex-direction: column;
  background: var(--tmt-surface);
  border-radius: var(--tmt-radius-panel);
  box-shadow: var(--tmt-shadow-panel);
  border: 1px solid rgba(0, 160, 110, .08);
  overflow: hidden;
  transform-origin: 100% 100%;
  opacity: 0;
  transform: translateY(10px) scale(.96);
  pointer-events: none;
  transition: opacity var(--tmt-dur) var(--tmt-ease), transform var(--tmt-dur) var(--tmt-ease);
}
.tmt-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* 头部 */
.tmt-header {
  flex: 0 0 auto;
  height: var(--tmt-header-h);
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--tmt-line);
  background: linear-gradient(180deg, var(--tmt-header-1) 0%, var(--tmt-header-2) 100%);
}
.tmt-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--tmt-av-bg-1) 0%, var(--tmt-av-bg-2) 100%);
  overflow: hidden;
}
.tmt-header__avatar svg { width: 88%; height: 88%; display: block; }
.tmt-header__meta { min-width: 0; flex: 1; }
.tmt-header__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tmt-ink);
  line-height: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tmt-header__title svg { width: 14px; height: 14px; color: var(--tmt-primary); flex: 0 0 auto; }
.tmt-header__status {
  font-size: 11px;
  line-height: 15px;
  color: var(--tmt-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.tmt-header__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tmt-primary);
  box-shadow: var(--tmt-dot-ring);
}
.tmt-header__actions { display: flex; gap: 2px; flex: 0 0 auto; }

.tmt-iconbtn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--tmt-muted);
  transition: background 150ms var(--tmt-ease), color 150ms var(--tmt-ease);
}
.tmt-iconbtn svg { width: 18px; height: 18px; }
.tmt-iconbtn:hover { background: var(--tmt-mint-bg); color: var(--tmt-ink); }
.tmt-iconbtn:focus-visible { outline: var(--tmt-ring-strong); outline-offset: 1px; }

/* 消息区 */
.tmt-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tmt-mint-bg);
  scrollbar-width: thin;
  scrollbar-color: #CDE8DF transparent;
}
.tmt-body::-webkit-scrollbar { width: 6px; }
.tmt-body::-webkit-scrollbar-thumb { background: #CDE8DF; border-radius: 3px; }

.tmt-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: tmt-rise 220ms var(--tmt-ease) both;
}
.tmt-msg--user { flex-direction: row-reverse; }

.tmt-msg__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--tmt-av-bg-1) 0%, var(--tmt-av-bg-2) 100%);
  overflow: hidden;
}
.tmt-msg__avatar svg { width: 86%; height: 86%; display: block; }
.tmt-msg--user .tmt-msg__avatar { display: none; }

.tmt-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: var(--tmt-radius-bubble);
  font-size: 14px;
  line-height: 22px;
  word-break: break-word;
  white-space: pre-wrap;
}
.tmt-msg--ai .tmt-bubble {
  background: var(--tmt-surface-2);
  color: var(--tmt-text);
  border: 1px solid var(--tmt-line);
  border-bottom-left-radius: 6px;
}
.tmt-msg--user .tmt-bubble {
  background: var(--tmt-primary);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: var(--tmt-shadow-bubble);
}
.tmt-bubble a { color: var(--tmt-primary-700); text-decoration: underline; text-underline-offset: 2px; }

/* 欢迎卡 */
.tmt-hello {
  background: var(--tmt-surface-2);
  border: 1px solid var(--tmt-line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(10, 60, 44, .04);
}
.tmt-hello__t {
  font-size: 14px;
  font-weight: 600;
  color: var(--tmt-ink);
  margin-bottom: 4px;
}
.tmt-hello__d { font-size: 13px; line-height: 20px; color: var(--tmt-muted); }

/* 快捷问题 */
.tmt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: var(--tmt-mint-bg);
}
.tmt-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--tmt-surface-2);
  border: 1px solid var(--tmt-chip-border);
  color: var(--tmt-primary-700);
  font-size: 13px;
  line-height: 30px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 150ms var(--tmt-ease), border-color 150ms var(--tmt-ease), transform 150ms var(--tmt-ease);
}
.tmt-chip:hover { background: var(--tmt-chip-hover-bg); border-color: var(--tmt-mint); }
.tmt-chip:active { transform: scale(.97); }
.tmt-chip:focus-visible { outline: var(--tmt-ring-strong); outline-offset: 1px; }

/* 输入中 */
.tmt-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 22px;
}
.tmt-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tmt-mint);
  animation: tmt-bounce 1s infinite ease-in-out;
}
.tmt-typing i:nth-child(2) { animation-delay: .15s; }
.tmt-typing i:nth-child(3) { animation-delay: .3s; }

/* 底部输入 */
.tmt-footer {
  flex: 0 0 auto;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--tmt-line);
  background: var(--tmt-surface);
}
.tmt-inputwrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1.5px solid var(--tmt-line);
  border-radius: 22px;
  background: var(--tmt-surface);
  transition: border-color 150ms var(--tmt-ease), box-shadow 150ms var(--tmt-ease);
}
.tmt-inputwrap:focus-within {
  border-color: var(--tmt-primary);
  box-shadow: var(--tmt-ring);
}
.tmt-input {
  flex: 1;
  min-height: 32px;
  max-height: 112px;
  padding: 5px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 22px;
  color: var(--tmt-ink);
  scrollbar-width: thin;
}
.tmt-input::placeholder { color: var(--tmt-muted); opacity: .8; }

.tmt-send {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tmt-primary);
  color: #fff;
  transition: background 150ms var(--tmt-ease), transform 150ms var(--tmt-ease), opacity 150ms var(--tmt-ease);
}
.tmt-send svg { width: 18px; height: 18px; }
.tmt-send:hover { background: var(--tmt-primary-600); }
.tmt-send:active { transform: scale(.94); }
.tmt-send:disabled { background: var(--tmt-disabled); color: #fff; cursor: not-allowed; }
.tmt-send:focus-visible { outline: var(--tmt-ring-strong); outline-offset: 2px; }

.tmt-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 16px;
  color: var(--tmt-muted); opacity: .82;
  text-align: center;
}
.tmt-note strong { color: var(--tmt-muted); font-weight: 500; }

/* ---------- 眼睛动作 ---------- */
.tmt-eyes {
  transform-box: view-box;
  transform-origin: 64px 67px;
  animation: tmt-blink 5.6s infinite;
}
.is-thinking .tmt-eyes { animation: none; transform: scaleY(.55) translateY(1px); }
.is-happy .tmt-eyes { animation: none; transform: scaleY(.42) translateY(2px); }

/* ---------- 动画 ---------- */
@keyframes tmt-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes tmt-pulse {
  0% { transform: scale(1); opacity: .55; }
  55% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes tmt-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tmt-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes tmt-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}

/* ============================================================
   深色模式：跟随站点现有约定 html[data-theme="dark"]
   （TomdowCMS 由 nav.php 的切换按钮下发该属性，写 localStorage）
   挂件只用 CSS 变量响应，不需要额外 JS 同步。
   ============================================================ */
html[data-theme="dark"] .tmt-root {
  --tmt-primary: #E8483A;
  --tmt-primary-600: #F35C4E;
  --tmt-primary-700: #FF8A7F;
  --tmt-mint: #B24A40;
  --tmt-mint-soft: #3A2B2E;
  --tmt-mint-bg: #15151F;
  --tmt-ink: #EDEAF9;
  --tmt-text: #D7D4E6;
  --tmt-muted: #9893AC;
  --tmt-line: #302C42;
  --tmt-danger: #F2536B;

  --tmt-surface: #1A1926;
  --tmt-surface-2: #222131;
  --tmt-badge-ring: #1A1926;
  --tmt-chip-border: #3A3747;
  --tmt-chip-hover-bg: #2A2740;
  --tmt-disabled: #3A3747;

  --tmt-ring: 0 0 0 3px rgba(232, 72, 58, .22);
  --tmt-ring-strong: 3px solid rgba(232, 72, 58, .55);
  --tmt-dot-ring: 0 0 0 3px rgba(232, 72, 58, .20);
  --tmt-shadow-bubble: 0 2px 8px rgba(0, 0, 0, .40);
  --tmt-header-1: #1E1B2C;
  --tmt-header-2: #1A1926;
  --tmt-shadow-launcher: 0 8px 24px rgba(0, 0, 0, .50), 0 2px 6px rgba(0, 0, 0, .40);
  --tmt-shadow-panel: 0 24px 64px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
}

/* 深色 + 绿薄荷皮肤（特异性高过上面一条，顺序无关也安全） */
html[data-theme="dark"] .tmt-root[data-theme="mint"] {
  --tmt-primary: #12D69A;
  --tmt-primary-600: #00C685;
  --tmt-primary-700: #4AE8B4;
  --tmt-mint: #2A5F51;
  --tmt-mint-soft: #24343A;
  --tmt-mint-bg: #141A1E;
  --tmt-danger: #F2536B;

  --tmt-ring: 0 0 0 3px rgba(18, 214, 154, .22);
  --tmt-ring-strong: 3px solid rgba(18, 214, 154, .55);
  --tmt-dot-ring: 0 0 0 3px rgba(18, 214, 154, .20);
  --tmt-header-1: #182420;
  --tmt-header-2: #1A1926;
  --tmt-shadow-launcher: 0 8px 24px rgba(0, 0, 0, .50), 0 2px 6px rgba(0, 0, 0, .40);
  --tmt-shadow-panel: 0 24px 64px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35);
}

/* 深色下头像外壳略降亮度，避免在暗背景上"发亮到刺眼" */
html[data-theme="dark"] .tmt-root { --tmt-av-face-2: #F0EDF1; }

/* ---------- 移动端：全屏 ---------- */
@media (max-width: 639px) {
  .tmt-root {
    --tmt-size-launcher: var(--tmt-size-launcher-m);
    --tmt-gap-x: var(--tmt-gap-x-m);
    --tmt-gap-y: var(--tmt-gap-y-m);
    inset: auto calc(var(--tmt-gap-x-m) + env(safe-area-inset-right))
           calc(var(--tmt-gap-y-m) + env(safe-area-inset-bottom))
           auto;
  }
  /* 用四边贴 0 铺满，不用 100dvh —— 避免与基础规则的 height/bottom 互相打架 */
  .tmt-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 0;
    border: 0;
    transform: translateY(16px);
  }
  .tmt-panel.is-open { transform: none; }

  /* 全屏时悬浮球让位，避免压住发送按钮 */
  .tmt-root.is-open .tmt-launcher {
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
  }
  .tmt-root.is-open .tmt-launcher__pulse { display: none; }

  .tmt-header {
    height: auto;
    min-height: var(--tmt-header-h);
    padding-top: env(safe-area-inset-top);
  }
  .tmt-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .tmt-bubble { max-width: 84%; }
  .tmt-teaser { display: none; }
}

/* ---------- 无障碍与降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .tmt-root *, .tmt-root *::before, .tmt-root *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
@media (prefers-contrast: more) {
  .tmt-bubble { border-color: #9BC7BA; }
}
