/* 返回顶部按钮样式 */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #d4af37, #c0c0c0);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  font-size: 24px;
  font-weight: bold;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: linear-gradient(135deg, #c0c0c0, #d4af37);
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

#back-to-top:active {
  transform: translateY(-2px) scale(0.95);
}

/* 桌面端优化 */
@media (min-width: 1280px) {
  #back-to-top {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
}

/* 平板端 */
@media (max-width: 1279px) and (min-width: 768px) {
  #back-to-top {
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

/* 移动端 - 大屏 */
@media (max-width: 767px) {
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* 移动端 - 小屏 */
@media (max-width: 480px) {
  #back-to-top {
    bottom: 80px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* 避免遮挡重要内容 - 与模态框配合 */
#back-to-top.hidden {
  display: none !important;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  #back-to-top {
    width: 55px;
    height: 55px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  #back-to-top {
    background: linear-gradient(135deg, #d4af37, #c0c0c0);
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  #back-to-top {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  #back-to-top,
  #back-to-top:hover,
  #back-to-top:active {
    transition: opacity 0.3s ease;
    transform: none !important;
  }
}

/* 打印时隐藏 */
@media print {
  #back-to-top {
    display: none !important;
  }
}
