/* ==========================================================================
   武志红 · 全双工实时语音对话界面
   暖色调疗愈美学（Warm Cream / Apricot / Terracotta / Amber）
   桌面端居中优雅卡片，移动端全屏原生体验
   ========================================================================== */

:root {
  --bg-page: #f3eae0;
  --bg-app-top: #fdf4ea;
  --bg-app-mid: #fbf7f2;
  --bg-app-bot: #fae9d7;

  --card-bg: rgba(255, 253, 250, 0.88);
  --card-bg-solid: #fffdfa;
  --card-border: rgba(214, 158, 108, 0.22);
  --card-shadow: 0 4px 18px rgba(139, 86, 44, 0.06);

  --user-bubble-bg: #f6dec6;
  --user-bubble-border: rgba(217, 134, 74, 0.24);

  --text-main: #2d211a;
  --text-body: #3d2e24;
  --text-sub: #7d6859;
  --text-muted: #a69180;

  /* 暖色主强调色 */
  --warm-primary: #d97742;      /* 陶土暖橙 */
  --warm-primary-deep: #be602e;
  --warm-primary-soft: rgba(217, 119, 66, 0.14);
  --warm-amber: #e89f4c;        /* 蜂蜜琥珀 */
  --warm-rose: #d96b60;         /* 挂断 / 录音暖珊瑚红 */
  --warm-sage: #5b9a72;         /* 在线 / 打断提示温润鼠尾草绿 */

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.mt-12 { margin-top: 12px; }

/* 滚动条柔和化 */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(186, 138, 97, 0.28);
  border-radius: 99px;
}

/* ==================== 桌面居中舞台 / 移动全屏容器 ==================== */
.page-backdrop {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(242, 189, 138, 0.32), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(232, 159, 108, 0.26), transparent 48%),
    #f2e8dc;
}

.app-frame {
  position: relative;
  width: min(460px, 100vw);
  height: min(860px, 95vh);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-app-top) 0%, var(--bg-app-mid) 46%, var(--bg-app-bot) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 24px 64px rgba(112, 68, 34, 0.14),
    0 4px 16px rgba(112, 68, 34, 0.06);
}

@media (max-width: 560px) {
  .page-backdrop { background: var(--bg-app-mid); }
  .app-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* ==================== 视图切换 ==================== */
.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* ==================== 界面一：文本 + 语音转文字对话 ==================== */
.view-chat {
  display: flex;
  flex-direction: column;
}

/* 顶部栏（对齐截图风格） */
.top-bar {
  flex-shrink: 0;
  height: 68px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(253, 244, 234, 0.96), rgba(253, 244, 234, 0.6));
  backdrop-filter: blur(12px);
  z-index: 10;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 86px;
}

.top-right {
  justify-content: flex-end;
}

.top-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: background 0.15s;
}

.top-icon-btn:hover {
  background: rgba(217, 119, 66, 0.12);
}

.top-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.avatar-ring {
  position: relative;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5cfa6, #d97742);
  box-shadow: 0 3px 10px rgba(217, 119, 66, 0.22);
}

.wzh-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  background: #efe2d5;
  border: 2px solid #fffaf4;
  user-select: none;
  flex-shrink: 0;
}

.wzh-avatar.sm { width: 34px; height: 34px; }
.wzh-avatar.xl {
  width: 96px;
  height: 96px;
  border: 3px solid #fffaf4;
  box-shadow: 0 10px 28px rgba(190, 96, 46, 0.28);
}

.verified-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--warm-primary);
  border: 2px solid #fdf4ea;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-persona-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  line-height: 1.1;
}

/* 右上角实时语音通话胶囊按钮 */
.btn-voice-call {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(217, 119, 66, 0.34);
  color: var(--warm-primary-deep);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(217, 119, 66, 0.14);
  transition: all 0.16s;
}

.btn-voice-call:hover {
  background: var(--warm-primary);
  color: #fff;
  border-color: var(--warm-primary);
}

/* 消息流区域 */
.message-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px 14px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 武志红欢迎开场白大卡片（还原参考图顶部样式） */
.wzh-welcome-card {
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.78;
  animation: riseIn 0.25s ease;
}

.wzh-welcome-card p + p {
  margin-top: 10px;
}

/* 用户消息气泡（暖杏色右对齐） */
.user-msg-wrap {
  display: flex;
  justify-content: flex-end;
  animation: riseIn 0.2s ease;
}

