/* ──── Light theme (default) ──── */
:root,
[data-theme="light"] {
  --bg: #e9eef5;
  --bg-gradient: radial-gradient(circle at 20% -10%, #f7f9fc 0%, #e8edf4 40%, #dde6f0 100%);
  --panel: #ffffff;
  --panel-muted: #f4f7fb;
  --sidebar: #12233a;
  --sidebar-soft: #1b3353;
  --sidebar-text: #d8e3f1;
  --sidebar-brand-bg: rgba(255, 255, 255, 0.08);
  --sidebar-brand-border: rgba(255, 255, 255, 0.14);
  --sidebar-tab-bg: rgba(255, 255, 255, 0.08);
  --sidebar-tab-active-bg: rgba(31, 134, 255, 0.24);
  --sidebar-tab-active-border: rgba(31, 134, 255, 0.7);
  --accent: #1f86ff;
  --accent-soft: rgba(31, 134, 255, 0.14);
  --text: #152235;
  --text-secondary: #0f2036;
  --muted: #6f7f96;
  --recording: #eb4d4b;
  --speaking: #22b573;
  --processing: #f5a623;
  --border: #d7e1ee;
  --chat-header-bg: #fbfdff;
  --status-bg: #eef3fa;
  --status-border: #d9e3ef;
  --msg-user-bg: #dfeefe;
  --msg-user-border: #c9e2fc;
  --msg-bot-bg: #ffffff;
  --msg-bot-border: #d9e3ef;
  --msg-reading-bg: #eef6ff;
  --msg-reading-border: #a7ceff;
  --msg-action-bg: #f7faff;
  --msg-action-border: #cfdbec;
  --msg-action-color: #6a7b93;
  --input-bg: #fff;
  --input-border: #cfdbec;
  --input-focus-border: #92bdf1;
  --drag-bar: #c9d4e2;
  --drag-bar-active: #93b9ea;
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;
  --inline-code-bg: rgba(0,0,0,0.06);
  --table-th-bg: #f5f5f5;
  --table-border: #ddd;
  --blockquote-border: #ccc;
  --blockquote-color: #666;
  --toast-bg: rgba(12, 25, 43, 0.84);
  --copy-panel-bg: #1e1e3a;
  --copy-textarea-bg: #2a2a4a;
}

/* ──── Dark theme ──── */
[data-theme="dark"] {
  --bg: #0c1220;
  --bg-gradient: radial-gradient(circle at 20% -10%, #151e30 0%, #0f1826 40%, #0c1220 100%);
  --panel: #151e2e;
  --panel-muted: #1a2438;
  --sidebar: #0a1220;
  --sidebar-soft: #111c2e;
  --sidebar-text: #b0c0d6;
  --sidebar-brand-bg: rgba(255, 255, 255, 0.05);
  --sidebar-brand-border: rgba(255, 255, 255, 0.08);
  --sidebar-tab-bg: rgba(255, 255, 255, 0.05);
  --sidebar-tab-active-bg: rgba(31, 134, 255, 0.2);
  --sidebar-tab-active-border: rgba(31, 134, 255, 0.5);
  --accent: #3d9bff;
  --accent-soft: rgba(61, 155, 255, 0.12);
  --text: #d0dae8;
  --text-secondary: #e0e8f4;
  --muted: #6b7d96;
  --recording: #e05a52;
  --speaking: #2bbd7e;
  --processing: #e8a030;
  --border: #1e2e44;
  --chat-header-bg: #141d2c;
  --status-bg: #1a2538;
  --status-border: #243348;
  --msg-user-bg: #162640;
  --msg-user-border: #1e3456;
  --msg-bot-bg: #1a2438;
  --msg-bot-border: #243348;
  --msg-reading-bg: #132640;
  --msg-reading-border: #2b5a8e;
  --msg-action-bg: #1a2438;
  --msg-action-border: #2a3c54;
  --msg-action-color: #7a8fa6;
  --input-bg: #1a2438;
  --input-border: #2a3c54;
  --input-focus-border: #3d7abf;
  --drag-bar: #2a3c54;
  --drag-bar-active: #3d6ea0;
  --code-bg: #0d1520;
  --code-text: #c0ccde;
  --inline-code-bg: rgba(255,255,255,0.06);
  --table-th-bg: #1e2e44;
  --table-border: #2a3c54;
  --blockquote-border: #2a3c54;
  --blockquote-color: #7a8fa6;
  --toast-bg: rgba(6, 12, 22, 0.9);
  --copy-panel-bg: #141d2c;
  --copy-textarea-bg: #1a2438;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  font-family: "PingFang SC", "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-gradient);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "top-bar chat-main"
    "mic-area chat-main";
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}

#top-bar {
  grid-area: top-bar;
  background: linear-gradient(165deg, var(--sidebar) 0%, var(--sidebar-soft) 100%);
  border-radius: 20px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.brand-wrap {
  padding: 8px 12px;
  text-align: center;
}

#top-bar h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #f8fbff;
  margin: 0;
}

#top-bar h2 {
  display: none;
}

