/* ==================== AI 模型选择器公共组件样式 ==================== */

/* ---------- 折叠触发按钮 ---------- */
.ai-model-selector {
  position: relative;
}

.ai-model-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-model-trigger:hover {
  border-color: #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ai-model-trigger-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-model-trigger-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}
.ai-model-trigger-name-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-model-arrow {
  color: #9ca3af;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* ---------- 下拉面板 ---------- */
.ai-model-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  /* Keep the dropdown above page content, but below the fixed navigation (z-40). */
  z-index: 30;
  margin-top: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  animation: ai-model-fade-in 0.15s ease-out;
}
/* 展开时 top 由 JS 设置为触发按钮高度 + 8px（紧贴按钮，不受提示文字影响） */
@keyframes ai-model-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-model-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
  border-radius: 12px;
}

/* ---------- 选项行 ---------- */
.model-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.model-option:hover {
  background-color: #f8fafc;
}
.model-option.model-selected {
  background-color: #f0fdf4;
}
.model-option.model-selected .model-check {
  display: block;
}
.ai-model-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ai-model-option-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.ai-model-option-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 模型 logo ---------- */
.model-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.model-logo img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

/* ---------- 模型标签 ---------- */
.model-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  flex-shrink: 0;
}
.model-tag.tag-recommend {
  background-color: #fef3c7;
  color: #b45309;
}
.model-tag.tag-fast {
  background-color: #dcfce7;
  color: #15803d;
}
.model-tag.tag-deep {
  background-color: #ede9fe;
  color: #6d28d9;
}
.model-tag.tag-economy {
  background-color: #dbeafe;
  color: #1d4ed8;
}
.model-tag.tag-flagship {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}
.model-tag.tag-entry {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* ---------- 精度星级 ---------- */
.model-stars {
  color: #22c55e;
  letter-spacing: 1px;
  font-size: 12px;
}
.model-stars .star-empty {
  color: #e5e7eb;
}

/* ---------- 速度闪电 ---------- */
.model-bolt {
  color: #3b82f6;
  letter-spacing: 1px;
  font-size: 11px;
}
.model-bolt .bolt-empty {
  color: #e5e7eb;
  opacity: 1;
}

/* ---------- 选中对勾 ---------- */
.model-check {
  display: none !important;
  color: #22c55e;
  font-size: 16px;
  margin-left: 12px;
  flex-shrink: 0;
}
.model-option.model-selected .model-check {
  display: block !important;
}

/* ---------- Hover 详情卡片（fixed 定位相对于视口） ---------- */
.ai-model-tooltip {
  position: fixed;
  width: 240px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 14px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ai-model-tooltip.ai-model-tooltip-visible {
  display: block !important;
  opacity: 1;
  transform: translateX(0);
}
.ai-model-tooltip.ai-model-tooltip-left {
  transform: translateX(4px);
}
.ai-model-tooltip.ai-model-tooltip-left.ai-model-tooltip-visible {
  transform: translateX(0);
}
.ai-model-tooltip-arrow {
  position: absolute;
  top: 20px;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: translateY(-50%) rotate(45deg);
}
.ai-model-tooltip-arrow.ai-model-tooltip-arrow-right {
  left: -6px;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-right: none;
  border-top: none;
}
.ai-model-tooltip-arrow.ai-model-tooltip-arrow-left {
  right: -6px;
  border-right: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
  border-left: none;
  border-bottom: none;
}

.model-tooltip-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
}
.model-tooltip-desc {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.5;
}
.model-tooltip-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 10px 0;
}
.model-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
}
.model-tooltip-row .label {
  color: #6b7280;
}
.model-tooltip-row .value {
  color: #374151;
  font-weight: 500;
}
.model-tooltip-scenario {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.6;
  margin-top: 4px;
  background: #f9fafb;
  padding: 8px 10px;
  border-radius: 6px;
}

/* ---------- 底部提示文字 ---------- */
.ai-model-tip {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}
.ai-model-tip-icon {
  color: #fbbf24;
  flex-shrink: 0;
  line-height: 1;
}
.ai-model-tip-strong {
  color: #15803d;
  font-weight: 500;
}
