/* ========== AI 伴学 - 暗色主题 ========== */
/* 全局暗色背景 */
body.ai-companion-active {
  background: #0a0e1a !important;
}
.ai-companion {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #0a0e1a;
  color: #e8e8ff;
  height: 100vh;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
      flex-direction: column;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}
/* ===== 顶部导航 ===== */
.companion-header {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
      align-items: center;
  -ms-flex-pack: justify;
      justify-content: space-between;
  padding: 16px 32px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  -ms-flex-negative: 0;
      flex-shrink: 0;
  z-index: 10;
}
.companion-header .header-left {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
      align-items: center;
  gap: 16px;
  min-width: 200px;
}
.companion-header .header-center {
  -ms-flex: 1;
      flex: 1;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-pack: center;
      justify-content: center;
}
.companion-header .header-right {
  min-width: 120px;
  text-align: right;
}
.companion-header .back-btn {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(232, 232, 255, 0.65);
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.companion-header .back-btn:hover {
  border-color: #667eea;
  color: #e8e8ff;
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.25);
}
.companion-header .course-title {
  font-size: 18px;
  font-weight: 600;
  color: #e8e8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.companion-header .ai-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.35);
}
/* ===== 视图切换按钮 ===== */
.view-switcher {
  display: -ms-flexbox;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.view-switcher .view-btn {
  border: none;
  background: transparent;
  color: rgba(232, 232, 255, 0.65);
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: auto;
}
.view-switcher .view-btn:hover {
  color: #e8e8ff;
  background: rgba(255, 255, 255, 0.08);
}
.view-switcher .view-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.25);
}
.view-switcher .view-btn i {
  margin-right: 6px;
}
/* ===== 主体区域 ===== */
.companion-body {
  -ms-flex: 1;
      flex: 1;
  overflow: hidden;
  position: relative;
}
.companion-body .panel-wrapper {
  height: 100%;
  width: 100%;
}
/* ===== 毛玻璃卡片 ===== */
.ai-glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}
.ai-glass-card:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 24px rgba(102, 126, 234, 0.25);
}
/* ===== 渐变按钮 ===== */
.ai-btn-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.ai-btn-gradient:hover {
  background: linear-gradient(135deg, #7c93f5 0%, #8b5fbf 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4) !important;
}
/* ===== 滚动条美化 ===== */
.ai-companion ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.ai-companion ::-webkit-scrollbar-track {
  background: transparent;
}
.ai-companion ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.ai-companion ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
/* ===== 通用动画 ===== */
@keyframes aiFadeIn {
from {
    opacity: 0;
    transform: translateY(8px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}
@keyframes aiPulse {
0%,
  100% {
    opacity: 0.4;
}
50% {
    opacity: 1;
}
}
.ai-fade-in {
  animation: aiFadeIn 0.4s ease-out;
}
.ai-pulse {
  animation: aiPulse 2s ease-in-out infinite;
}