#bot-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 5px 8px 0 0;
  min-height: 0;
}

.bot-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--sidebar-tab-bg);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bot-tab .tab-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.bot-tab .tab-avatar-emoji {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 20px;
  flex-shrink: 0;
}

.bot-tab .tab-name {
  font-size: 13px;
  font-weight: 600;
}

.bot-tab.active {
  background: var(--sidebar-tab-active-bg);
  border-color: var(--sidebar-tab-active-border);
  color: #fff;
}

.bot-tab .badge {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  text-align: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--recording);
}

.bot-tab .badge.show { display: block; }

@keyframes tab-flash {
  0% { box-shadow: 0 0 0 0 rgba(31, 134, 255, 0.6); }
  50% { box-shadow: 0 0 14px 4px rgba(31, 134, 255, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(31, 134, 255, 0); }
}

.bot-tab.flash { animation: tab-flash 0.6s ease-out 2; }

#chat-main {
  grid-area: chat-main;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(15, 35, 58, 0.1);
}

#chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--chat-header-bg);
}

#chat-header-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chat-current-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.1;
}

#status {
  font-size: 11px;
  color: var(--muted);
  min-height: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--status-bg);
  border: 1px solid var(--status-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 560px);
}

#settings-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}

#settings-btn:hover {
  color: var(--text-secondary);
  border-color: var(--input-focus-border);
}

#focus-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 14px 0;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 11px;
}

#focus-banner.show { display: flex; }
#focus-banner.wakeword {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
#focus-banner.vad {
  background: rgba(34, 181, 115, 0.1);
  border-color: var(--speaking);
  color: var(--speaking);
}
#focus-banner-toggle {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 11px;
  cursor: pointer;
}

#chat-wrapper {
  flex: 1;
  min-height: 0;
  margin: 6px 12px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#drag-handle {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 2px 0 4px;
  cursor: grab;
  touch-action: none;
}

#drag-handle .bar {
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: var(--drag-bar);
}

#drag-handle:active .bar { background: var(--drag-bar-active); }

#transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.52;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.msg {
  position: relative;
  max-width: min(94%, 980px);
  margin-bottom: 10px;
  border-radius: 12px;
  padding: 8px 11px;
  word-break: break-word;
  transition: background 0.25s;
  -webkit-tap-highlight-color: transparent;
}

/* ── Page-load entrance animation ── */
@keyframes page-fly-in {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#top-bar {
  animation: page-fly-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s both;
}
#chat-main {
  animation: page-fly-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
}
#mic-area {
  animation: page-fly-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.25s both;
}

.msg.user {
  margin-left: auto;
  background: var(--msg-user-bg);
  border: 1px solid var(--msg-user-border);
  text-align: left;
}

.msg.assistant {
  background: var(--msg-bot-bg);
  border: 1px solid var(--msg-bot-border);
  padding-right: 68px;
}

.msg.assistant.reading {
  background: var(--msg-reading-bg);
  border-color: var(--msg-reading-border);
  box-shadow: inset 0 0 0 1px rgba(31, 134, 255, 0.45);
}

