/* ============================================================
   ui-enhancements.css - UI 视觉与交互优化（叠加层）
   幻兽学院 v3.0
   说明：此文件覆盖并增强 styles.css 中的样式，不修改原有样式
   加载方式：在 index.html 中 <link> 引入
   ============================================================ */

/* ========== 1. CSS 变量 ========== */
:root {
  /* 主色调 */
  --color-primary: #007AFF;
  --color-primary-light: #4DA3FF;
  --color-primary-dark: #0055CC;
  --color-success: #34C759;
  --color-success-light: #4CD964;
  --color-warning: #FF9500;
  --color-warning-light: #FFB340;
  --color-error: #FF3B30;
  --color-error-light: #FF6B6B;
  --color-bg: #F2F2F7;
  --color-card: #FFFFFF;
  --color-text: #1C1C1E;
  --color-text-secondary: #8E8E93;
  --color-text-tertiary: #C7C7CC;
  --color-border: rgba(60, 60, 67, 0.12);

  /* 阴影规范 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-active: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* 圆角规范 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 动画时长 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 大屏模式变量（默认值，大屏时覆盖） */
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --card-padding: 18px;
  --container-max-width: 1300px;
  --spacing-gap: 16px;
}


/* ========== 2. 按钮状态增强 ========== */

/* 所有按钮统一 hover 增强 */
.tool-btn:hover,
.btn:hover,
.nav-tab:hover:not(.active),
.quick-btn:hover,
.quick-reward-btn:hover {
  transform: translateY(-1px);
  transition: all var(--transition-fast);
}

/* 按钮 active（按下）状态 */
.tool-btn:active,
.btn:active,
.nav-tab:active:not(.active),
.quick-btn:active,
.quick-reward-btn:active {
  transform: scale(0.96);
  transition: all 0.05s ease;
}

/* 按钮点击缩放反馈（通用） */
.btn-click-effect {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-click-effect:active {
  transform: scale(0.95);
}

/* 按钮 disabled 状态增强 */
.tool-btn:disabled,
.btn:disabled,
.quick-reward-btn:disabled,
.nav-tab.active:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.3);
}

/* 主要按钮 hover 增强 */
.tool-btn.primary:hover,
.btn-add:hover,
.btn-export:hover {
  box-shadow: 0 4px 12px rgba(247, 151, 30, 0.3);
}

/* 危险按钮 hover */
.btn-reset:hover,
.sr-btn.del:hover {
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.2);
}


/* ========== 3. 按钮加载状态 ========== */

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: uiSpin 0.65s linear infinite;
  color: inherit;
}

/* 深色按钮 loading 用白色 */
.btn-loading.btn-add::after,
.btn-loading.tool-btn.primary::after,
.btn-loading.reward-btn::after {
  border-color: rgba(0, 0, 0, 0.3);
  border-top-color: #000;
}

/* 任务领取按钮 loading */
.task-claim-btn.btn-loading::after {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #000;
}

@keyframes uiSpin {
  to { transform: rotate(360deg); }
}


/* ========== 4. Toast 通知系统（增强版） ========== */

/* Toast 容器 - 固定在右上角 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* Toast 消息 */
.toast-message {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--color-card);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.2s forwards;
  max-width: 400px;
  border: 1px solid var(--color-border);
  font-weight: 500;
  color: var(--color-text);
}

.toast-message.success {
  border-left: 4px solid var(--color-success);
}

.toast-message.error {
  border-left: 4px solid var(--color-error);
}

.toast-message.warning {
  border-left: 4px solid var(--color-warning);
}

.toast-message.info {
  border-left: 4px solid var(--color-primary);
}

.toast-message .toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}


/* ========== 5. 页面切换动画 ========== */

