/* ===== AI聚变堆 — Fusion PK 主题样式 ===== */

:root {
  --fusion-accent: #ffd700;
  --fusion-glow: rgba(255, 215, 0, 0.4);
  --fusion-fast: #22c55e;
  --fusion-deepseek: #3b82f6;
  --fusion-tongyi: #a78bfa;
}

/* ---- 背景 ---- */
.fusion-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.06), transparent 60%),
              linear-gradient(180deg, #0a0e1a 0%, #0f172a 50%, #181c2b 100%);
}

/* ---- 主容器 ---- */
.fusion-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 48px;
}

/* ---- Hero ---- */
.fusion-hero {
  text-align: center;
  margin-bottom: 32px;
}
.fusion-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}
.fusion-title-icon {
  display: inline-block;
  animation: fusionPulse 1.8s ease-in-out infinite;
}
@keyframes fusionPulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--fusion-glow)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.8)); }
}
.fusion-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0;
}

/* ---- 输入卡片 ---- */
.fusion-input-section {
  margin-bottom: 36px;
}
.fusion-input-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
}

/* ---- 模型选择行 ---- */
.fusion-model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.fusion-model-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.88rem;
  color: #cbd5f5;
  transition: all 0.2s ease;
  user-select: none;
}
.fusion-model-check:hover {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(30, 41, 59, 0.95);
}
.fusion-model-check input[type="checkbox"] {
  accent-color: var(--fusion-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.fusion-model-check:has(input:checked) {
  border-color: var(--fusion-accent);
  background: rgba(255, 215, 0, 0.08);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

/* ---- 输入行 ---- */
.fusion-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.fusion-textarea {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  max-height: 200px;
  transition: border-color 0.2s;
}
.fusion-textarea:focus {
  outline: none;
  border-color: var(--fusion-accent);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}
.fusion-textarea::placeholder {
  color: #64748b;
}

/* ---- 发送按钮 ---- */
.fusion-send-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 28px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 100px;
}
.fusion-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}
.fusion-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.fusion-send-btn.loading {
  background: linear-gradient(135deg, #64748b, #475569);
  animation: fusionLoadingPulse 0.8s ease-in-out infinite;
}
@keyframes fusionLoadingPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.fusion-send-icon {
  font-size: 1.2rem;
}

/* ---- 状态 ---- */
.fusion-status {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #94a3b8;
  min-height: 20px;
}

/* ---- 结果区 ---- */
.fusion-results-section {
  margin-top: 8px;
}
.fusion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) {
  .fusion-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .fusion-grid { grid-template-columns: 1fr; }
}

/* ---- PK 结果卡片 ---- */
.fusion-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.fusion-card.winner {
  border-color: var(--fusion-accent);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), 0 0 40px rgba(255, 215, 0, 0.06);
}
.fusion-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.fusion-card-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.fusion-card-model {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex: 1;
}
.fusion-card-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.fusion-card-badge.duration {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}
.fusion-card-badge.fastest {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  animation: fastestGlow 1.5s ease-in-out infinite;
}
@keyframes fastestGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 14px rgba(34, 197, 94, 0.6); }
}
.fusion-card-body {
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #cbd5f5;
}

/* ---- 加载态骨架屏 ---- */
.fusion-card-skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fusion-skel-bar {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(148,163,184,0.1), rgba(148,163,184,0.2), rgba(148,163,184,0.1));
  background-size: 200% 100%;
  animation: skelShimmer 1.6s ease-in-out infinite;
}
.fusion-skel-bar.short { width: 60%; }
.fusion-skel-bar.mid { width: 85%; }
.fusion-skel-bar.long { width: 100%; }
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- 加载脉冲 ---- */
.fusion-card.loading .fusion-card-header {
  border-bottom-color: rgba(255, 215, 0, 0.2);
}
.fusion-card.loading .fusion-card-icon {
  animation: fusionPulse 0.9s ease-in-out infinite;
}

/* ---- 完成动画 ---- */
.fusion-card.done {
  animation: cardReveal 0.4s ease-out both;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 错误卡片 ---- */
.fusion-card.error .fusion-card-header {
  border-bottom-color: rgba(239, 68, 68, 0.3);
}
.fusion-card-error {
  color: #f87171;
  font-size: 0.85rem;
  padding: 8px 0;
}

/* ---- Markdown 内容 ---- */
.fusion-card-body pre {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.fusion-card-body code {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
}
.fusion-card-body p code {
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
.fusion-card-body h1, .fusion-card-body h2, .fusion-card-body h3 {
  color: #f1f5f9;
  margin-top: 1em;
}
.fusion-card-body ol, .fusion-card-body ul {
  padding-left: 1.5em;
}

/* ---- 导出区 ---- */
.fusion-export-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}
.fusion-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.fusion-export-btn:hover {
  border-color: rgba(148, 163, 184, 0.6);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.8);
}

/* ---- 空状态 ---- */
.fusion-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}
.fusion-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}
.fusion-empty p {
  font-size: 0.95rem;
  margin: 0;
}