.msg .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  min-height: 14px;
}

.msg.user .meta { justify-content: flex-end; }

.msg .label {
  font-size: 11px;
  color: var(--muted);
}

.msg .msg-time {
  font-size: 11px;
  color: var(--muted);
}

.msg .msg-text {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  cursor: text;
  white-space: pre-wrap;
}

/* Markdown-rendered assistant messages: let block elements handle spacing */
.msg .msg-text.md-body {
  white-space: normal;
  word-break: break-word;
}
.md-body p { margin: 0.4em 0; }
.md-body p:first-child { margin-top: 0; }
.md-body p:last-child { margin-bottom: 0; }
.md-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.45;
  margin: 0.5em 0;
}
.md-body code {
  background: var(--inline-code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}
.md-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
.md-body ul, .md-body ol {
  margin: 0.4em 0;
  padding-left: 1.5em;
}
.md-body li { margin: 0.15em 0; }
.md-body blockquote {
  border-left: 3px solid var(--blockquote-border);
  margin: 0.4em 0;
  padding: 0.2em 0.8em;
  color: var(--blockquote-color);
}
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  margin: 0.5em 0 0.3em;
  line-height: 1.3;
}
.md-body h1 { font-size: 1.25em; }
.md-body h2 { font-size: 1.15em; }
.md-body h3 { font-size: 1.05em; }
.md-body table {
  border-collapse: collapse;
  margin: 0.4em 0;
  font-size: 0.9em;
}
.md-body th, .md-body td {
  border: 1px solid var(--table-border);
  padding: 4px 8px;
}
.md-body th { background: var(--table-th-bg); }
.md-body a { color: #1f86ff; text-decoration: underline; }
.md-body img { max-width: 100%; border-radius: 6px; }
.md-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.6em 0;
}

.msg.sending { opacity: 0.6; }
.msg.send-failed { opacity: 0.8; }
.msg-delivery { font-size: 10px; margin-left: 6px; }
.msg-delivery.sending { color: #888; }
.msg-delivery.sent { color: #6b8; }
.msg-delivery.delivered { color: #4a9; }
.msg-delivery.processing { color: #e8a; }
.msg-delivery.failed { color: #e55; }

.msg-actions {
  position: absolute;
  top: 7px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s;
}

.msg:hover .msg-actions,
.msg:focus-within .msg-actions,
.msg.assistant.reading .msg-actions { opacity: 1; }

.msg-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--msg-action-border);
  background: var(--msg-action-bg);
  color: var(--msg-action-color);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg-action-btn:active { transform: scale(0.96); }

.msg .play-btn.active {
  color: var(--speaking);
  border-color: rgba(34, 181, 115, 0.36);
  background: rgba(34, 181, 115, 0.08);
}

#text-reply-bar {
  display: none;
  flex-shrink: 0;
  margin: 6px 12px 0;
  gap: 8px;
  align-items: center;
}

#text-reply-bar.show { display: flex; }
#text-reply-bar.show { align-items: flex-end; }

#text-reply-input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  max-height: 120px;
  border-radius: 11px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
  box-sizing: border-box;
  transition: height 0.3s ease, min-height 0.3s ease, border-color 0.2s ease;
}

#text-reply-input:focus {
  border-color: var(--input-focus-border);
  height: 80px;
  min-height: 80px;
}

#text-reply-send {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

#text-reply-send:disabled { opacity: 0.5; cursor: not-allowed; }
#text-reply-send:active { opacity: 0.85; }

#mic-area {
  grid-area: mic-area;
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--sidebar-brand-border);
  background: linear-gradient(165deg, var(--sidebar) 0%, var(--sidebar-soft) 100%);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 210px;
  transition: opacity 0.25s ease;
  position: relative;
}

#voice-mode-switch {
  display: none !important;
}

.voice-mode-btn {
  display: none !important;
}

#hint {
  font-size: 11px;
  color: #b9c9dd;
  min-height: 14px;
  text-align: center;
}

#mic-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 0;
}

