/* SSA 課程 AI 助教樣式表 (chat.css) */

/* 浮動 AI 助教按鈕 */
.ssa-ai-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 10px 18px 10px 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ssa-ai-chat-trigger:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45), 0 3px 8px rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.ssa-ai-chat-trigger:active {
  transform: translateY(0) scale(0.98);
}

.ssa-ai-chat-trigger.hidden,
body.ai-sidebar-open .ssa-ai-chat-trigger,
body:has(#aiSidebar:not(.collapsed)) .ssa-ai-chat-trigger {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.ssa-ai-trigger-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
}

.ssa-ai-trigger-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.8);
}

.ssa-ai-trigger-dot.offline {
  background: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.8);
}

/* 頂部導航列 AI 按鈕 */
.ai-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-header-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* AI 對話側邊欄 (垂直整列右 panel) 及相容視窗本體 */
aside.sidebar-right {
  width: var(--ai-sidebar-width, 380px);
  background: var(--card-bg, #ffffff);
  border-left: 1px solid var(--border, #e2e8f0);
  border-right: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  height: 100%;
  position: relative;
}

aside.sidebar-right.collapsed {
  margin-right: calc(-1 * var(--ai-sidebar-width, 380px));
  pointer-events: none;
}

/* AI 側邊欄拖曳調節中線 (Resizable Divider Handle) */
.ai-sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 10px;
  cursor: col-resize;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  user-select: none;
  touch-action: none;
  outline: none;
}

/* 垂直高亮分割線 */
.ai-sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* 中間拖曳手把圓角膠囊 (Center Grip Pill) */
.ai-sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  border-radius: 2px;
  background: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, height 0.15s ease;
}

/* 懸浮與聚焦狀態 */
.ai-sidebar-resizer:hover::before,
.ai-sidebar-resizer:focus-visible::before,
.ai-sidebar-resizer.is-dragging::before {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.45);
}

.ai-sidebar-resizer:hover::after,
.ai-sidebar-resizer:focus-visible::after,
.ai-sidebar-resizer.is-dragging::after {
  opacity: 1;
  background: #2563eb;
  height: 44px;
}

.ai-sidebar-resizer:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* 拖曳中全域模式：禁止選字、鎖定鼠標、保護影片/iframe 事件不丟失 */
body.resizing-ai-sidebar {
  cursor: col-resize !important;
  user-select: none !important;
}

body.resizing-ai-sidebar * {
  user-select: none !important;
  cursor: col-resize !important;
}

body.resizing-ai-sidebar aside.sidebar-right {
  transition: none !important;
}

body.resizing-ai-sidebar iframe,
body.resizing-ai-sidebar video {
  pointer-events: none !important;
}

/* 收起側邊欄時完全隱藏調節手把 */
aside.sidebar-right.collapsed .ai-sidebar-resizer {
  display: none !important;
  pointer-events: none !important;
}

.ai-top-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-top-title-group .sidebar-heading {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-header-btn.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ssa-ai-chat-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ssa-ai-chat-panel.collapsed {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
}

/* 面板頂部 Header */
.ssa-ai-chat-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ssa-ai-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ssa-ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.ssa-ai-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ssa-ai-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.ssa-ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ssa-ai-status-badge.offline {
  color: #b45309;
}

.ssa-ai-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.7);
}

.ssa-ai-status-indicator.offline {
  background: #f59e0b;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.7);
}

.ssa-ai-header-actions,
.sidebar-top-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ssa-ai-icon-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.ssa-ai-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* AI 助教分頁導航列 (Figure 2: 本章重點 / 文字筆記 / 問問題) */
.ai-tabs-nav {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 4px;
}

.ai-tab-btn {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.ai-tab-btn:hover {
  color: #1e293b;
}

.ai-tab-btn.active {
  color: #2563eb;
  font-weight: 700;
  border-bottom-color: #2563eb;
}

.ai-tab-panel {
  flex: 1;
  display: none;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.ai-tab-panel.active {
  display: flex;
  flex-direction: column;
}

.ai-tab-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}

.ai-tab-scroll::-webkit-scrollbar {
  width: 5px;
}

.ai-tab-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* 本章重點：章節目錄列表 */
.video-chapters-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: none;
  margin-bottom: 8px;
}

.chapters-header {
  display: none;
}

.chapters-scroll {
  flex: 1;
  padding: 4px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.chapter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
  color: #334155;
}

