/* ============================================================
   医学翻译 Tab
   ============================================================ */
body.translate-mode{overflow:hidden !important;height:100vh !important;height:100dvh !important;margin:0 !important;padding:0 !important}
body.translate-mode .v2-hero,body.translate-mode .app-header{display:none !important}
body.translate-mode .app-main{padding:0 !important;max-width:none !important;margin:0 !important}
body.translate-mode .app-main > .tab-panel:not(#tab-translate){display:none !important}

body.translate-mode #tab-translate{
  display:flex !important;flex-direction:column;
  position:fixed !important;top:0 !important;left:0 !important;right:0 !important;
  bottom:calc(var(--nav-h) + var(--kb-h)) !important;
  z-index:100 !important;background:var(--v2-bg) !important;
  margin:0 !important;padding:0 !important;overflow:hidden !important;
  transition:bottom .12s ease-out;
}

/* 纯净翻译页：供外部平台直接打开，不显示底部导航与首次引导 */
body.embed-mode{--nav-h:0px !important}
body.embed-mode .bottom-nav{display:none !important}
body.embed-mode .welcome-overlay,
body.embed-mode .guide-overlay{display:none !important}
body.embed-mode .tr-scroll{padding-bottom:calc(28px + env(safe-area-inset-bottom))}

/* ---------- 顶部栏 ---------- */
.tr-topbar{
  flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:calc(10px + env(safe-area-inset-top)) 16px 10px;
  background:rgba(248,250,252,.92);
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border-bottom:1px solid var(--v2-border-light);
}
.tr-brand{display:flex;align-items:center;gap:10px;min-width:0}
.tr-logo{
  width:36px;height:36px;flex:0 0 36px;border-radius:12px;display:grid;place-items:center;
  background:linear-gradient(140deg,#0d9488,#14b8a6 55%,#06b6d4);
  color:#fff;font-size:17px;font-weight:800;
  box-shadow:0 6px 16px rgba(13,148,136,.26);
}
.tr-title-text{font-size:16px;font-weight:800;letter-spacing:-.2px;color:var(--v2-text);line-height:1.25}
.tr-title-sub{font-size:9px;font-weight:700;letter-spacing:1.4px;color:var(--v2-text-tertiary);text-transform:uppercase}
.tr-top-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
#tab-translate .tr-icon-btn{
  width:34px;height:34px;border-radius:11px;border:1px solid var(--v2-border);
  background:var(--v2-card);color:var(--v2-text-secondary);text-decoration:none;
  display:grid;place-items:center;font-size:15px;cursor:pointer;font-family:inherit;
}
#tab-translate .tr-icon-btn:active{transform:scale(.92);background:var(--v2-bg-alt)}
#tab-translate .tr-wb-btn{
  display:inline-flex;align-items:center;gap:4px;
  height:34px;padding:0 9px;border-radius:11px;
  border:1px solid rgba(13,148,136,.3);
  background:linear-gradient(135deg,#f0fdfa,#ecfeff);color:#0f766e;
  font-size:11.5px;font-weight:800;letter-spacing:.2px;text-decoration:none;
  font-family:inherit;white-space:nowrap;cursor:pointer;
}
#tab-translate .tr-wb-btn:active{transform:scale(.95);background:#e0f7f3}
.tr-wb-badge{
  min-width:15px;height:15px;padding:0 4px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#f59e0b,#f97316);color:#fff;
  font-size:9px;font-weight:800;line-height:1;
}
.tr-wb-badge[hidden]{display:none}

/* ---------- 滚动区 ---------- */
.tr-scroll{
  flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;padding:14px 14px 28px;
  width:100%;max-width:640px;margin:0 auto;
}

/* ---------- 语言选择条 ---------- */
.tr-langbar{
  display:flex;align-items:center;gap:6px;
  background:var(--v2-card);border:1px solid var(--v2-border-light);
  border-radius:16px;padding:5px;margin-bottom:12px;
  box-shadow:var(--v2-shadow-sm);
}
#tab-translate .tr-lang-btn{
  flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:6px;
  border:0;background:transparent;padding:10px 12px;border-radius:11px;
  font-size:15px;font-weight:700;color:var(--v2-text);cursor:pointer;font-family:inherit;
}
#tab-translate .tr-lang-btn:active{background:var(--v2-bg-alt)}
.tr-lang-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tr-lang-caret{font-size:10px;color:var(--v2-text-tertiary);flex-shrink:0}
#tab-translate .tr-swap{
  flex:0 0 38px;width:38px;height:38px;border-radius:50%;
  border:1px solid rgba(13,148,136,.18);background:rgba(13,148,136,.08);
  color:#0d9488;font-size:17px;display:grid;place-items:center;cursor:pointer;
  transition:transform .2s ease,background .15s;
}
#tab-translate .tr-swap:active{transform:rotate(180deg) scale(.92);background:rgba(13,148,136,.16)}

