@layer utilities {
  .content-auto {
    content-visibility: auto;
  }

  .card-transition {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .btn-transition {
    transition: all 0.2s ease;
  }

  .img-zoom {
    transition: transform 0.4s ease;
  }

  .img-zoom:hover {
    transform: scale(1.08);
  }

  .text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(90deg, #ff4d4f, #f97316);
  }

  .bg-glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85);
  }

  .logo-glow {
    box-shadow: 0 0 20px rgba(255, 77, 79, 0.2), 0 0 40px rgba(255, 77, 79, 0.1);
  }

  .touch-friendly {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .scroll-smooth {
    scroll-behavior: smooth;
  }

  .btn-download {
    @apply py-2 px-4 text-sm rounded-lg btn-transition shadow-btn hover:shadow-btn-hover font-medium cursor-pointer;
  }

  .btn-copy {
    @apply w-12 h-12 rounded-lg btn-transition shadow-btn hover:shadow-btn-hover flex items-center justify-center text-base;
  }

  .page-btn {
    @apply px-4 py-2 rounded-lg btn-transition font-medium text-sm flex items-center justify-center;
  }

  .page-btn-primary {
    @apply bg-primary text-white shadow-btn hover:shadow-btn-hover hover:bg-primary/90;
  }

  .page-btn-default {
    @apply border border-neutral-200 bg-white text-neutral-700 hover:bg-neutral-50;
  }

  .page-num-btn {
    @apply w-10 h-10 rounded-lg flex items-center justify-center text-sm font-medium btn-transition;
  }

  .page-num-active {
    @apply bg-primary text-white shadow-page;
  }

  .page-num-inactive {
    @apply bg-white border border-neutral-200 text-neutral-700 hover:bg-neutral-50;
  }

  .search-highlight {
    @apply text-primary font-semibold;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  -webkit-user-drag: none;
  pointer-events: auto;
  display: block;
  max-width: 100%;
}

input,
select,
button {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  outline: none;
  border: none;
}

a,
button,
input,
select,
div[clickable] {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.popup-card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.popup-header {
  background: linear-gradient(135deg, #ff4d4f 0%, #3b82f6 100%);
  padding: 20px 24px;
  position: relative;
}

.popup-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  margin-right: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  font-weight: 500;
}

.netdisk-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.netdisk-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border-color: #d1d5db;
}

.netdisk-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #ff4d4f;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 4px;
  scrollbar-width: none;
}

.page-numbers::-webkit-scrollbar {
  display: none;
}

/* 美化游戏卡片 */
.game-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.game-card img {
  transition: transform 0.4s ease;
}

.game-card:hover img {
  transform: scale(1.05);
}

.game-card h3 {
  transition: color 0.2s ease;
}

.game-card:hover h3 {
  color: #ff4d4f;
}

/* 美化搜索框 */
.search-container {
  position: relative;
}

.search-container input:focus {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

/* 美化分页按钮 */
.page-btn {
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.page-num-btn {
  transition: all 0.2s ease;
}

.page-num-btn:hover:not(.page-num-active) {
  background-color: #f3f4f6;
  transform: translateY(-1px);
}

.page-num-active {
  background: linear-gradient(135deg, #ff4d4f, #f97316);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

/* 美化下载弹窗 */
.netdisk-card {
  transition: all 0.3s ease;
}

.netdisk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 添加加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* 美化页码输入框 */
#pageInput:focus {
  outline: none;
  border-color: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

/* 响应式优化 */
@media (max-width: 640px) {
  .pagination {
    flex-direction: column;
    gap: 1rem;
  }
  
  .page-numbers {
    justify-content: center;
  }
}

#popupContent {
  overscroll-behavior: contain;
}