/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
               'Microsoft YaHei', sans-serif;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==================== 动态背景系统（保留兼容） ==================== */
.dynamic-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease-in-out;
  z-index: -1;
  opacity: 1;
  /* 使用will-change提示浏览器优化性能 */
  will-change: opacity;
}

/* 默认背景 - 配置页面使用竖版夜晚 */
.dynamic-background.default {
  background-image: url('https://aiimg.ad.qq.com/public/竖版夜晚_2025-11-05_22-34-35.png');
}

/* 夜晚背景 */
.dynamic-background.night {
  background-image: url('https://aiimg.ad.qq.com/public/横版/横版夜晚.png');
}

/* 狼人行动背景 */
.dynamic-background.werewolf-action {
  background-image: url('https://aiimg.ad.qq.com/public/横版/横版刀人1.png');
}

/* 预言家行动背景 */
.dynamic-background.seer-action {
  background-image: url('https://aiimg.ad.qq.com/public/横版预言家_2025-11-05_22-14-24.png');
}

/* 女巫行动背景 */
.dynamic-background.witch-action {
  background-image: url('https://aiimg.ad.qq.com/public/横版女巫_2025-11-05_22-13-53.png');
}

/* 白天讨论背景 - 使用刀人2背景 */
.dynamic-background.day-discussion {
  background-image: url('https://aiimg.ad.qq.com/public/横版刀人2_2025-11-05_22-13-10.png');
}

/* 投票背景 */
.dynamic-background.vote {
  background-image: url('https://aiimg.ad.qq.com/public/横版/横版投票.png');
}

/* 放逐背景 */
.dynamic-background.exile {
  background-image: url('https://aiimg.ad.qq.com/public/横版/横版放逐.png');
}

/* ==================== 游戏容器 ==================== */
.game-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  z-index: 1;
}

/* ==================== 配置界面 ==================== */
.config-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  overflow-y: auto;
}

.config-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2rem;
  max-width: 600px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.6s ease-out;
}

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

.config-title {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.config-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  flex: 1;
  min-height: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.form-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.85rem;
}

.form-select,
.form-input {
  padding: 0.5rem 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: -0.2rem;
}

/* 角色配置网格 */
.role-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.role-config-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.role-config-label {
  flex: 1;
  font-size: 0.85rem;
  color: #374151;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.role-config-input {
  width: 60px;
  padding: 0.4rem 0.5rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.3s ease;
}

.role-config-input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.role-config-input::-webkit-inner-spin-button,
.role-config-input::-webkit-outer-spin-button {
  opacity: 1;
  height: 20px;
}