/* ---------- 卡片 ---------- */
.tr-card{
  background:var(--v2-card);border:1px solid var(--v2-border-light);
  border-radius:18px;padding:14px;margin-bottom:12px;
  box-shadow:var(--v2-shadow-sm);
}

/* ---------- 输入卡 ---------- */
.tr-input-card{position:relative;overflow:hidden}
.tr-input-card::before{
  content:'';position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(260px 100px at 100% 0,rgba(20,184,166,.09),transparent 62%);
}
.tr-input{
  position:relative;z-index:1;display:block;width:100%;min-height:118px;max-height:260px;
  border:0;outline:none;resize:none;background:transparent;
  color:var(--v2-text);font-size:15.5px;line-height:1.65;font-family:inherit;
  padding:2px 2px 8px;
}
.tr-input::placeholder{color:var(--v2-text-tertiary)}
.tr-input-meta{
  position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;
  gap:8px;padding-top:7px;border-top:1px dashed var(--v2-border-light);
  font-size:11px;color:var(--v2-text-tertiary);
}
.tr-count b{color:var(--v2-primary);font-weight:800}
.tr-input-tools{display:flex;gap:2px}
#tab-translate .tr-tool-btn{
  border:0;background:transparent;color:var(--v2-text-secondary);
  font-size:12px;font-weight:600;padding:5px 9px;border-radius:8px;cursor:pointer;
}
#tab-translate .tr-tool-btn:active{background:var(--v2-bg-alt);transform:scale(.96)}

#tab-translate .tr-translate-btn{
  position:relative;z-index:1;width:100%;height:46px;margin-top:12px;border:0;border-radius:14px;
  background:linear-gradient(135deg,#0d9488,#14b8a6 55%,#06b6d4);
  color:#fff;font-size:15px;font-weight:800;letter-spacing:1.5px;
  display:flex;align-items:center;justify-content:center;gap:8px;
  cursor:pointer;box-shadow:0 8px 22px rgba(13,148,136,.26);
  transition:transform .12s,box-shadow .12s;
}
.tr-translate-btn:active{transform:scale(.985);box-shadow:0 4px 12px rgba(13,148,136,.2)}
.tr-translate-btn:disabled{opacity:.75;cursor:default}
.tr-btn-icon{font-size:15px}
.tr-spinner{
  display:none;width:16px;height:16px;border-radius:50%;
  border:2px solid rgba(255,255,255,.35);border-top-color:#fff;
  animation:trSpin .7s linear infinite;
}
.tr-translate-btn.loading .tr-btn-icon{display:none}
.tr-translate-btn.loading .tr-spinner{display:block}
@keyframes trSpin{to{transform:rotate(360deg)}}
.tr-privacy-note{
  position:relative;z-index:1;margin-top:9px;text-align:center;
  font-size:10.5px;line-height:1.5;color:var(--v2-text-tertiary);
}

/* ---------- 实时语音入口 ---------- */
.tr-action-row{position:relative;z-index:1;display:flex;align-items:stretch;gap:8px;margin-top:12px}
#tab-translate .tr-action-row .tr-translate-btn{flex:1 1 auto;width:auto;min-width:0;margin-top:0}
#tab-translate .tr-voice-btn{
  flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-width:106px;height:46px;padding:0 13px;border-radius:14px;
  border:1px solid rgba(13,148,136,.28);
  background:linear-gradient(135deg,#f0fdfa,#ecfeff);color:#0f766e;
  font-size:12.5px;font-weight:800;letter-spacing:.2px;font-family:inherit;
  white-space:nowrap;cursor:pointer;
  box-shadow:0 4px 12px rgba(13,148,136,.1);
  transition:transform .12s,background .15s;
}
#tab-translate .tr-voice-btn .mi{font-size:17px}
#tab-translate .tr-voice-btn:active{transform:scale(.97);background:#e0f7f3}

