/**
 * 主题切换按钮样式
 * 太阳/月亮图标
 */

.theme-toggle {
  width: 44px;
  height: 44px;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: #fa8c32;
}

/* 图标容器 */
.theme-toggle .icon-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
}

/* 太阳图标 - 默认显示 */
.theme-toggle .sun-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  color: #fa8c32;
  opacity: 1;
  transform: rotate(0deg) scale(1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 月亮图标 - 默认隐藏 */
.theme-toggle .moon-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  color: #60a5fa;
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式下的图标切换 */
html[data-theme="dark"] .theme-toggle {
  background: rgba(55, 65, 81, 0.8);
  border-color: rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(75, 85, 99, 0.9);
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}

html[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 响应式 */
@media (max-width: 768px) {
  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .theme-toggle .icon-wrapper {
    width: 22px;
    height: 22px;
  }

  .theme-toggle .sun-icon,
  .theme-toggle .moon-icon {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 480px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .theme-toggle .icon-wrapper {
    width: 20px;
    height: 20px;
  }

  .theme-toggle .sun-icon,
  .theme-toggle .moon-icon {
    width: 20px;
    height: 20px;
  }
}