/* 页面切换淡入 */
.page {
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.page:not(.active) {
  display: none;
}

.page.active {
  animation: uiPageFadeIn 0.35s ease;
}

@keyframes uiPageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ========== 6. 卡片悬停效果增强 ========== */

/* 宠物卡片悬停 */
.beast-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.beast-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* 任务卡片悬停 */
.task-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 悬赏卡片悬停 */
.bounty-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.bounty-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* 管理卡片悬停 */
.manage-section {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.manage-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 排行榜项悬停 */
.rank-item {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.rank-item:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}


/* ========== 7. 骨架屏（加载占位） ========== */

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e8e8e8 37%,
    #f0f0f0 63%
  );
  background-size: 400% 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.8s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* 骨架屏容器 */
.skeleton-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.skeleton-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--color-border);
}

.skeleton-card .skeleton-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.skeleton-card .skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  flex-shrink: 0;
}

.skeleton-card .skeleton-info {
  flex: 1;
}

.skeleton-card .skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 7px;
}

.skeleton-card .skeleton-line:last-child {
  width: 60%;
  margin-bottom: 0;
}

.skeleton-card .skeleton-badge {
  height: 24px;
  width: 80px;
  border-radius: 12px;
  margin-top: 6px;
}

.skeleton-card .skeleton-bar {
  height: 8px;
  border-radius: 4px;
  margin-top: 12px;
}

.skeleton-card .skeleton-stats {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.skeleton-card .skeleton-stat {
  width: 60px;
  height: 28px;
  border-radius: 12px;
}


/* ========== 8. 奖励发放动画 ========== */

/* 经验值弹出动画 */
.exp-float {
  position: fixed;
  pointer-events: none;
  font-size: 28px;
  font-weight: 900;
  color: var(--color-success);
  z-index: 9998;
  animation: expFloatUp 1.2s ease-out forwards;
  text-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.exp-float.punish {
  color: var(--color-error);
  text-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

@keyframes expFloatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1);
  }
}

/* 卡片奖励脉冲动画 */
.beast-card.reward-pulse {
  animation: cardRewardPulse 0.8s ease;
}

@keyframes cardRewardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(52, 199, 89, 0.2);
    transform: scale(1.03);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    transform: scale(1);
  }
}

.beast-card.punish-pulse {
  animation: cardPunishPulse 0.8s ease;
}

@keyframes cardPunishPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(255, 59, 48, 0.15);
    transform: scale(0.98);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    transform: scale(1);
  }
}


/* ========== 9. 宠物进化动画增强 ========== */

.evolve-animation {
  animation: evolvePulse 1.5s ease;
}