.user-bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 16px 16px 4px 16px;
  background: var(--user-bubble-bg);
  border: 1px solid var(--user-bubble-border);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.user-voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px dashed rgba(186, 122, 68, 0.28);
  font-size: 12px;
  color: var(--warm-primary-deep);
}

.user-voice-play {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--warm-primary);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-stt-tag {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-sub);
}

/* 武志红回复卡片（核心：完全还原截图中的「头像 + 播放圆钮 + 波形条 + 正文 + 复制按钮」） */
.wzh-reply-card {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: riseIn 0.24s ease;
}

.voice-player-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e58e52, #d97742);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(217, 119, 66, 0.3);
  transition: transform 0.14s, filter 0.14s;
}

.play-circle-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.play-circle-btn.playing {
  background: linear-gradient(135deg, #c9622d, #b85321);
}

.play-circle-btn.loading {
  animation: pulseSoft 0.9s ease-in-out infinite;
}

.waveform-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  flex: 1;
  overflow: hidden;
}

.waveform-strip span {
  width: 3px;
  border-radius: 3px;
  background: rgba(217, 119, 66, 0.32);
  transition: background 0.15s;
}

.waveform-strip.playing span {
  background: var(--warm-primary);
  animation: waveDance 0.65s ease-in-out infinite alternate;
}

.waveform-strip.playing span:nth-child(2n) { animation-duration: 0.48s; }
.waveform-strip.playing span:nth-child(3n) { animation-duration: 0.82s; }

@keyframes waveDance {
  from { transform: scaleY(0.45); opacity: 0.65; }
  to { transform: scaleY(1.15); opacity: 1; }
}

.voice-status-tag {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wzh-reply-text {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-word;
}

.wzh-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.card-copy-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(242, 224, 206, 0.55);
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.card-copy-btn:hover {
  background: rgba(217, 119, 66, 0.16);
  color: var(--warm-primary-deep);
}

.card-engine-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* 通话记录回流卡片 */
.call-summary-card {
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 247, 238, 0.9);
  border: 1px solid rgba(217, 119, 66, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.call-sum-title {
  font-weight: 600;
  color: var(--warm-primary-deep);
  display: flex;
  align-items: center;
  gap: 6px;
}

.call-sum-btn {
  font-size: 12px;
  color: var(--text-sub);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--card-border);
}

.call-sum-body {
  padding-top: 8px;
  border-top: 1px dashed var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

.call-sum-body strong { color: var(--text-main); }
.barge-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(91, 154, 114, 0.15);
  color: var(--warm-sage);
  margin-left: 5px;
}

/* ==================== 底部快捷胶囊 + 按住说话 / 键盘输入栏 ==================== */
.bottom-dock {
  flex-shrink: 0;
  padding: 6px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: linear-gradient(180deg, rgba(250, 233, 215, 0), rgba(250, 233, 215, 0.85) 35%);
}

.quick-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
}
.quick-pills::-webkit-scrollbar { display: none; }

.quick-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.86);
  border: 1px solid var(--card-border);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(139, 86, 44, 0.04);
  transition: all 0.15s;
}

.quick-pill:hover {
  border-color: var(--warm-primary);
  color: var(--warm-primary-deep);
  background: #fff;
}

/* 底部核心白胶囊输入栏 */
.input-bar {
  background: #fffdfa;
  border: 1px solid rgba(214, 158, 108, 0.28);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(139, 86, 44, 0.08);
  transition: border-color 0.18s;
}

.input-bar-voice {
  height: 54px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-switch-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  flex-shrink: 0;
  transition: background 0.15s;
}

.mode-switch-btn:hover {
  background: var(--warm-primary-soft);
  color: var(--warm-primary-deep);
}

.hold-talk-btn {
  flex: 1;
  height: 44px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 36px; /* 视觉居中补偿左侧图标 */
  user-select: none;
  transition: background 0.15s;
}

.hold-talk-btn:hover {
  background: rgba(217, 119, 66, 0.07);
}

.hold-talk-btn:active {
  background: rgba(217, 119, 66, 0.15);
}

/* 键盘打字模式 */
.input-bar-text {
  padding: 8px 10px 8px 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.input-bar-text:focus-within {
  border-color: var(--warm-primary);
}

.text-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  min-height: 26px;
  max-height: 110px;
  padding: 6px 2px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-main);
}

.text-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--warm-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.12s;
}

.send-btn:disabled {
  background: #e9d9c8;
  color: #b8a391;
  cursor: not-allowed;
}