/* 游戏结束时的固定"再来一局"按钮 */
.restart-game-fixed-btn {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  box-shadow: 
    0 8px 24px rgba(139, 92, 246, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* 语音控制按钮（包含speechToggle的control-group）往右移动，避免被"再来一局"按钮挡住 */
.bottom-bar .speech-control-group,
.bottom-bar .control-group:has(#speechToggle) {
  margin-left: auto;
  margin-right: 12rem;
}

/* 如果浏览器不支持:has()选择器，使用备用方案 */
@supports not selector(:has(*)) {
  .bottom-bar .control-group:nth-child(2) {
    margin-left: auto;
    margin-right: 12rem;
  }
}

.restart-game-fixed-btn:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.05);
  box-shadow: 
    0 12px 32px rgba(139, 92, 246, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

.restart-game-fixed-btn:active {
  transform: translateX(-50%) translateY(-1px) scale(1.02);
}

/* 开关容器 */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 开关按钮 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px #8b5cf6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

/* 角色选择网格 */
.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.role-btn {
  padding: 0.55rem 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-btn:hover {
  border-color: #8b5cf6;
  background: #f3f4f6;
  transform: translateY(-2px);
}

.role-btn-active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.start-btn {
  padding: 0.85rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

/* ==================== 游戏界面 ==================== */
.game-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  padding: 1rem;
  overflow: hidden;
}

.game-screen.hidden {
  display: none;
}

/* 顶部信息栏 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.top-bar-left,
.top-bar-right {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.top-bar-right {
  justify-content: flex-end;
}

.top-bar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.game-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* 标题旁边的角色徽章 */
.role-badge-inline {
  background: rgba(139, 92, 246, 0.3);
  border: 2px solid rgba(139, 92, 246, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
}

.role-badge-inline:hover {
  background: rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.info-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* 联系作者按钮 */
.contact-author-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.contact-author-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.contact-author-btn:active {
  transform: translateY(0);
}

/* 配置页面的联系作者按钮 */
.contact-author-btn-config {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  z-index: 10;
}

.contact-author-btn-config:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.contact-author-btn-config:active {
  transform: translateY(0) scale(1);
}

.contact-author-btn-config i {
  font-size: 1rem;
}

/* ==================== 全局按钮组容器 ==================== */
.global-buttons-container {
  position: fixed;
  top: 2rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
}

/* 全局加入用户群按钮 */
.join-group-btn-global {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
  white-space: nowrap;
}

.join-group-btn-global:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.join-group-btn-global:active {
  transform: translateY(0) scale(1);
}

.join-group-btn-global i {
  font-size: 1rem;
}

/* 全局排行榜按钮 */
.leaderboard-btn-global {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
  white-space: nowrap;
}

.leaderboard-btn-global:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.leaderboard-btn-global:active {
  transform: translateY(0) scale(1);
}

.leaderboard-btn-global i {
  font-size: 1rem;
}

/* 全局联系作者按钮 */
.contact-author-btn-global {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

.contact-author-btn-global:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.contact-author-btn-global:active {
  transform: translateY(0) scale(1);
}

.contact-author-btn-global i {
  font-size: 1rem;
}

/* 全局评论作品按钮 */
.comment-btn-global {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
  white-space: nowrap;
}

.comment-btn-global:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.comment-btn-global:active {
  transform: translateY(0) scale(1);
}

.comment-btn-global i {
  font-size: 1rem;
}

/* 主游戏区域 */
.main-game-area {
  display: grid;
  grid-template-columns: 280px 1fr 420px;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 面板卡片通用样式 */
.panel-card {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* 左侧玩家列表 */
.left-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.players-list {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.player-card {
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid rgba(229, 231, 235, 0.5);
  border-radius: 12px;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.player-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(139, 92, 246, 0.6);
}

.player-card.dead {
  opacity: 0.4;
  background: rgba(243, 244, 246, 0.4);
}

.player-card.you {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(243, 232, 255, 0.6);
}

/* 当前发言者发光效果 - 增强版 */
.player-card.speaking {
  border: 3px solid rgba(59, 130, 246, 1) !important;
  background: rgba(239, 246, 255, 0.95) !important;
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.9),
    0 0 60px rgba(59, 130, 246, 0.7),
    0 0 90px rgba(59, 130, 246, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.15) !important;
  animation: speakingGlow 1.5s ease-in-out infinite;
  position: relative;
  transform: scale(1.02);
  z-index: 10;
}

/* 增强发光边框效果 */
.player-card.speaking::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 16px;
  background: linear-gradient(45deg, 
    rgba(59, 130, 246, 0.6), 
    rgba(147, 197, 253, 0.6),
    rgba(59, 130, 246, 0.6));
  z-index: -1;
  animation: speakingGlowBorder 1.5s ease-in-out infinite;
  filter: blur(8px);
}

/* 内部光晕效果 */
.player-card.speaking::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  background: radial-gradient(circle at center, 
    rgba(59, 130, 246, 0.2) 0%,
    transparent 70%);
  z-index: 0;
  pointer-events: none;
}

@keyframes speakingGlow {
  0%, 100% {
    box-shadow: 
      0 0 30px rgba(59, 130, 246, 0.9),
      0 0 60px rgba(59, 130, 246, 0.7),
      0 0 90px rgba(59, 130, 246, 0.5),
      0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(59, 130, 246, 1);
  }
  50% {
    box-shadow: 
      0 0 50px rgba(59, 130, 246, 1),
      0 0 100px rgba(59, 130, 246, 0.8),
      0 0 150px rgba(59, 130, 246, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(96, 165, 250, 1);
  }
}

@keyframes speakingGlowBorder {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.player-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.player-status {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 角色徽章 */
.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.role-badge.werewolf { background: #ef4444; color: white; }
.role-badge.villager { background: #10b981; color: white; }
.role-badge.seer { background: #3b82f6; color: white; }
.role-badge.witch { background: #8b5cf6; color: white; }
.role-badge.hunter { background: #f59e0b; color: white; }
.role-badge.guard { background: #06b6d4; color: white; }

/* MBTI徽章 */
.mbti-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 性别徽章 */
.gender-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.25rem;
  margin-left: 0.3rem;
  color: white;
  letter-spacing: 0.5px;
}

/* 男性徽章 - 蓝色渐变 */
.gender-badge.male {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

/* 女性徽章 - 粉色渐变 */
.gender-badge.female {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 2px 4px rgba(240, 147, 251, 0.3);
}

/* 中央操作区 - 已移除，现在是空白区域 */
.center-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
}

/* 操作卡片 - 现在在右上角 */
.action-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(25px) saturate(150%);
  border-radius: 20px;
  box-shadow: 
      0 10px 40px rgba(0, 0, 0, 0.4),
      inset 0 1px 2px rgba(255, 255, 255, 0.15),
      0 0 60px rgba(139, 92, 246, 0.1);
  padding: 1.5rem;
  width: 100%;
  min-height: 200px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 边缘反光效果 */
.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 20%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(255, 255, 255, 0.3) 80%,
      transparent 100%
  );
  opacity: 0.6;
}

.action-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
  );
  pointer-events: none;
  opacity: 0.5;
}

/* 交互悬停效果 */
.action-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
      0 15px 50px rgba(0, 0, 0, 0.5),
      inset 0 1px 3px rgba(255, 255, 255, 0.2),
      0 0 80px rgba(139, 92, 246, 0.15);
  transform: translateY(-2px);
}

.action-panel {
  width: 100%;
  position: relative;
  z-index: 1;
  animation: fadeInContent 0.6s ease-out;
  min-height: min-content;
}

@keyframes fadeInContent {
  from {
      opacity: 0;
      transform: scale(0.95);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

/* 中央空白区域 */
.center-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* 右侧区域 - 包含操作面板和日志 */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

/* 操作面板在右上角 */
.right-panel .action-card {
  flex: 0 0 auto;
  max-height: 60%;
  min-height: 200px;
  overflow-y: auto;
}

/* 日志面板在右下角 */
.right-panel .log-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 确保日志标签栏不占用过多空间 */
.right-panel .log-panel .log-tabs {
  flex: 0 0 auto;
}

/* 确保日志内容区域可以滚动 */
.right-panel .log-panel .log-content {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.log-tabs {
  display: flex;
  background: rgba(139, 92, 246, 0.1);
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.log-tab {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  color: #6b7280;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.log-tab:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.log-tab-active {
  color: #8b5cf6;
  border-bottom-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
}

.log-tab-toggle {
  flex: 0 0 auto;
  max-width: 60px;
  padding: 1rem 0.75rem;
}

.log-tab-toggle:hover {
  background: rgba(139, 92, 246, 0.2);
}

.log-content {
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  min-height: 0;
  scroll-behavior: smooth;
  /* 优化滚动性能 */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

.log-content.hidden {
  display: none;
}

.logs-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  min-height: min-content;
}

/* 自定义滚动条样式 */
.log-content::-webkit-scrollbar,
.players-list::-webkit-scrollbar,
.action-card::-webkit-scrollbar,
.config-form::-webkit-scrollbar {
  width: 8px;
}

.log-content::-webkit-scrollbar-track,
.players-list::-webkit-scrollbar-track,
.action-card::-webkit-scrollbar-track,
.config-form::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb,
.players-list::-webkit-scrollbar-thumb,
.action-card::-webkit-scrollbar-thumb,
.config-form::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.log-content::-webkit-scrollbar-thumb:hover,
.players-list::-webkit-scrollbar-thumb:hover,
.action-card::-webkit-scrollbar-thumb:hover,
.config-form::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.8);
}

/* 日志样式 */
.log-item {
  background: rgba(255, 255, 255, 0.45);
  border-left: 4px solid #8b5cf6;
  padding: 0.875rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.3s ease;
}

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

.log-item.night {
  border-left-color: #3b82f6;
}

.log-item.day {
  border-left-color: #f59e0b;
}

.log-item.death {
  border-left-color: #ef4444;
}

/* 底部控制栏 */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 16px;
  margin-top: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  gap: 2rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.control-btn-warning {
  background: rgba(245, 158, 11, 0.8);
  border-color: #f59e0b;
}

.control-btn-warning:hover {
  background: rgba(245, 158, 11, 1);
}

.control-btn-danger {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

.control-btn-danger:hover {
  background: rgba(239, 68, 68, 1);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volume-slider {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-display {
  color: white;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ==================== 模态框 ==================== */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.modal-icon {
  text-align: center;
  font-size: 4rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: #1f2937;
  margin-bottom: 1rem;
}

.modal-message {
  font-size: 1.125rem;
  text-align: center;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.modal-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.modal-btn-secondary:hover {
  background: #d1d5db;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1280px) {
  .main-game-area {
      grid-template-columns: 240px 1fr 380px;
  }
  
  .right-panel .action-card {
      min-height: 180px;
      max-height: 55%;
  }
  
  /* 全局按钮组响应式 */
  .global-buttons-container {
      top: 1rem;
      right: 1rem;
      gap: 0.75rem;
  }
  
  .join-group-btn-global,
  .leaderboard-btn-global,
  .contact-author-btn-global,
  .comment-btn-global {
      padding: 0.5rem 1rem;
      font-size: 0.875rem;
  }
}

@media (max-width: 1024px) {
  .main-game-area {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto 1fr;
      max-height: none;
      gap: 0.75rem;
  }
  
  .left-panel {
      order: 1;
      max-height: 250px;
  }
  
  .right-panel {
      order: 2;
      max-height: none;
      flex-direction: row;
      gap: 0.75rem;
  }
  
  .right-panel .action-card {
      flex: 1;
      max-height: 300px;
      min-height: 200px;
  }
  
  .right-panel .log-panel {
      flex: 1;
      max-height: 300px;
      overflow: hidden;
  }
  
  .right-panel .log-panel .log-content {
      max-height: 100%;
      overflow-y: auto;
  }
  
  .center-panel {
      order: 3;
      display: none;
  }
  
  .bottom-bar {
      flex-wrap: wrap;
      gap: 1rem;
  }
  
  .control-group {
      flex: 1;
      min-width: 200px;
  }
}

@media (max-width: 768px) {
  .top-bar {
      flex-direction: column;
      gap: 0.75rem;
  }
  
  .top-bar-left,
  .top-bar-right {
      justify-content: center;
  }
  
  .config-card {
      padding: 2rem;
  }
  
  .config-title {
      font-size: 2rem;
  
  /* 全局按钮组在小屏幕上垂直排列 */
  .global-buttons-container {
      flex-direction: column;
      top: 0.75rem;
      right: 0.75rem;
      gap: 0.5rem;
  }
  
  .join-group-btn-global,
  .leaderboard-btn-global,
  .contact-author-btn-global,
  .comment-btn-global {
      padding: 0.5rem 0.875rem;
      font-size: 0.8rem;
  }
  }
  
  .action-card {
      padding: 1.5rem;
      overflow-y: auto;
  }
}

/* ==================== 工具类 ==================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-3 {
  margin-left: 0.75rem;
}

/* ==================== 排行榜弹窗样式 ==================== */
.leaderboard-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.leaderboard-modal-content {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 20px;
  width: 95%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

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

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rank-info-btn {
  background: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.rank-info-btn:hover {
  background: rgba(139, 92, 246, 0.5);
  border-color: rgba(139, 92, 246, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.rank-info-btn:active {
  transform: translateY(0);
}

.leaderboard-header h2 {
  color: #fbbf24;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
}

.leaderboard-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.leaderboard-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.leaderboard-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-header-row {
  display: grid;
  grid-template-columns: 70px 100px 1.5fr 100px 100px 100px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.leaderboard-header-cell {
  color: #fbbf24;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}

.leaderboard-header-cell:first-child {
  text-align: center;
}

.leaderboard-header-cell:nth-child(2) {
  text-align: center;
}

.leaderboard-header-cell:nth-child(3) {
  text-align: left;
}

.leaderboard-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: 70px 100px 1.5fr 100px 100px 100px;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  transform: translateX(5px);
}

.leaderboard-rank {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-item.rank-1 .leaderboard-rank {
  color: #ffd700;
  font-size: 2rem;
}

.leaderboard-item.rank-2 .leaderboard-rank {
  color: #c0c0c0;
  font-size: 1.8rem;
}

.leaderboard-item.rank-3 .leaderboard-rank {
  color: #cd7f32;
  font-size: 1.6rem;
}

.leaderboard-item.rank-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
  border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-item.rank-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.05) 100%);
  border-color: rgba(192, 192, 192, 0.3);
}

.leaderboard-item.rank-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.05) 100%);
  border-color: rgba(205, 127, 50, 0.3);
}

.leaderboard-user {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.leaderboard-tier {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid;
  text-align: center;
  white-space: nowrap;
}

.leaderboard-elo {
  color: #fbbf24;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.leaderboard-wins {
  color: #34d399;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.leaderboard-games {
  color: #a5b4fc;
  font-size: 0.95rem;
  text-align: center;
}

.loading-spinner {
  text-align: center;
  color: white;
  font-size: 1.2rem;
  padding: 3rem;
}

.leaderboard-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem;
  font-size: 1.1rem;
}

/* ==================== 评论作品弹窗样式 ==================== */
.comment-modal-content {
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comment-body {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 提示语区域 */
.comment-tips {
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  max-height: 200px;
  overflow-y: auto;
}

.comment-tips::-webkit-scrollbar {
  width: 6px;
}

.comment-tips::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.comment-tips::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 3px;
}

.comment-tips-title {
  color: #fbbf24;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.comment-tips-examples {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-tip-item {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid rgba(139, 92, 246, 0.5);
  transition: all 0.3s ease;
}

.comment-tip-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(139, 92, 246, 0.8);
  transform: translateX(3px);
}

/* 输入区域 */
.comment-input-area {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-shrink: 0;
}

.comment-character-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.comment-character-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.comment-character-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.comment-generate-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.comment-generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.comment-generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.comment-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 占位符 */
.comment-placeholder {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 3rem 2rem;
  font-size: 1.1rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
  padding-right: 0.5rem;
}

/* 自定义滚动条样式 */
.comment-list::-webkit-scrollbar {
  width: 8px;
}

.comment-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.comment-list::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

.comment-list::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}

.comment-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 2px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

.comment-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateX(5px);
}

.comment-text {
  color: white;
  font-size: 1rem;
  line-height: 1.6;
  flex: 1;
  word-wrap: break-word;
}

.comment-copy-btn {
  align-self: flex-end;
  background: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-copy-btn:hover {
  background: rgba(139, 92, 246, 0.5);
  border-color: rgba(139, 92, 246, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.comment-copy-btn:active {
  transform: translateY(0);
}

.comment-footer {
  padding-top: 1rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.comment-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.comment-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.comment-link-btn:active {
  transform: translateY(0);
}

.comment-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem;
  font-size: 1.1rem;
}

/* Toast提示动画 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ==================== 系统公告弹窗样式 ==================== */
.announcement-modal-content {
  max-width: 550px;
  max-height: 80vh;
}

.announcement-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.announcement-content {
  flex: 1;
}

.announcement-text {
  color: white;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
  text-align: justify;
  word-wrap: break-word;
}

.announcement-link {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid #fbbf24;
  transition: all 0.3s ease;
  word-break: break-all;
}

.announcement-link:hover {
  color: #fcd34d;
  border-bottom-color: #fcd34d;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.announcement-signature {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.announcement-signature-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-style: italic;
  text-align: right;
}

.announcement-footer {
  padding: 1rem 2rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.announcement-confirm-btn {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  display: inline-flex;
  align-items: center;
}

.announcement-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.announcement-confirm-btn:active {
  transform: translateY(0);
}

/* ==================== 段位说明弹窗样式 ==================== */
.rank-info-modal-content {
  max-width: 700px;
  max-height: 85vh;
}

.rank-info-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.rank-info-intro {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 10px;
  border-left: 4px solid rgba(139, 92, 246, 0.5);
}

.rank-info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rank-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.rank-info-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.rank-info-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rank-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rank-info-badge {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid;
  text-align: center;
  white-space: nowrap;
}

.rank-info-tier {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rank-info-range {
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .leaderboard-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .leaderboard-header {
    padding: 1rem 1.5rem;
  }
  
  .leaderboard-header h2 {
    font-size: 1.4rem;
  }
  
  .leaderboard-header-actions {
    gap: 0.5rem;
  }
  
  .rank-info-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .leaderboard-body {
    padding: 1rem 1.5rem;
  }
  
  .rank-info-body {
    padding: 1.5rem 1rem;
  }
  
  .rank-info-grid {
    grid-template-columns: 1fr;
  }
  
  .rank-info-item {
    padding: 1rem;
  }
  
  .leaderboard-header-row {
    grid-template-columns: 50px 80px 1fr 80px 80px;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  
  .leaderboard-header-cell {
    font-size: 0.8rem;
  }
  
  .leaderboard-item {
    grid-template-columns: 50px 80px 1fr 80px 80px;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  
  .tier-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .leaderboard-header-row {
    grid-template-columns: 50px 80px 1fr 80px 80px 80px;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  
  .leaderboard-item {
    grid-template-columns: 50px 80px 1fr 80px 80px 80px;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  
  .tier-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .leaderboard-elo {
    font-size: 1rem;
  }
  
  .leaderboard-wins {
    font-size: 0.9rem;
  }
  
  .leaderboard-games {
    font-size: 0.85rem;
  }
  
  .leaderboard-rank {
    font-size: 1.2rem;
  }
  
  .comment-body {
    padding: 1rem 1.5rem;
  }
  
  .comment-tips {
    padding: 1rem;
  }
  
  .comment-tips-title {
    font-size: 0.9rem;
  }
  
  .comment-tip-item {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
  
  .comment-input-area {
    flex-direction: column;
  }
  
  .comment-character-input {
    width: 100%;
  }
  
  .comment-generate-btn {
    width: 100%;
    justify-content: center;
  }
  
  .comment-item {
    padding: 1rem;
  }
  
  .comment-text {
    font-size: 0.9rem;
  }
  
  .comment-link-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .announcement-body {
    padding: 1.5rem 1rem;
  }
  
  .announcement-text {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .announcement-signature-text {
    font-size: 0.9rem;
  }
  
  .announcement-footer {
    padding: 0.75rem 1rem;
  }
  
  .announcement-confirm-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .leaderboard-item.rank-1 .leaderboard-rank {
    font-size: 1.5rem;
  }
  
  .leaderboard-item.rank-2 .leaderboard-rank {
    font-size: 1.4rem;
  }
  
  .leaderboard-item.rank-3 .leaderboard-rank {
    font-size: 1.3rem;
  }
  
  .leaderboard-user {
    font-size: 0.9rem;
  }
  
  .leaderboard-games,
  .leaderboard-winrate {
    font-size: 0.85rem;
  }
}

/* Emoji弹出动画 - 进入动画 */
@keyframes emojiPopIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.2);
  }
}

/* Emoji弹出动画 - 退出动画（已废弃，现在持续显示） */
@keyframes emojiPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-40px) scale(0.8);
  }
}

.emoji-bubble {
  user-select: none;
  -webkit-user-select: none;
}