@keyframes evolvePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 30px 15px rgba(0, 122, 255, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

/* 进化闪光效果增强 */
.evo-overlay.show .evo-content {
  animation: evoContentPop 0.6s var(--transition-spring);
}

@keyframes evoContentPop {
  0% {
    transform: scale(0.3) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}


/* ========== 10. 成就解锁庆祝动画 ========== */

.celebration {
  animation: celebratePop 0.6s var(--transition-spring);
}

@keyframes celebratePop {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(8deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* 成就通知增强 */
.achievement-toast.show {
  animation: achSlideIn 0.5s var(--transition-spring);
}

@keyframes achSlideIn {
  0% {
    transform: translateX(-50%) translateY(-40px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

/* 彩带效果（由 JS 动态创建） */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 9997;
  pointer-events: none;
  animation: confettiFall 2.5s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(-20px) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) scale(0.3);
  }
}


/* ========== 11. 列表入场动画 ========== */

.rank-list .rank-item,
.beast-grid .beast-card,
.bounty-grid .bounty-card,
.task-grid .task-card {
  animation: uiListItemIn 0.4s ease backwards;
}

.rank-list .rank-item:nth-child(1),
.beast-grid .beast-card:nth-child(1),
.bounty-grid .bounty-card:nth-child(1),
.task-grid .task-card:nth-child(1) {
  animation-delay: 0ms;
}

.rank-list .rank-item:nth-child(2),
.beast-grid .beast-card:nth-child(2),
.bounty-grid .bounty-card:nth-child(2),
.task-grid .task-card:nth-child(2) {
  animation-delay: 50ms;
}

.rank-list .rank-item:nth-child(3),
.beast-grid .beast-card:nth-child(3),
.bounty-grid .bounty-card:nth-child(3),
.task-grid .task-card:nth-child(3) {
  animation-delay: 100ms;
}

.rank-list .rank-item:nth-child(4),
.beast-grid .beast-card:nth-child(4),
.bounty-grid .bounty-card:nth-child(4),
.task-grid .task-card:nth-child(4) {
  animation-delay: 150ms;
}

.rank-list .rank-item:nth-child(5),
.beast-grid .beast-card:nth-child(5),
.bounty-grid .bounty-card:nth-child(5),
.task-grid .task-card:nth-child(5) {
  animation-delay: 200ms;
}

.rank-list .rank-item:nth-child(6),
.beast-grid .beast-card:nth-child(6),
.bounty-grid .bounty-card:nth-child(6),
.task-grid .task-card:nth-child(6) {
  animation-delay: 250ms;
}

.rank-list .rank-item:nth-child(7),
.beast-grid .beast-card:nth-child(7),
.bounty-grid .bounty-card:nth-child(7),
.task-grid .task-card:nth-child(7) {
  animation-delay: 300ms;
}

.rank-list .rank-item:nth-child(8),
.beast-grid .beast-card:nth-child(8),
.bounty-grid .bounty-card:nth-child(8),
.task-grid .task-card:nth-child(8) {
  animation-delay: 350ms;
}

.rank-list .rank-item:nth-child(9),
.beast-grid .beast-card:nth-child(9),
.bounty-grid .bounty-card:nth-child(9),
.task-grid .task-card:nth-child(9) {
  animation-delay: 400ms;
}

.rank-list .rank-item:nth-child(10),
.beast-grid .beast-card:nth-child(10),
.bounty-grid .bounty-card:nth-child(10),
.task-grid .task-card:nth-child(10) {
  animation-delay: 450ms;
}

/* 后续项统一延迟 */
.rank-list .rank-item:nth-child(n+11),
.beast-grid .beast-card:nth-child(n+11),
.bounty-grid .bounty-card:nth-child(n+11),
.task-grid .task-card:nth-child(n+11) {
  animation-delay: 500ms;
}

@keyframes uiListItemIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ========== 12. 弹窗动画增强 ========== */

.modal-overlay.show {
  animation: uiOverlayIn 0.15s ease;
}

@keyframes uiOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 弹窗动画：使用平滑淡入而非弹性缩放
   修复：原 spring 弹性动画（scale 0.9 + cubic-bezier 弹性）在打开时会
   先缩小再弹跳放大，加上宠物大图（1-4MB）加载延迟，视觉上表现为
   "闪一下"。改为简单的透明度过渡，打开更干脆、不闪 */
.modal-overlay.show .modal {
  animation: uiModalIn 0.15s ease;
}

@keyframes uiModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* ========== 13. 网络异常提示横幅 ========== */

.network-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--color-warning);
  color: #fff;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform var(--transition-normal);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.network-banner.show {
  transform: translateY(0);
}

.network-banner.error {
  background: var(--color-error);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.network-banner .retry-btn {
  margin-left: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.network-banner .retry-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* ========== 14. 排行榜前三名高亮 ========== */

/* 第一名金牌 */
.rank-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 193, 7, 0.06));
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.15);
}

.rank-item:nth-child(1) .rank-position {
  font-size: 32px;
  animation: rankGoldGlow 2s ease-in-out infinite;
}

@keyframes rankGoldGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6)); }
}

/* 第二名银牌 */
.rank-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.12), rgba(169, 169, 169, 0.06));
  border: 1px solid rgba(192, 192, 192, 0.3);
}

.rank-item:nth-child(2) .rank-position {
  font-size: 28px;
}