#mic-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #9ec7fa;
  background: linear-gradient(160deg, #1f86ff 0%, #3f9fff 100%);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

#mic-btn:active { transform: scale(0.97); }
#mic-btn.recording { border-color: var(--recording); }
#mic-btn.processing { border-color: var(--processing); }
#mic-btn.speaking { border-color: var(--speaking); animation: glow 1.2s infinite; }

#cancel-btn {
  display: none;
  position: absolute;
  right: 8px;
  top: 8px;
  transform: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--recording);
  color: #fff;
  cursor: pointer;
}

#ww-toggle {
  display: none;
  position: absolute;
  left: 8px;
  top: 8px;
  transform: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

#ww-toggle.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

#ww-toggle.show { display: inline-flex; align-items: center; justify-content: center; }
#cancel-btn.show { display: inline-flex; align-items: center; justify-content: center; }

#auto-read-toggle {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#auto-read-toggle.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
#auto-read-toggle.off {
  opacity: 0.5;
}

#car-cancel-btn {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--recording);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  z-index: 15;
}

#car-cancel-btn.show { display: flex; }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 181, 115, 0.26); }
  50% { box-shadow: 0 0 0 12px rgba(34, 181, 115, 0); }
}

/* Settings */
#settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 16, 28, 0.56);
  z-index: 100;
}

#settings-overlay.open {
  display: flex;
  justify-content: center;
  align-items: center;
}

#settings-panel {
  background: #1d2940;
  color: #edf4ff;
  border-radius: 16px;
  width: calc(100% - 32px);
  max-width: 420px;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  padding: 20px 16px;
  -webkit-overflow-scrolling: touch;
}

#settings-panel h3 {
  margin-bottom: 16px;
  font-size: 16px;
  text-align: center;
}

.voice-setting,
.setting-item {
  margin-bottom: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.voice-setting .bot-label,
.setting-item .bot-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.setting-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.setting-row .setting-label {
  font-size: 13px;
  color: #edf4ff;
  flex-shrink: 0;
}

.setting-row select {
  padding: 5px 24px 5px 8px;
  border-radius: 6px;
  background: #2a3b58;
  color: #edf4ff;
  border: 1px solid #435779;
  font-size: 12px;
  outline: none;
  max-width: 170px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a4bc' d='M3 5l3 3 3-3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.setting-row select:focus { border-color: #88b8f5; }

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: #4a5d7a;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle .slider:before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d9e4f3;
  transition: transform 0.2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider:before { transform: translateX(20px); background: #fff; }

.step-btn {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #4b6182;
  background: #2a3b58;
  color: #edf4ff;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
}

.step-btn:active { opacity: 0.7; }
.slider-fixed { width: 120px; }

#bot-settings-tabs .bot-settings-tab {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  background: #2a3b58;
  border: 1px solid #44597a;
  font-size: 13px;
  color: #b6c5d8;
  text-align: center;
  cursor: pointer;
}

#bot-settings-tabs .bot-settings-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.voice-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.voice-row select {
  flex: 1;
  min-width: 0;
  padding: 5px 24px 5px 8px;
  border-radius: 6px;
  background: #2a3b58;
  color: #edf4ff;
  border: 1px solid #44597a;
  font-size: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a4bc' d='M3 5l3 3 3-3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.voice-row select:focus { border-color: #88b8f5; }

.preview-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.preview-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.avatar-setting {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.avatar-setting .bot-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.avatar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #5a7090;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a3b58;
  font-size: 28px;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn,
.avatar-reset-btn,
.new-session-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

.avatar-upload-btn {
  background: var(--accent);
  color: #fff;
}

.avatar-reset-btn {
  background: #435675;
  color: #e6effd;
}

.new-session-btn {
  background: #bb3c31;
  color: #fff;
  white-space: nowrap;
}

.new-session-btn:active { opacity: 0.7; }

#close-settings {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #3e5372;
  color: #edf4ff;
  font-size: 14px;
  cursor: pointer;
}

/* Car Mode */
#car-bot-name { display: none; }
#car-carousel {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
  touch-action: pan-y;
}

.car-avatar-item {
  position: absolute;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.car-avatar-circle {
  border-radius: 50%;
  border: 4px solid #7e96b8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #cdd9e8;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.car-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.car-avatar-circle .emoji { line-height: 1; }

.car-avatar-item.active .car-avatar-circle {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(31, 134, 255, 0.32);
}

.car-avatar-item.active .car-avatar-circle.recording { border-color: var(--recording); }
.car-avatar-item.active .car-avatar-circle.processing { border-color: var(--processing); }
.car-avatar-item.active .car-avatar-circle.speaking { border-color: var(--speaking); animation: glow 1.2s infinite; }

#car-exit-btn {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #e7eef8;
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  z-index: 10;
}

#car-swipe-hint {
  display: none;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
}

body.car-mode {
  background: radial-gradient(circle at 30% -20%, var(--sidebar-soft) 0%, var(--sidebar) 60%, var(--bg) 100%);
}

body.car-mode #app-shell {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "chat-main"
    "mic-area";
  gap: 0;
  padding: 0;
}

body.car-mode #top-bar,
body.car-mode #focus-banner,
body.car-mode #chat-wrapper,
body.car-mode #text-reply-bar,
body.car-mode #voice-mode-switch { display: none !important; }

body.car-mode #chat-header {
  border: none;
  background: transparent;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 0 0;
}

body.car-mode #chat-current-name,
body.car-mode #settings-btn {
  display: none !important;
}

