/**
 * Logo 组件样式 - Colink 多智能体协作平台
 * 六边形网络设计，亮点流动动效代表任务流转
 */

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--bg-sidebar) 100%);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

/* 背景装饰 */
.logo-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 30%,
    var(--color-primary-opacity-10) 0%,
    transparent 50%
  );
  pointer-events: none;
}

/* 图标容器 */
.logo-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Logo SVG */
.logo-svg {
  width: 28px;
  height: 28px;
}

/* 文字区域 */
.logo-text {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* 主标题 */
.logo-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* 副标题 */
.logo-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* 收缩模式 */
.logo-collapsed {
  padding: 16px 0;
  justify-content: center;
}

.logo-collapsed .logo-icon-wrapper {
  margin: 0 auto;
}

/* 收缩/展开按钮 */
.logo-collapse-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  z-index: 10;
}

.logo-collapse-btn:hover {
  background: var(--color-primary-opacity-10);
  color: var(--color-primary);
}

.logo-collapsed .logo-collapse-btn {
  right: 50%;
  transform: translate(50%, -50%);
}

/* ============================================
   基础样式
   ============================================ */

.logo-node {
  /* 节点静态样式 */
}

/* ============================================
   亮点流动动效 - 任务流转（单个亮点循环）
   ============================================ */

/* 流动的亮点 */
.flow-dot {
  fill: #10b981;
  filter: drop-shadow(0 0 2px #10b981);
  opacity: 0;
}

/* 单个亮点依次经过6条路径 */
.flow-dot {
  animation: flowAround 6s ease-in-out infinite;
}

@keyframes flowAround {
  /* 起点: 中心 → 顶部 */
  0% { opacity: 1; cx: 16; cy: 16; r: 2; }
  5% { opacity: 1; cx: 16; cy: 3; r: 1.5; }

  /* 路径1: 顶部 → 中心 */
  8% { opacity: 1; cx: 16; cy: 3; r: 1.5; }
  13% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 路径2: 中心 → 右上 */
  16% { opacity: 1; cx: 16; cy: 16; r: 2; }
  21% { opacity: 1; cx: 27; cy: 9; r: 1.5; }

  /* 路径3: 右上 → 中心 */
  24% { opacity: 1; cx: 27; cy: 9; r: 1.5; }
  29% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 路径4: 中心 → 右下 */
  32% { opacity: 1; cx: 16; cy: 16; r: 2; }
  37% { opacity: 1; cx: 27; cy: 23; r: 1.5; }

  /* 路径5: 右下 → 中心 */
  40% { opacity: 1; cx: 27; cy: 23; r: 1.5; }
  45% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 路径6: 中心 → 底部 */
  48% { opacity: 1; cx: 16; cy: 16; r: 2; }
  53% { opacity: 1; cx: 16; cy: 29; r: 1.5; }

  /* 路径7: 底部 → 中心 */
  56% { opacity: 1; cx: 16; cy: 29; r: 1.5; }
  61% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 路径8: 中心 → 左下 */
  64% { opacity: 1; cx: 16; cy: 16; r: 2; }
  69% { opacity: 1; cx: 5; cy: 23; r: 1.5; }

  /* 路径9: 左下 → 中心 */
  72% { opacity: 1; cx: 5; cy: 23; r: 1.5; }
  77% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 路径10: 中心 → 左上 */
  80% { opacity: 1; cx: 16; cy: 16; r: 2; }
  85% { opacity: 1; cx: 5; cy: 9; r: 1.5; }

  /* 终点: 左上 → 中心 */
  88% { opacity: 1; cx: 5; cy: 9; r: 1.5; }
  93% { opacity: 1; cx: 16; cy: 16; r: 2; }

  /* 平滑淡出 */
  96% { opacity: 1; cx: 16; cy: 16; r: 2; }
  100% { opacity: 0; cx: 16; cy: 16; r: 2; }
}

/* ============================================
   悬停效果 - 流动加快
   ============================================ */

.logo-container:hover .logo-icon-wrapper {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3),
              0 0 30px rgba(59, 130, 246, 0.2);
}

.logo-container:hover .flow-dot {
  animation-duration: 4s;
}

/* ============================================
   尺寸变体
   ============================================ */

.logo-small {
  padding: 10px 16px;
  gap: 10px;
}

.logo-small .logo-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.logo-small .logo-svg {
  width: 24px;
  height: 24px;
}

.logo-small .logo-title {
  font-size: 16px;
}

.logo-small .logo-subtitle {
  font-size: 9px;
}

.logo-large {
  padding: 20px 24px;
  gap: 16px;
}

.logo-large .logo-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.logo-large .logo-svg {
  width: 36px;
  height: 36px;
}

.logo-large .logo-title {
  font-size: 24px;
}

.logo-large .logo-subtitle {
  font-size: 12px;
}

/* ============================================
   深色主题适配
   ============================================ */

[data-theme='dark'] .logo-container {
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--bg-container) 100%);
}

[data-theme='dark'] .logo-icon-wrapper {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .logo-title {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme='dark'] .logo-container:hover .logo-icon-wrapper {
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.25),
              0 0 40px rgba(59, 130, 246, 0.15);
}

[data-theme='dark'] .flow-dot {
  fill: var(--color-primary-hover);
  filter: drop-shadow(0 0 3px var(--color-primary-hover));
}