/* ========================================
   PC首页最终美化优化 - 2026-08-02
   桌面端和移动端全面UI美化
   ======================================== */

/* 全局优化 */
body.pc-portal-home {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   1. 排行榜卡片动画和悬停效果优化
   ======================================== */
.rank_list {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.rank_list::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #4a90e2, #3498db);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.rank_list:hover::before {
  transform: scaleY(1);
}

.rank_list:hover {
  transform: translateX(8px) scale(1.01);
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.25);
  z-index: 2;
}

/* ========================================
   2. 前三名特殊动画效果
   ======================================== */
.rank-row.rank-1,
.rank-row.rank-2,
.rank-row.rank-3 {
  position: relative;
  overflow: hidden;
}

.rank-row.rank-1::after,
.rank-row.rank-2::after,
.rank-row.rank-3::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  animation: shine 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%, 100% { transform: translate(-25%, -25%) rotate(0deg); opacity: 0; }
  50% { transform: translate(25%, 25%) rotate(180deg); opacity: 1; }
}

.rank-row.rank-1 .rank_no,
.rank-row.rank-2 .rank_no,
.rank-row.rank-3 .rank_no {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.2); }
}

/* ========================================
   3. 头像优化 - 圆形悬停效果
   ======================================== */
.rank_detail_head img,
.rank-avatar-shell img {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.95) contrast(1.05);
}

.rank_list:hover .rank_detail_head img,
.rank_list:hover .rank-avatar-shell img {
  transform: scale(1.15) rotate(5deg);
  filter: brightness(1.05) contrast(1.1);
  box-shadow: 0 4px 16px rgba(74, 144, 226, 0.5);
}

/* ========================================
   4. 数据列数字美化 - 等宽字体
   ======================================== */