/* 语音转文字录音展开态 */
.input-bar-recording {
  padding: 12px 14px;
  border-color: var(--warm-primary);
  background: #fff9f2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-top-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-rose);
  animation: pulseSoft 1s infinite;
}

@keyframes pulseSoft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.rec-timer {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warm-rose);
}

.rec-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin-left: 4px;
}

.rec-wave span {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: var(--warm-primary);
  animation: waveDance 0.6s ease-in-out infinite alternate;
}
.rec-wave span:nth-child(even) { animation-duration: 0.45s; }

.rec-preview-text {
  font-size: 14px;
  color: var(--text-body);
  min-height: 22px;
}

.rec-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.rec-action-btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
}

.rec-cancel {
  background: #f2e5d7;
  color: var(--text-sub);
}

.rec-edit {
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.rec-send {
  background: var(--warm-primary);
  color: #fff;
}

.legal-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==================== 左侧历史会话抽屉 ==================== */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 33, 26, 0.32);
  backdrop-filter: blur(2px);
  z-index: 30;
}

.history-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 286px;
  background: #fdf7f0;
  border-right: 1px solid var(--card-border);
  z-index: 35;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 12px 0 36px rgba(92, 56, 28, 0.14);
}

.history-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 16px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title { font-size: 15px; font-weight: 700; }
.drawer-sub { font-size: 11.5px; color: var(--text-muted); }

.drawer-new-wrap {
  padding: 12px 14px 8px;
}

.btn-new-session {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e58e52, #d97742);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(217, 119, 66, 0.24);
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.session-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.session-item:hover { background: rgba(217, 119, 66, 0.08); }
.session-item.active {
  background: #fffdfa;
  border-color: var(--card-border);
  box-shadow: 0 2px 8px rgba(139, 86, 44, 0.05);
}

.s-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.s-call { color: var(--warm-primary); font-family: var(--font-mono); }

.drawer-foot {
  padding: 12px;
  border-top: 1px solid var(--card-border);
}

.drawer-engine-card {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdfa;
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}

.de-row { display: flex; align-items: center; gap: 6px; color: var(--text-sub); }
.de-row strong { color: var(--text-main); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warm-sage); flex-shrink: 0; }
.de-dot.warm { background: var(--warm-primary); }
.de-tip {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed var(--card-border);
  font-size: 11px;
  color: var(--warm-primary-deep);
}

/* ==================== 界面二：全双工实时语音通话（暖阳疗愈风格） ==================== */
.view-call {
  display: flex;
  flex-direction: column;
  background: linear-gradient(175deg, #fdf3e7 0%, #fae7d3 52%, #f4d6b8 100%);
  color: var(--text-main);
}

.call-warm-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 38%, rgba(235, 146, 82, 0.24), transparent 58%);
  transition: background 0.5s ease;
}

.view-call[data-call-state="thinking"] .call-warm-glow {
  background: radial-gradient(circle at 50% 38%, rgba(217, 152, 82, 0.28), transparent 58%);
}

.view-call[data-call-state="speaking"] .call-warm-glow {
  background: radial-gradient(circle at 50% 38%, rgba(217, 119, 66, 0.34), transparent 60%);
}

.view-call[data-call-state="interrupted"] .call-warm-glow {
  background: radial-gradient(circle at 50% 38%, rgba(91, 154, 114, 0.24), transparent 58%);
}

.call-top-bar {
  position: relative;
  z-index: 5;
  height: 62px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.78);
  border: 1px solid var(--card-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
}

.call-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.75);
  border: 1px solid var(--card-border);
  font-size: 12.5px;
  color: var(--text-sub);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warm-sage);
  animation: pulseSoft 1.5s infinite;
}

.call-clock {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.call-top-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid var(--card-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
}

/* 通话主舞台 */
.call-center-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 0;
  padding: 4px 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 10px;
}

.call-duplex-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.duplex-badge {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(91, 154, 114, 0.14);
  border: 1px solid rgba(91, 154, 114, 0.28);
  color: #3f7654;
  font-weight: 500;
}

.latency-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.65);
  border: 1px solid var(--card-border);
  color: var(--text-sub);
}

.call-orb-wrap {
  position: relative;
  width: 224px;
  height: 224px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#duplex-orb-canvas {
  width: 224px;
  height: 224px;
}

.call-avatar-core {
  position: absolute;
  pointer-events: none;
}

.call-state-copy {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.call-person-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.call-state-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--warm-primary-deep);
}

.call-state-sub {
  font-size: 12.5px;
  color: var(--text-sub);
}

/* 双通道电平条 */
.duplex-meters {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.72);
  border: 1px solid var(--card-border);
}