/* 第三名铜牌 */
.rank-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.12), rgba(184, 115, 51, 0.06));
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.rank-item:nth-child(3) .rank-position {
  font-size: 26px;
}

/* 排行榜前三名分数高亮 */
.rank-item:nth-child(1) .rank-score {
  font-size: 18px;
  color: #ff8f00;
  text-shadow: 0 0 8px rgba(255, 143, 0, 0.2);
}

.rank-item:nth-child(2) .rank-score {
  font-size: 16px;
  color: #757575;
}

.rank-item:nth-child(3) .rank-score {
  font-size: 15px;
  color: #8d6e63;
}


/* ========== 15. 排行榜自动滚动 ========== */

.rank-list.auto-scroll {
  overflow: hidden;
  height: 600px;
  position: relative;
}

.rank-list.auto-scroll .rank-item {
  animation: rankScrollUp 0.5s ease;
}

.rank-list.auto-scroll::after {
  content: '⏸ 点击暂停滚动';
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: sticky;
  bottom: 0;
  background: var(--color-bg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}


/* ========== 16. 随机点名滚动动画增强 ========== */

.rollcall-display.spinning {
  animation: rollcallNameScroll 0.08s steps(1) infinite;
}

@keyframes rollcallNameScroll {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.98); }
}

.rollcall-display.result {
  animation: rollcallResultPop 0.6s var(--transition-spring);
}

@keyframes rollcallResultPop {
  0% {
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.15) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}


/* ========== 17. 大屏适配（课堂演示） ========== */

@media (min-width: 1600px) {
  :root {
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --card-padding: 24px;
    --container-max-width: 1400px;
    --spacing-gap: 20px;
  }

  .container {
    max-width: var(--container-max-width);
    padding: 28px;
  }

  /* 字体放大 */
  body {
    font-size: var(--font-size-base);
  }

  .beast-card {
    padding: var(--card-padding);
  }

  .beast-card .student-name {
    font-size: 20px;
  }

  .beast-card .pet-level {
    font-size: 16px;
  }

  .beast-card .name {
    font-size: 20px;
  }

  .beast-card .beast-name {
    font-size: 14px;
  }

  .beast-card .avatar {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .avatar-emoji {
    font-size: 44px;
  }

  .beast-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }

  /* 导航放大 */
  .nav-tab {
    font-size: 16px;
    padding: 10px 22px;
  }

  .header {
    height: 68px;
    padding: 0 32px;
  }

  .logo-text {
    font-size: 24px;
  }

  .logo-icon {
    font-size: 32px;
  }

  /* 工具栏放大 */
  .toolbar .form-input {
    font-size: 15px;
    padding: 10px 14px;
  }

  .tool-btn {
    font-size: 15px;
    padding: 10px 20px;
  }

  /* 排行榜放大 */
  .rank-item {
    padding: 16px 24px;
  }

  .rank-name {
    font-size: 18px;
  }

  .rank-detail {
    font-size: 14px;
  }

  .rank-score {
    font-size: 18px;
  }

  .rank-position {
    width: 52px;
    height: 52px;
    font-size: 32px;
  }

  /* 弹窗放大 */
  .modal {
    max-width: 640px;
    padding: 32px;
  }

  .modal .hero-name {
    font-size: 24px;
  }

  .modal .avatar-lg {
    width: 100px;
    height: 100px;
    font-size: 52px;
  }

  /* 统计卡片放大 */
  .stat-card .sc-val {
    font-size: 36px;
  }

  .stat-card .sc-label {
    font-size: 14px;
  }

  /* 管理卡片放大 */
  .manage-section {
    padding: 28px;
  }

  .manage-section h2 {
    font-size: 18px;
  }

  /* 任务卡片放大 */
  .task-card {
    padding: 22px;
  }

  .task-card-name {
    font-size: 18px;
  }

  .task-card-desc {
    font-size: 14px;
  }

  /* 悬赏卡片放大 */
  .bounty-card {
    padding: 24px;
  }

  .bounty-card-title {
    font-size: 18px;
  }

  .bounty-card-desc {
    font-size: 14px;
  }

  /* 工具卡片放大 */
  .tool-card {
    padding: 28px;
  }

  .tool-card h3 {
    font-size: 18px;
  }

  .countdown-display {
    font-size: 80px;
  }

  .rollcall-name {
    font-size: 40px;
  }

  /* 经验条放大 */
  .exp-bar-wrap {
    height: 10px;
  }

  .mini-stat {
    font-size: 13px;
    padding: 6px 12px;
  }

  /* 成就徽章放大 */
  .achievement-badge {
    font-size: 14px;
    padding: 8px 16px;
  }

  .achievement-badge .ab-icon {
    font-size: 20px;
  }
}

