.custom-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #ffffff;
  border-top: 1px solid #e5e5e5;
  padding-bottom: 20px;

  .tabbar-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 60px;
    position: relative;

    .tabbar-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex: 1;
      padding: 8px 0;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;

      // 普通图标容器
      .normal-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;

        .icon-text {
          font-size: 24px;
          transition: all 0.3s ease;

          &.selected {
            transform: scale(1.1);
          }
        }

        &:active {
          transform: scale(0.95);
        }
      }

      // 特殊图标容器（AI按钮）
      .special-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
        position: relative;

        .ai-circle {
          width: 56px;
          height: 56px;
          background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
          position: relative;
          top: -20px; // 向上突出
          transition: all 0.3s ease;

          // 外圈光晕效果
          &::before {
            content: '';
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;
            background: linear-gradient(135deg, rgba(255, 140, 66, 0.3) 0%, rgba(255, 107, 53, 0.3) 100%);
            border-radius: 50%;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s ease;
          }

          .ai-text {
            color: #ffffff;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
          }

          &:active {
            transform: scale(0.95);
            box-shadow: 0 2px 8px rgba(255, 107, 53, 0.6);
          }
        }
      }

      // 文字样式
      .tabbar-text {
        font-size: 12px;
        color: #8a8a8a;
        transition: color 0.3s ease;
        text-align: center;
        line-height: 1.2;

        &.selected {
          color: #d81e06;
          font-weight: 500;
        }

        &.special-text {
          color: #ff6b35;
          font-weight: 500;
          margin-top: -16px; // 调整特殊按钮文字位置
        }
      }

      // 选中状态
      &.selected {
        .normal-icon {
          transform: translateY(-2px);
        }
      }

      // 特殊项目样式
      &.special-item {
        .special-icon .ai-circle {
          &::before {
            opacity: 1;
          }
        }

        &.selected {
          .special-icon .ai-circle {
            background: linear-gradient(135deg, #ff6b35 0%, #ff4500 100%);
            box-shadow: 0 6px 16px rgba(255, 69, 0, 0.5);

            &::before {
              background: linear-gradient(135deg, rgba(255, 107, 53, 0.5) 0%, rgba(255, 69, 0, 0.5) 100%);
            }
          }
        }
      }

      // 点击效果
      &:active {
        .tabbar-text {
          transform: scale(0.95);
        }
      }
    }
  }
}

// PC端适配
@media screen and (min-width: 768px) {
  .custom-tabbar {
    max-width: 414px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 12px 12px;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
  }
}

// 暗色主题支持
@media (prefers-color-scheme: dark) {
  .custom-tabbar {
    background-color: #1a1a1a;
    border-top-color: #333;

    .tabbar-container .tabbar-item {
      .tabbar-text {
        color: #999;

        &.selected {
          color: #d81e06;
        }

        &.special-text {
          color: #ff6b35;
        }
      }
    }
  }
}

// 动画效果
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(-2px);
  }
}

// 选中时的弹跳效果
.custom-tabbar .tabbar-container .tabbar-item.selected .normal-icon {
  animation: bounce 0.6s ease;
}

// AI按钮的脉冲效果
@keyframes pulse {
  0% {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6);
  }
  100% {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  }
}

.custom-tabbar .tabbar-container .tabbar-item.special-item.selected .special-icon .ai-circle {
  animation: pulse 2s infinite;
}