.meter-box {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-sub);
}

.meter-track {
  position: relative;
  width: 64px;
  height: 5px;
  border-radius: 99px;
  background: rgba(186, 138, 97, 0.2);
  overflow: hidden;
}

.meter-thresh {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(190, 96, 46, 0.55);
  pointer-events: none;
}

.meter-fill {
  height: 100%;
  width: 10%;
  border-radius: 99px;
  transition: width 0.08s linear;
}
.meter-fill.mic { background: linear-gradient(90deg, #5b9a72, #7bc094); }
.meter-fill.ai { background: linear-gradient(90deg, #e59a4b, #d97742); }

/* 实时字幕卡 */
.live-caption-card {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.84);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  line-height: 1.5;
  transition: opacity 0.2s;
}

.live-caption-card.captions-hidden {
  opacity: 0;
  pointer-events: none;
}

.cap-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cap-who {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
}

.cap-row.user .cap-who { background: #f4dec7; color: var(--warm-primary-deep); }
.cap-row.user .cap-txt { color: var(--text-sub); }
.cap-row.wzh .cap-who { background: rgba(217, 119, 66, 0.16); color: var(--warm-primary-deep); }
.cap-row.wzh .cap-txt { color: var(--text-main); }

/* 状态演示条 */
.sim-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.56);
  border: 1px dashed rgba(214, 158, 108, 0.42);
}

.sim-label { font-size: 11px; color: var(--text-muted); padding: 0 4px; }

.sim-btn {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-sub);
  background: rgba(255, 253, 250, 0.85);
  border: 1px solid transparent;
}

.sim-btn.active {
  background: var(--warm-primary);
  color: #fff;
}

.sim-btn.mic-live {
  background: var(--warm-rose);
  color: #fff;
}

/* 底部通话操作栏 */
.call-bottom-dock {
  position: relative;
  z-index: 5;
  padding: 10px 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.call-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-sub);
}

.ctrl-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.86);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 86, 44, 0.08);
  transition: all 0.16s;
}

.call-ctrl.active .ctrl-round {
  background: var(--warm-primary-soft);
  border-color: var(--warm-primary);
  color: var(--warm-primary-deep);
}

.call-ctrl.muted .ctrl-round {
  background: rgba(217, 107, 96, 0.16);
  border-color: var(--warm-rose);
  color: var(--warm-rose);
}

.call-ctrl.can-interrupt .ctrl-round {
  background: rgba(232, 159, 76, 0.25);
  border-color: var(--warm-primary);
  color: var(--warm-primary-deep);
}

.ctrl-round.danger {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #e07266, #cf564a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(207, 86, 74, 0.34);
}

.ctrl-txt { font-size: 11.5px; }

/* 通话记录上拉抽屉 */
.transcript-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  z-index: 20;
  background: #fffaf4;
  border-top: 1px solid var(--card-border);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 32px rgba(92, 56, 28, 0.14);
  display: flex;
  flex-direction: column;
}

.sheet-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tr-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fdf5ec;
  border: 1px solid var(--card-border);
  font-size: 13px;
}

.tr-role {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warm-primary-deep);
  margin-bottom: 3px;
}

/* ==================== 设置弹窗 ==================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(45, 33, 26, 0.42);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-card {
  width: 100%;
  max-height: 86%;
  background: #fffbf6;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(92, 56, 28, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-head h2 { font-size: 15.5px; font-weight: 700; }
.modal-head p { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

.modal-tabs {
  display: flex;
  padding: 0 16px;
  gap: 4px;
  background: #faf1e6;
  border-bottom: 1px solid var(--card-border);
}

.tab-btn {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--warm-primary-deep);
  border-bottom-color: var(--warm-primary);
  font-weight: 600;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.fish-guide-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fdf2e6;
  border: 1px solid rgba(217, 119, 66, 0.28);
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 14px;
}

.field {
  margin-bottom: 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--card-border);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--warm-primary);
}

.field input[type="range"] {
  accent-color: var(--warm-primary);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
}

.sw-title { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.sw-desc { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.switch-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--warm-primary);
  flex-shrink: 0;
}

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-ghost {
  padding: 8px 14px;
  border-radius: 10px;
  background: #f2e5d7;
  color: var(--text-body);
  font-size: 13px;
}

.btn-warm {
  padding: 8px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e58e52, #d97742);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* Toast */
.toast {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(45, 33, 26, 0.88);
  color: #fff9f2;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(45, 33, 26, 0.25);
}