.rank_detail_kda {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.rank-kda-val {
  position: relative;
  font-weight: 700;
}

.rank-kda-val::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e74c3c, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rank_list:hover .rank-kda-val::after {
  opacity: 1;
}

/* ========================================
   5. 军衔徽章美化
   ======================================== */
.mr-badge {
  position: relative;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.rank_list:hover .mr-badge {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ========================================
   6. 移动端排序按钮优化
   ======================================== */
.rank-sort-chip {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-sort-chip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.rank-sort-chip:active::before {
  width: 200px;
  height: 200px;
}

.rank-sort-chip.active {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* ========================================
   7. 服务器卡片渐变背景优化
   ======================================== */
.server-card {
  position: relative;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.server-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.05), rgba(52, 152, 219, 0.05));
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.server-card:hover::before {
  opacity: 1;
}

.server-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.35);
}

/* ========================================
   8. 服务器状态指示灯动画
   ======================================== */
.server-status {
  position: relative;
  padding-left: 18px;
}

.server-status::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #95a5a6;
  box-shadow: 0 0 0 0 rgba(149, 165, 166, 0.7);
}

.server-card--active .server-status::before {
  background: #2ecc71;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
}

.server-card--hot .server-status::before {
  background: #e74c3c;
  animation: status-pulse-hot 1.5s ease-in-out infinite;
}

@keyframes status-pulse-hot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

/* ========================================
   9. 每日荣誉墙卡片优化
   ======================================== */
.honor-item {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.honor-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.honor-item:hover::after {
  left: 100%;
}

.honor-item:hover {
  transform: translateY(-6px) rotateY(5deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.honor-item:first-child {
  position: relative;
}

.honor-item:first-child::before {
  content: '👑';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 24px;
  animation: crown-bounce 2s ease-in-out infinite;
}

@keyframes crown-bounce {
  0%, 100% { transform: translateY(0) rotate(-15deg); }
  50% { transform: translateY(-5px) rotate(-10deg); }
}

/* ========================================
   10. 捐赠榜单美化
   ======================================== */
.top-donor-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.top-donor-item:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.25);
}

.rank-emoji {
  transition: all 0.3s ease;
}

.top-donor-item:hover .rank-emoji {
  transform: scale(1.3) rotate(15deg);
}

/* ========================================
   11. 按钮悬停微交互
   ======================================== */
.rank-controls button,
.server-player-btn,
.pc-portal-primary-action,
.pc-portal-secondary-action {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-controls button::after,
.server-player-btn::after,
.pc-portal-primary-action::after,
.pc-portal-secondary-action::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.rank-controls button:hover::after,
.server-player-btn:hover::after,
.pc-portal-primary-action:hover::after,
.pc-portal-secondary-action:hover::after {
  width: 300px;
  height: 300px;
}

.rank-controls button:hover,
.server-player-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ========================================
   12. 表头排序指示器美化
   ======================================== */
.sortable {
  position: relative;
  transition: all 0.3s ease;
}

.sortable:hover {
  transform: translateY(-1px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sortable::after {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sortable.active::after {
  animation: sort-indicator-bounce 0.6s ease;
}

@keyframes sort-indicator-bounce {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.3); }
}

/* ========================================
   13. 加载动画优化
   ======================================== */
.player-loading {
  position: relative;
}

.player-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid rgba(74, 144, 226, 0.3);
  border-top-color: #4a90e2;
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   14. Hero区域背景视差效果
   ======================================== */
.pc-portal-hero {
  position: relative;
  overflow: hidden;
}

.pc-portal-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: hero-float 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.1); }
}

/* ========================================
   15. 移动端优化
   ======================================== */
@media (max-width: 768px) {
  .rank_list:hover {
    transform: translateX(4px) scale(1.005);
  }

  .rank-mobile-stats {
    animation: fadeInUp 0.4s ease;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .honor-item:hover {
    transform: translateY(-4px) scale(1.02);
  }

  .server-card:hover {
    transform: translateY(-4px);
  }
}

/* ========================================
   16. 滚动条美化
   ======================================== */
.rank-scroll::-webkit-scrollbar,
.player-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.rank-scroll::-webkit-scrollbar-track,
.player-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.rank-scroll::-webkit-scrollbar-thumb,
.player-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a90e2, #3498db);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.rank-scroll::-webkit-scrollbar-thumb:hover,
.player-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3498db, #2980b9);
}

/* ========================================
   17. 通知横幅优化
   ======================================== */
.pcvr-notice-banner {
  position: relative;
  animation: slideInDown 0.6s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice-icon {
  animation: notice-shake 3s ease-in-out infinite;
}

@keyframes notice-shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}

/* ========================================
   18. 玩家弹窗优化
   ======================================== */
.player-modal {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.player-modal-content {
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.player-table-row {
  transition: all 0.25s ease;
}

.player-table-row:hover {
  background: rgba(74, 144, 226, 0.08) !important;
  transform: translateX(4px);
}

/* ========================================
   19. 数字滚动动画（可选）
   ======================================== */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.server-live-stats b,
.pc-portal-hud-live strong {
  animation: countUp 0.6s ease;
}

/* ========================================
   20. 响应式增强 - 超宽屏优化
   ======================================== */
@media (min-width: 1920px) {
  body.pc-portal-home {
    font-size: 16px;
  }

  .rank_list {
    min-height: 80px;
  }

  .rank_no {
    font-size: 30px;
  }

  .rank_detail {
    font-size: 17px;
  }

  .rank_detail_kda {
    font-size: 16px;
  }
}

/* ========================================
   21. 性能优化 - GPU加速
   ======================================== */
.rank_list,
.server-card,
.honor-item,
.top-donor-item,
.rank-sort-chip {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ========================================
   22. 焦点可访问性优化
   ======================================== */
.rank-controls button:focus,
.server-player-btn:focus,
.rank-sort-chip:focus,
.sortable:focus {
  outline: 3px solid rgba(74, 144, 226, 0.5);
  outline-offset: 2px;
}

/* ========================================
   23. 深色主题额外优化
   ======================================== */
html[data-theme-resolved="dark"] .rank_list:hover {
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.3), inset 0 0 20px rgba(74, 144, 226, 0.1);
}

html[data-theme-resolved="dark"] .server-card:hover {
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.4), 0 0 40px rgba(74, 144, 226, 0.1);
}

html[data-theme-resolved="dark"] .honor-item:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(74, 144, 226, 0.2);
}

/* ========================================
   24. 打印样式优化
   ======================================== */
@media print {
  .header,
  .pc-portal-hero,
  .rank-controls,
  .rank-sort-mobile,
  .server-player-btn,
  .notice-guide-btn {
    display: none !important;
  }

  .rank_list,
  .server-card,
  .honor-item {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