body.car-mode #chat-main {
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

body.car-mode #mic-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-top: none;
  background: transparent;
  margin-top: 0;
  gap: 20px;
  padding-bottom: max(80px, env(safe-area-inset-bottom));
}

body.car-mode #mic-wrapper {
  display: inline-flex;
  width: 220px;
  height: 220px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.car-mode #mic-btn {
  width: 140px;
  height: 140px;
  font-size: 52px;
  border-width: 4px;
}

/* 车载模式下的按钮容器 - 放在头像下方 */
body.car-mode #car-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

body.car-mode #ww-toggle,
body.car-mode #cancel-btn,
body.car-mode #auto-read-toggle {
  position: static;
  width: 48px;
  height: 48px;
  font-size: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

body.car-mode #ww-toggle:hover,
body.car-mode #cancel-btn:hover,
body.car-mode #auto-read-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

body.car-mode #ww-toggle.active {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent);
}

body.car-mode #auto-read-toggle.active {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent);
}

body.car-mode #auto-read-toggle.off {
  opacity: 0.5;
}

body.car-mode #car-cancel-btn { display: none !important; }

body.car-mode #car-bot-name {
  display: block;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  text-align: center;
  color: #f1f6ff;
}

body.car-mode #hint {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

body.car-mode #status {
  display: block !important;
  position: static;
  text-align: center;
  color: #dce9fb;
  font-size: 18px;
  min-height: 24px;
  background: transparent;
  border: none;
  padding: 0;
  max-width: none;
}

body.car-mode #car-carousel { display: none !important; }
body.car-mode #slide-reset { display: none !important; }
body.car-mode #car-exit-btn { display: block; }
body.car-mode #car-swipe-hint { display: block; }

/* Toast */
#toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

#toast.show { opacity: 1; }

#debug {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #0f0;
  font-size: 10px;
  padding: 4px 8px;
  max-height: 80px;
  overflow-y: auto;
  font-family: monospace;
  display: none;
  z-index: 200;
}

body.chat-expanded #top-bar h1,
body.chat-expanded #top-bar h2 { display: none; }

body.chat-expanded #app-shell {
  grid-template-columns: 68px minmax(0, 1fr);
}

@media (hover: hover) and (pointer: fine) {
  #transcript {
    -webkit-user-select: text;
    user-select: text;
  }
}

@media (hover: none) and (pointer: coarse) {
  .msg-actions {
    opacity: 1;
  }
}