/* ---------- 结果卡 ---------- */
.tr-result{animation:trFade .22s ease-out}
.tr-result[hidden]{display:none}
@keyframes trFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tr-result-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.tr-result-label{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:700;color:var(--v2-text-secondary);min-width:0}
.tr-result-dot{
  width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:#10b981;
  box-shadow:0 0 0 3px rgba(16,185,129,.15);
}
.tr-result-tools{display:flex;gap:6px;flex-shrink:0}
#tab-translate .tr-mini-btn{
  display:inline-flex;align-items:center;gap:4px;
  border:1px solid var(--v2-border);background:var(--v2-card);
  color:var(--v2-text-secondary);border-radius:9px;padding:5px 9px;
  font-size:11.5px;font-weight:600;cursor:pointer;font-family:inherit;
}
#tab-translate .tr-mini-btn:active{background:var(--v2-bg-alt);transform:scale(.95)}
#tab-translate .tr-star-btn.saved{
  color:#b45309;border-color:rgba(245,158,11,.42);background:rgba(245,158,11,.09);
}
.tr-result-meta{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-bottom:9px}
.tr-result-meta[hidden]{display:none}
.tr-meta-pill{
  display:inline-flex;align-items:center;gap:4px;
  padding:3px 8px;border-radius:999px;
  background:var(--v2-info-bg);color:#0f766e;
  font-size:9.5px;font-weight:700;letter-spacing:.2px;
}
.tr-meta-pill.is-time{background:var(--v2-bg-alt);color:var(--v2-text-tertiary)}
.tr-result-rich[hidden]{display:none}
.tr-result-rich{animation:trFade .2s ease-out}
#tab-translate .tr-result-rich .de-word{font-size:22px}
#tab-translate .tr-result-rich .de-primary{font-size:17px;margin-top:10px}
#tab-translate .tr-result-rich .de-section{margin-top:13px;padding-top:11px}
.tr-result-text[hidden]{display:none}
.tr-result-text{font-size:16px;line-height:1.75;color:var(--v2-text);white-space:pre-wrap;word-break:break-word;min-height:22px}
.tr-result-foot{margin-top:10px;padding-top:9px;border-top:1px dashed var(--v2-border-light);font-size:10.5px;color:var(--v2-text-tertiary)}
.tr-result.is-error .tr-result-dot{background:#f43f5e;box-shadow:0 0 0 3px rgba(244,63,94,.15)}
.tr-result.is-error .tr-result-text{color:#e11d48;font-size:13.5px;line-height:1.6}
.tr-skeleton{display:flex;flex-direction:column;gap:9px;padding:3px 0}
.tr-skeleton span{
  display:block;height:13px;border-radius:7px;
  background:linear-gradient(90deg,var(--v2-bg-alt) 25%,var(--v2-card) 37%,var(--v2-bg-alt) 63%);
  background-size:400% 100%;animation:trShimmer 1.3s ease infinite;
}
.tr-skeleton span:nth-child(1){width:92%}
.tr-skeleton span:nth-child(2){width:100%}
.tr-skeleton span:nth-child(3){width:66%}
@keyframes trShimmer{0%{background-position:100% 0}100%{background-position:0 0}}

/* ---------- 分区标题 ---------- */
.tr-section{margin-top:20px}
.tr-section-head{display:flex;align-items:center;justify-content:space-between;padding:0 4px 10px}
.tr-section-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:800;color:var(--v2-text);letter-spacing:-.2px}
.tr-section-title::before{content:'';width:4px;height:15px;border-radius:4px;background:linear-gradient(135deg,#0d9488,#06b6d4)}
.tr-section-note{
  font-size:10.5px;font-weight:700;color:var(--v2-text-tertiary);
  background:var(--v2-bg-alt);padding:3px 9px;border-radius:999px;
}
.tr-link-btn{
  border:0;background:transparent;color:var(--v2-text-tertiary);
  font-size:11.5px;font-weight:700;padding:4px;cursor:pointer;
}
.tr-link-btn:active{color:#0d9488}

.tr-empty{text-align:center;color:var(--v2-text-tertiary);font-size:12.5px;padding:24px 12px;line-height:1.7}

/* ---------- 历史 ---------- */
.tr-history{
  background:var(--v2-card);border:1px solid var(--v2-border-light);
  border-radius:16px;overflow:hidden;box-shadow:var(--v2-shadow-sm);
}
.tr-hitem{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--v2-border-light)}
.tr-hitem:last-child{border-bottom:0}
.tr-hmain{
  flex:1;min-width:0;display:flex;flex-direction:column;gap:3px;
  background:none;border:0;padding:0;text-align:left;cursor:pointer;font-family:inherit;
}
.tr-hsrc{font-size:12px;color:var(--v2-text-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tr-hdst{font-size:13px;color:var(--v2-text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tr-hmeta{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.tr-hlang{font-size:9.5px;font-weight:800;color:#0d9488}
.tr-htime{font-size:9.5px;color:var(--v2-text-tertiary)}
.tr-hdel{
  border:0;background:transparent;color:var(--v2-text-tertiary);
  font-size:15px;line-height:1;cursor:pointer;padding:2px;margin-left:2px;
}
.tr-hdel:active{color:#f43f5e}

/* ---------- 语言选择底部弹层 ---------- */
.tr-sheet-overlay{
  position:fixed;inset:0;z-index:1200;background:rgba(15,23,42,.5);
  display:flex;align-items:flex-end;justify-content:center;
  opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s;
}
.tr-sheet-overlay.show{opacity:1;visibility:visible}
.tr-sheet{
  width:100%;max-width:480px;background:var(--v2-card);
  border-radius:24px 24px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  transform:translateY(24px);transition:transform .25s cubic-bezier(.2,.8,.2,1);
  max-height:72vh;overflow-y:auto;
}
.tr-sheet-overlay.show .tr-sheet{transform:translateY(0)}
.tr-sheet-head{display:flex;align-items:center;justify-content:space-between;padding:0 4px 14px}
.tr-sheet-title{font-size:16px;font-weight:800;color:var(--v2-text)}
#trLangSheet .tr-sheet-close{
  width:30px;height:30px;border:0;border-radius:10px;
  background:var(--v2-bg-alt);color:var(--v2-text-secondary);font-size:13px;cursor:pointer;
}
.tr-sheet-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#trLangSheet .tr-sheet-lang{
  border:1px solid var(--v2-border);background:var(--v2-bg);border-radius:12px;
  padding:14px 6px;text-align:center;font-size:13.5px;font-weight:700;color:var(--v2-text);
  cursor:pointer;font-family:inherit;
}
#trLangSheet .tr-sheet-lang:active{transform:scale(.96)}
#trLangSheet .tr-sheet-lang.active{
  background:linear-gradient(135deg,#0d9488,#06b6d4);border-color:transparent;color:#fff;
  box-shadow:0 6px 14px rgba(13,148,136,.24);
}
.tr-sheet-note{font-size:11px;color:var(--v2-text-tertiary);padding:10px 4px 0;line-height:1.6}

/* ---------- 实时录音翻译弹层 ---------- */
body.tr-voice-open{overflow:hidden}
.tr-voice-overlay{
  position:fixed;inset:0;z-index:1250;background:rgba(15,23,42,.55);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  display:flex;align-items:flex-end;justify-content:center;
  opacity:0;visibility:hidden;transition:opacity .22s,visibility .22s;
}
.tr-voice-overlay.show{opacity:1;visibility:visible}
.tr-voice-panel{
  width:100%;max-width:540px;height:min(88vh,780px);max-height:calc(100dvh - 16px);
  background:var(--v2-card);border-radius:24px 24px 0 0;
  display:flex;flex-direction:column;overflow:hidden;
  transform:translateY(40px);transition:transform .3s cubic-bezier(.2,.8,.2,1);
  padding-bottom:env(safe-area-inset-bottom);
}
.tr-voice-overlay.show .tr-voice-panel{transform:translateY(0)}
#trVoicePanel:focus{outline:none}
.tr-voice-panel [hidden]{display:none !important}
.tr-voice-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 18px 12px}
.tr-voice-title{font-size:17px;font-weight:800;color:var(--v2-text);letter-spacing:-.2px}
.tr-voice-dir{margin-top:3px;font-size:11.5px;font-weight:700;color:#0d9488}
#trVoiceSheet .tr-voice-close{
  width:32px;height:32px;flex:0 0 32px;border:0;border-radius:10px;
  background:var(--v2-bg-alt);color:var(--v2-text-secondary);
  display:grid;place-items:center;cursor:pointer;
}
#trVoiceSheet .tr-voice-close .mi{font-size:15px}
#trVoiceSheet .tr-voice-close:active{transform:scale(.92)}

.tr-voice-idle{
  flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:6px 24px 24px;overflow-y:auto;
}
.tr-voice-orb{
  position:relative;width:104px;height:104px;border-radius:50%;flex:0 0 auto;
  display:grid;place-items:center;color:#fff;margin-bottom:24px;
  background:linear-gradient(140deg,#0d9488,#14b8a6 55%,#06b6d4);
  box-shadow:0 16px 42px rgba(13,148,136,.32);
}
.tr-voice-orb::before,.tr-voice-orb::after{
  content:'';position:absolute;inset:-10px;border-radius:50%;
  border:1px solid rgba(20,184,166,.28);animation:trVoiceHalo 2.4s ease-out infinite;
}
.tr-voice-orb::after{animation-delay:1.2s}
.tr-voice-orb .mi{font-size:44px}
@keyframes trVoiceHalo{0%{transform:scale(.92);opacity:.85}70%{transform:scale(1.22);opacity:0}100%{transform:scale(1.22);opacity:0}}
.tr-voice-idle-title{font-size:19px;font-weight:800;color:var(--v2-text);letter-spacing:-.3px}
.tr-voice-idle-text{margin-top:8px;max-width:310px;font-size:12.5px;line-height:1.7;color:var(--v2-text-tertiary)}
#trVoiceSheet .tr-voice-start{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  width:100%;max-width:280px;height:50px;margin-top:26px;
  border:0;border-radius:15px;color:#fff;
  background:linear-gradient(135deg,#0d9488,#14b8a6 55%,#06b6d4);
  font-size:15px;font-weight:800;letter-spacing:.5px;font-family:inherit;
  cursor:pointer;box-shadow:0 10px 26px rgba(13,148,136,.28);
}
#trVoiceSheet .tr-voice-start .mi{font-size:18px}
#trVoiceSheet .tr-voice-start:active{transform:scale(.98)}
#trVoiceSheet .tr-voice-start:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.tr-voice-privacy{margin-top:16px;max-width:320px;font-size:10.5px;line-height:1.6;color:var(--v2-text-tertiary)}

.tr-voice-session{flex:1;min-height:0;display:flex;flex-direction:column;padding:0 18px 14px}
.tr-voice-statusbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:2px 2px 10px}
.tr-voice-status{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;color:var(--v2-text-secondary)}
.tr-voice-dot{
  width:8px;height:8px;border-radius:50%;background:#ef4444;
  box-shadow:0 0 0 3px rgba(239,68,68,.14);animation:trVoicePulse 1.1s ease-in-out infinite;
}
.tr-voice-status.is-recovering .tr-voice-dot{background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.14);animation-duration:1.8s}
@keyframes trVoicePulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.8)}}
.tr-voice-timer{font-size:14px;font-weight:800;color:var(--v2-text);font-variant-numeric:tabular-nums;letter-spacing:.4px}

.tr-voice-wave{flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:3px;height:24px;margin:0 0 10px;opacity:.9}
.tr-voice-wave span{
  width:3px;height:100%;border-radius:3px;
  background:linear-gradient(180deg,#14b8a6,#06b6d4);
  transform-origin:center;animation:trVoiceWave 1s ease-in-out infinite;
}
.tr-voice-wave span:nth-child(1){animation-delay:-.9s}
.tr-voice-wave span:nth-child(2){animation-delay:-.7s}
.tr-voice-wave span:nth-child(3){animation-delay:-.5s}
.tr-voice-wave span:nth-child(4){animation-delay:-.3s}
.tr-voice-wave span:nth-child(5){animation-delay:-.6s}
.tr-voice-wave span:nth-child(6){animation-delay:-.8s}
.tr-voice-wave span:nth-child(7){animation-delay:-.4s}
@keyframes trVoiceWave{0%,100%{transform:scaleY(.25);opacity:.5}50%{transform:scaleY(1);opacity:1}}
.tr-voice-wave.is-paused span{animation-play-state:paused;transform:scaleY(.25);opacity:.45}

.tr-voice-notice{
  flex:0 0 auto;margin:0 2px 9px;padding:8px 11px;border-radius:10px;
  background:var(--v2-warning-bg);color:#b45309;font-size:11.5px;line-height:1.55;
}
.tr-voice-rows{
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  display:flex;flex-direction:column;gap:9px;padding:2px 2px 6px;
}
.tr-voice-row{
  flex:0 0 auto;border:1px solid var(--v2-border-light);background:var(--v2-bg-alt);
  border-radius:13px;padding:9px 12px;animation:trFade .2s ease-out;
}
.tr-vsrc{font-size:12.5px;line-height:1.55;color:var(--v2-text-secondary);word-break:break-word;white-space:pre-wrap}
.tr-vdst{margin-top:3px;font-size:15px;line-height:1.6;font-weight:700;color:var(--v2-text);word-break:break-word;white-space:pre-wrap}
.tr-voice-row.is-interim{border-style:dashed;background:transparent}
.tr-voice-row.is-interim .tr-vsrc{color:var(--v2-text)}
.tr-voice-row.is-interim .tr-vdst{font-weight:500;color:var(--v2-text-tertiary)}
.tr-voice-row.is-error .tr-vdst{color:#e11d48;font-size:12.5px;font-weight:500}
.tr-vpending{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:500;color:var(--v2-text-tertiary)}
.tr-vpending::before{
  content:'';width:11px;height:11px;border-radius:50%;
  border:2px solid var(--v2-border);border-top-color:#0d9488;animation:trSpin .7s linear infinite;
}
.tr-voice-hint{
  flex:1;display:flex;align-items:center;justify-content:center;text-align:center;
  padding:26px 10px;font-size:12.5px;line-height:1.7;color:var(--v2-text-tertiary);
}

.tr-voice-done-head{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:2px 2px 10px}
.tr-voice-done-icon{
  width:36px;height:36px;flex:0 0 36px;border-radius:50%;
  display:grid;place-items:center;background:var(--v2-success-bg);color:var(--v2-success);
}
.tr-voice-done-icon .mi{font-size:19px;stroke-width:2.5}
.tr-voice-done-title{font-size:15px;font-weight:800;color:var(--v2-text)}
.tr-voice-done-sub{margin-top:2px;font-size:11.5px;color:var(--v2-text-tertiary)}

#trVoiceSheet .tr-voice-stop{
  flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;height:48px;margin-top:10px;border:0;border-radius:14px;
  background:linear-gradient(135deg,#ef4444,#f43f5e);color:#fff;
  font-size:15px;font-weight:800;letter-spacing:1px;font-family:inherit;
  cursor:pointer;box-shadow:0 8px 22px rgba(244,63,94,.24);
}
#trVoiceSheet .tr-voice-stop .mi{font-size:16px}
#trVoiceSheet .tr-voice-stop:active{transform:scale(.985);box-shadow:0 4px 12px rgba(244,63,94,.2)}

.tr-voice-actions{flex:0 0 auto;display:flex;gap:8px;margin-top:10px}
#trVoiceSheet .tr-voice-export{
  flex:1 1 auto;min-width:0;height:48px;border:0;border-radius:14px;
  display:flex;align-items:center;justify-content:center;gap:7px;
  background:linear-gradient(135deg,#0d9488,#14b8a6 55%,#06b6d4);color:#fff;
  font-size:14.5px;font-weight:800;font-family:inherit;cursor:pointer;
  box-shadow:0 8px 22px rgba(13,148,136,.24);
}
#trVoiceSheet .tr-voice-export .mi{font-size:17px}
#trVoiceSheet .tr-voice-export:active{transform:scale(.985)}
#trVoiceSheet .tr-voice-export:disabled{opacity:.55;cursor:default;box-shadow:none}
#trVoiceSheet .tr-voice-delete{
  flex:0 0 108px;height:48px;border:1px solid rgba(244,63,94,.32);border-radius:14px;
  display:flex;align-items:center;justify-content:center;gap:6px;
  background:var(--v2-danger-bg);color:var(--v2-danger);
  font-size:14px;font-weight:800;font-family:inherit;cursor:pointer;
}
#trVoiceSheet .tr-voice-delete .mi{font-size:16px}
#trVoiceSheet .tr-voice-delete:active{transform:scale(.97)}
#trVoiceSheet button:focus{outline:none}
#trVoiceSheet button:focus-visible{outline:2px solid rgba(13,148,136,.6);outline-offset:2px}
#trVoiceSheet .tr-voice-stop:focus-visible,#trVoiceSheet .tr-voice-delete:focus-visible{outline-color:rgba(244,63,94,.6)}
.tr-voice-done-note{flex:0 0 auto;margin-top:8px;text-align:center;font-size:10.5px;color:var(--v2-text-tertiary)}

/* ---------- Toast ---------- */
.tr-toast{
  position:fixed;left:50%;bottom:calc(var(--nav-h) + var(--kb-h) + 18px);
  transform:translate(-50%,14px);z-index:1300;
  background:rgba(15,23,42,.9);color:#fff;
  font-size:12.5px;font-weight:600;padding:9px 16px;border-radius:999px;
  opacity:0;visibility:hidden;transition:opacity .22s,transform .22s,visibility .22s;
  pointer-events:none;white-space:nowrap;max-width:86vw;overflow:hidden;text-overflow:ellipsis;
}
.tr-toast.show{opacity:1;visibility:visible;transform:translate(-50%,0)}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme:dark){
  .tr-topbar{background:rgba(11,18,32,.92)}
  #tab-translate .tr-swap{background:rgba(20,184,166,.14);border-color:#1d4d52;color:#5eead4}
  #tab-translate .tr-lang-btn:active{background:#16243a}
  #tab-translate .tr-wb-btn{background:#12303a;border-color:#1e4d52;color:#7fe3d6}
  #tab-translate .tr-wb-btn:active{background:#17424c}
  .tr-input::placeholder{color:#64778f}
  #tab-translate .tr-mini-btn{background:#132135}
  #tab-translate .tr-star-btn.saved{
    color:#fbbf24;border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.13);
  }
  .tr-meta-pill{background:rgba(20,184,166,.15);color:#5eead4}
  .tr-meta-pill.is-time{background:#16243a;color:#64748b}
  .tr-skeleton span{background:linear-gradient(90deg,#16243a 25%,#1d2f47 37%,#16243a 63%);background-size:400% 100%}
  .tr-toast{background:rgba(226,236,250,.95);color:#0f172a}
  #tab-translate .tr-voice-btn{background:#12303a;border-color:#1e4d52;color:#7fe3d6}
  #tab-translate .tr-voice-btn:active{background:#17424c}
  #trVoiceSheet .tr-voice-close{background:#16243a}
  .tr-voice-dir{color:#5eead4}
  .tr-voice-row.is-error .tr-vdst{color:#fb7185}
  .tr-voice-notice{background:rgba(245,158,11,.14);color:#fbbf24}
  #trVoiceSheet .tr-voice-delete{background:rgba(244,63,94,.12);border-color:rgba(244,63,94,.3);color:#fb7185}
}
@media (max-width:380px){
  .tr-topbar{padding-left:12px;padding-right:12px;gap:8px}
  .tr-title-sub{display:none}
  .tr-top-actions{gap:5px}
  #tab-translate .tr-wb-btn{padding:0 8px;font-size:11px;gap:3px}
  .tr-lang-btn{font-size:13.5px;padding:9px 8px}
  .tr-sheet-grid{grid-template-columns:repeat(2,1fr)}
  #tab-translate .tr-voice-btn{min-width:96px;padding:0 10px;font-size:12px}
  .tr-voice-panel{height:92vh;max-height:calc(100dvh - 8px)}
  .tr-voice-head{padding:16px 16px 10px}
  .tr-voice-session{padding:0 14px 12px}
  .tr-voice-idle{padding-left:18px;padding-right:18px}
  .tr-voice-orb{width:92px;height:92px;margin-bottom:20px}
  .tr-voice-orb .mi{font-size:38px}
  .tr-voice-idle-title{font-size:17.5px}
  .tr-voice-actions{gap:7px}
  #trVoiceSheet .tr-voice-delete{flex-basis:96px}
}
@media (max-width:350px){
  .tr-result-head{flex-wrap:wrap;row-gap:8px}
  .tr-result-tools{width:100%;justify-content:flex-end}
  #tab-translate .tr-voice-btn{min-width:0;width:92px;padding:0 8px;gap:4px}
  #tab-translate .tr-voice-btn .mi{font-size:16px}
  #tab-translate .tr-voice-btn span{font-size:11.5px}
  #trVoiceSheet .tr-voice-delete{flex-basis:88px}
  #trVoiceSheet .tr-voice-export{font-size:13.5px}
}