/* 超大屏（4K 投影） */
@media (min-width: 2560px) {
  :root {
    --font-size-base: 18px;
    --font-size-lg: 20px;
    --font-size-xl: 26px;
    --card-padding: 30px;
    --container-max-width: 1800px;
    --spacing-gap: 24px;
  }

  .beast-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
  }

  .beast-card .avatar {
    width: 120px;
    height: 120px;
    border-radius: 28px;
  }

  .avatar-emoji {
    font-size: 52px;
  }

  .nav-tab {
    font-size: 18px;
    padding: 12px 28px;
  }

  .header {
    height: 76px;
  }
}


/* ========== 18. 随机点名抽奖效果 ========== */

.rollcall-name.spinning {
  animation: rollcallSlotMachine 0.1s steps(1) infinite;
  color: var(--color-primary);
}

@keyframes rollcallSlotMachine {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  75% { transform: translateY(2px); }
}

.rollcall-name.result {
  animation: rollcallWin 0.6s var(--transition-spring);
  color: var(--color-warning);
  text-shadow: 0 0 20px rgba(255, 149, 0, 0.4);
}

@keyframes rollcallWin {
  0% {
    transform: scale(0.5) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}


/* ========== 19. 空状态美化 ========== */

.empty-state {
  padding: 60px 20px;
  animation: uiEmptyStateIn 0.5s ease;
}

@keyframes uiEmptyStateIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: uiEmptyIconFloat 3s ease-in-out infinite;
}

@keyframes uiEmptyIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state p {
  font-size: 15px;
  color: var(--color-text-secondary);
}


/* ========== 20. 操作确认弹窗 ========== */

.confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  animation: uiOverlayIn 0.2s ease;
}

.confirm-dialog.show {
  display: flex;
}

.confirm-dialog .confirm-box {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: uiModalIn 0.3s var(--transition-spring);
}

.confirm-dialog .confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-dialog .confirm-message {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-dialog .confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-dialog .confirm-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.confirm-dialog .confirm-btn.cancel {
  background: var(--color-bg);
  color: var(--color-text);
}

.confirm-dialog .confirm-btn.cancel:hover {
  background: #e5e5ea;
}

.confirm-dialog .confirm-btn.confirm {
  background: var(--color-primary);
  color: #fff;
}

.confirm-dialog .confirm-btn.confirm:hover {
  background: var(--color-primary-dark);
}

.confirm-dialog .confirm-btn.confirm.danger {
  background: var(--color-error);
}

.confirm-dialog .confirm-btn.confirm.danger:hover {
  background: #d63031;
}


/* ========== 21. 头部渐变增强 ========== */

/* 为 header 添加微妙的底部阴影 */
.header {
  box-shadow: 0 1px 0 var(--color-border), 0 1px 3px rgba(0, 0, 0, 0.04);
}


/* ========== 22. 滚动条美化 ========== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}


/* ========== 23. 选中高亮统一 ========== */

::selection {
  background: rgba(0, 122, 255, 0.2);
  color: var(--color-text);
}