/* Slide-to-reset session button */
.slide-reset-track {
  position: relative;
  align-self: center;
  width: 66%;
  height: 26px;
  border-radius: 13px;
  background: rgba(231,76,60,0.06);
  border: 1px solid rgba(231,76,60,0.15);
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  margin-top: 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.slide-reset-label {
  position: absolute;
  top: 0; left: 24px; right: 4px; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(231,76,60,0.4);
  pointer-events: none;
  transition: opacity 0.2s;
  letter-spacing: 0.5px;
}
.slide-reset-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(160deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: left 0.3s ease, background 0.2s;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(231,76,60,0.3);
}
.slide-reset-track:hover { opacity: 1; }
.slide-reset-thumb:active { cursor: grabbing; }
.slide-reset-thumb.dragging { transition: none; }
.slide-reset-track.triggered {
  background: rgba(46,204,113,0.08);
  border-color: rgba(46,204,113,0.2);
}
.slide-reset-track.triggered .slide-reset-thumb {
  background: linear-gradient(160deg, #2ecc71 0%, #27ae60 100%);
  box-shadow: 0 1px 4px rgba(46,204,113,0.3);
}
.slide-reset-track.triggered .slide-reset-label {
  opacity: 0;
}
/* Spinning state while waiting for reset confirmation */
.slide-reset-thumb.spinning {
  animation: spin-reset 0.8s linear infinite;
}
@keyframes spin-reset {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .slide-reset-track {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    margin-left: 0;
    width: 72px;
    height: 24px;
    border-radius: 12px;
  }
  .slide-reset-thumb {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  .slide-reset-label {
    font-size: 9px;
    left: 22px;
  }
  #app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top-bar"
      "chat-main"
      "mic-area";
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  }

  #top-bar {
    border-radius: 16px;
    padding: 10px;
    gap: 10px;
  }

  .brand-wrap {
    padding: 6px 10px;
  }

  #top-bar h1 {
    font-size: 16px;
    margin: 0;
  }

  #bot-tabs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 5px 2px 2px 0;
  }

  .bot-tab {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
  }

  .bot-tab .tab-name { font-size: 12px; }

  #chat-main {
    border-radius: 16px;
  }

  #chat-wrapper {
    margin: 6px 10px 0;
  }

  #focus-banner {
    margin: 4px 10px 0;
  }

  #text-reply-bar,
  #mic-area {
    margin-left: 10px;
    margin-right: 10px;
  }

  #mic-area {
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 4px 0 6px;
    border: none;
    background: transparent;
    border-radius: 0;
    position: relative;
  }

  #mic-wrapper {
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  #hint {
    display: none;
  }

  #mic-btn {
    width: 66px;
    height: 66px;
    font-size: 28px;
  }

  #cancel-btn {
    right: -36px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  #ww-toggle {
    left: -36px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  #auto-read-toggle {
    left: -70px;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  body.chat-expanded #app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "chat-main"
      "mic-area";
  }

  body.chat-expanded #top-bar {
    display: none;
  }
}

/* PWA standalone mode: ensure full viewport usage */
@media (display-mode: standalone) {
  html, body {
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    margin: 0;
    /* Prevent iOS overscroll from revealing white background */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }
  #app-shell {
    /* In standalone mode with viewport-fit=cover + black-translucent,
       the page extends behind the status bar. safe-area-inset-top
       handles the offset correctly. */
    min-height: 100%;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Splash Screen ── */
#splash-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b1120;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#splash-screen.active {
  display: flex;
}
#splash-screen.fade-out {
  animation: splash-fade-out 0.5s ease-in forwards;
}

#splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: splash-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

#splash-logo {
  position: relative;
  width: 160px;
  height: 120px;
}
#splash-logo .lobster {
  position: absolute;
  font-size: 52px;
  line-height: 1;
  display: block;
  /* Rotate 90° clockwise so lobster faces right horizontally */
  transform: rotate(90deg);
}
/* Top lobster — offset right */
#splash-logo .lobster:nth-child(1) {
  top: 0;
  left: 70px;
}
/* Middle lobster — offset left */
#splash-logo .lobster:nth-child(2) {
  top: 28px;
  left: 30px;
}
/* Bottom lobster — offset right */
#splash-logo .lobster:nth-child(3) {
  top: 56px;
  left: 74px;
}