.chapter-btn:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.chapter-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chapter-play-icon {
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chapter-btn:hover .chapter-play-icon,
.chapter-btn.active .chapter-play-icon {
  color: #2563eb;
}

.chapter-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.chapter-btn:hover .chapter-time-badge,
.chapter-btn.active .chapter-time-badge {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chapter-text-wrap {
  flex: 1;
  min-width: 0;
}

.chapter-title-text {
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-btn.active .chapter-title-text {
  color: #1d4ed8;
  font-weight: 600;
}

.chapter-playing-pill {
  display: none;
  font-size: 10px;
  font-weight: 600;
  color: #2563eb;
  background: #dbeafe;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 3px;
  width: fit-content;
}

.chapter-btn.active .chapter-playing-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chapters-empty {
  padding: 20px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

/* 本章重點：暖心金句卡片 (Figure 2 質感杏暖插畫卡片) */
.ai-quote-card {
  margin: 10px 16px 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fdf6ec 0%, #faecd8 100%);
  border: 1px solid #fed7aa;
  border-radius: 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.ai-quote-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ai-quote-illustration {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-quote-svg {
  display: block;
  filter: drop-shadow(0 2px 6px rgba(120, 53, 15, 0.12));
}

.ai-quote-text-wrap {
  flex: 1;
  min-width: 0;
}

.ai-quote-text {
  font-family: "Kaiti TC", "STKaiti", "Noto Serif TC", "Songti TC", serif, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.ai-quote-text .quote-line-1 {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
  line-height: 1.35;
  word-break: break-word;
}

.ai-quote-text .quote-line-2 {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin-top: 3px;
  line-height: 1.35;
  word-break: break-word;
}

/* 本章重點：延伸影片推薦卡片 */
.ai-related-clips-wrap {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-related-clip-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 13px;
  transition: all 0.15s ease;
}

.ai-related-clip-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.clip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.clip-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.clip-card-time {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  font-variant-numeric: tabular-nums;
}

.clip-card-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 8px;
}

.clip-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clip-jump-btn:hover {
  background: #059669;
}

.clip-jump-btn:active {
  transform: scale(0.97);
}

/* 文字筆記列表 */
.notes-cues-list {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-cue-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.note-cue-item:hover {
  background: #f1f5f9;
}

.note-cue-time {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.note-cue-time:hover {
  background: #2563eb;
  color: #ffffff;
}

.note-cue-text {
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
  flex: 1;
}

.notes-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

/* 訊息列表滾動區 */
.ssa-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.ssa-ai-messages::-webkit-scrollbar {
  width: 5px;
}

.ssa-ai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* 單條訊息容器 */
.ssa-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: ssaFadeIn 0.25s ease-out;
}

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

.ssa-ai-msg.user {
  align-self: flex-end;
}

.ssa-ai-msg.assistant {
  align-self: flex-start;
}

/* 訊息氣泡 */
.ssa-ai-bubble {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.ssa-ai-msg.user .ssa-ai-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ssa-ai-msg.assistant .ssa-ai-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ssa-ai-bubble p {
  margin-bottom: 8px;
}

.ssa-ai-bubble p:last-child {
  margin-bottom: 0;
}

.ssa-ai-bubble h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 10px 0 6px 0;
  color: #0f172a;
}

.ssa-ai-bubble h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 4px 0;
  color: #1e293b;
}

.ssa-ai-bubble hr.ssa-ai-hr {
  border: none;
  border-top: 1px dashed #cbd5e1;
  margin: 12px 0;
}

.ssa-ai-bubble blockquote {
  border-left: 3px solid #94a3b8;
  padding-left: 10px;
  margin: 8px 0;
  color: #475569;
  font-style: italic;
}

.ssa-ai-bubble code {
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: #0f172a;
  font-family: ui-monospace, monospace;
}

.ssa-ai-bubble ul, .ssa-ai-bubble ol {
  padding-left: 18px;
  margin: 6px 0;
}

.ssa-ai-bubble li {
  margin-bottom: 4px;
}

.ssa-ai-bubble strong {
  font-weight: 700;
  color: #0f172a;
}

.ssa-ai-msg.user .ssa-ai-bubble strong {
  color: #ffffff;
}

/* 影片跳轉卡片 (Video Jump Card) */
.ssa-video-jump-card {
  margin-top: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.ssa-video-jump-card:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.ssa-jump-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ssa-jump-lesson-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ssa-jump-time-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #15803d;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ssa-jump-desc {
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
}

.ssa-jump-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 2px;
}

.ssa-jump-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.ssa-jump-btn:active {
  transform: translateY(0);
}

/* 快速提問標籤群 (Prompt chips) */
.ssa-ai-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.ssa-ai-prompt-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
}

.ssa-ai-prompt-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateX(2px);
}

/* 正在輸入動畫 (Typing indicator) */
.ssa-ai-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}

.ssa-ai-typing-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: ssaTypingBounce 1.4s infinite ease-in-out both;
}

.ssa-ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ssa-ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ssaTypingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 輸入區塊 (Input Area - Figure 2 style) */
.ssa-ai-input-area {
  padding: 10px 16px 12px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.ssa-ai-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 3px 6px 3px 14px;
  transition: all 0.2s ease;
}

.ssa-ai-input-row:focus-within {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ssa-ai-textarea {
  flex: 1;
  min-height: 34px;
  max-height: 80px;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  color: #0f172a;
  line-height: 1.4;
}

.ssa-ai-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ssa-ai-send-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: scale(1.05);
}

.ssa-ai-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.ssa-ai-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.6;
}

.ssa-ai-input-hint {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.ssa-cli-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #059669;
  font-weight: 500;
}

.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* 提示通知 Toast */
.ssa-jump-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #0f172a;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ssa-jump-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 響應式調整 */
@media (max-width: 900px) {
  .ai-sidebar-resizer {
    display: none !important;
    pointer-events: none !important;
  }
  aside.sidebar-right {
    position: absolute;
    top: var(--header-height, 60px);
    bottom: 0;
    right: 0;
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.14);
    z-index: 30;
    width: min(calc(100vw - 20px), 380px) !important;
    max-width: calc(100vw - 20px);
  }
  aside.sidebar-right.collapsed {
    margin-right: calc(-1 * min(calc(100vw - 20px), 380px) - 20px) !important;
  }
}

@media (max-width: 640px) {
  .ssa-ai-chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 85vh;
    max-width: 100vw;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
  }
  
  .ssa-ai-chat-trigger {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    font-size: 13px;
  }
}