#splash-title {
  font-size: 28px;
  font-weight: 700;
  color: #e8f0fe;
  letter-spacing: 1px;
  opacity: 0;
  animation: splash-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}

#splash-url {
  position: absolute;
  bottom: 28%;
  left: 0;
  right: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f5a623;
  letter-spacing: 0.5px;
  text-align: center;
  opacity: 0;
  animation: splash-rise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s both;
}

@keyframes splash-rise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes splash-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════════
   NETWORK STATUS INDICATOR
   ═══════════════════════════════════════════════════════════════ */

.network-status-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.network-status-indicator.show {
  transform: translateY(0);
}

.network-status-indicator.online {
  background: linear-gradient(135deg, #00f0ff 0%, #00d4ff 100%);
  color: #000;
}

.network-status-indicator.offline {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: #fff;
}

.network-status-indicator .status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.network-status-indicator .status-icon {
  font-size: 18px;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ═══════════════════════════════════════════════════════════════
   END: NETWORK STATUS INDICATOR
   ═══════════════════════════════════════════════════════════════ */

/* ──── 呼喊字效果（含蓄版） ──── */
.shout-char {
  display: inline-block;
  position: relative;
  font-size: 1.3em;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 25%, #48dbfb 50%, #ff9ff3 75%, #54a0ff 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.4));
  transition: all 0.4s ease;
}

/* 鼠标悬停时的微动效果 */
.shout-char:hover {
  animation: gentle-hover 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.6));
}

/* 温和的悬停动画 */
@keyframes gentle-hover {
  0%, 100% {
    background-position: 0% 50%;
    transform: scale(1);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1.05);
  }
}

/* 响应式：移动端调整 */
@media (max-width: 768px) {
  .shout-char {
    font-size: 1.25em;
  }
}

/* ──── 美化的 Tab 样式 ──── */

/* 设置面板大类Tab（系统设置/角色设置） */
.settings-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.settings-tab {
  position: relative;
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.settings-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31, 134, 255, 0.15), rgba(31, 134, 255, 0.05));
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 12px;
}

.settings-tab:hover {
  color: #fff;
  transform: translateY(-1px);
}

.settings-tab:hover::before {
  opacity: 1;
}

.settings-tab.active {
  background: linear-gradient(135deg, rgba(31, 134, 255, 0.3), rgba(31, 134, 255, 0.15));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(31, 134, 255, 0.3),
              0 0 20px rgba(31, 134, 255, 0.15);
}

.settings-tab.active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* 角色设置面板的Bot Tab */
#bot-settings-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  overflow-x: auto;
}

.bot-settings-tab {
  position: relative;
  flex-shrink: 0;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.bot-settings-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31, 134, 255, 0.12), rgba(31, 134, 255, 0.04));
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 12px;
}

.bot-settings-tab:hover {
  color: #fff;
  transform: translateY(-1px);
}

.bot-settings-tab:hover::before {
  opacity: 1;
}

.bot-settings-tab.active {
  background: linear-gradient(135deg, rgba(31, 134, 255, 0.25), rgba(31, 134, 255, 0.12));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(31, 134, 255, 0.25),
              0 0 20px rgba(31, 134, 255, 0.12);
}

.bot-settings-tab.active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* 移除旧的Tab样式 */
.bot-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.bot-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bot-tab.active {
  background: linear-gradient(135deg, rgba(31, 134, 255, 0.3), rgba(31, 134, 255, 0.15));
  border-color: rgba(31, 134, 255, 0.5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 134, 255, 0.3),
              0 0 20px rgba(31, 134, 255, 0.15);
}

/* Tab 激活时的闪光效果 */
@keyframes tab-glow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(31, 134, 255, 0.3),
                0 0 20px rgba(31, 134, 255, 0.15);
  }
  50% {
    box-shadow: 0 4px 20px rgba(31, 134, 255, 0.5),
                0 0 30px rgba(31, 134, 255, 0.25);
  }
}

.settings-tab.active,
.bot-settings-tab.active,
.bot-tab.active {
  animation: tab-glow 3s ease-in-out infinite;
}
}
