/* Jupiter风格设计系统 */
:root {
  /* 主色调 - 深空蓝 */
  --primary: #1a1f3a;
  --primary-light: #2d3561;
  --primary-dark: #0f1220;
  
  /* 强调色 - 星云紫 */
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-dark: #5b21b6;
  
  /* 金色 - 老板专属 */
  --gold: #fbbf24;
  --gold-light: #fcd34d;
  --gold-dark: #f59e0b;
  
  /* 银色 - 打手专属 */
  --silver: #94a3b8;
  --silver-light: #cbd5e1;
  --silver-dark: #64748b;
  
  /* 中性色 */
  --bg: #0a0e1a;
  --surface: #1a1f3a;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  
  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* 卡牌颜色 */
  --card-kill: linear-gradient(135deg, #ef4444, #dc2626);
  --card-dodge: linear-gradient(135deg, #3b82f6, #2563eb);
  --card-peach: linear-gradient(135deg, #10b981, #059669);
  
  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  
  /* 间距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4);
  --shadow-glow-gold: 0 0 30px rgba(251, 191, 36, 0.5);
  --shadow-glow-silver: 0 0 20px rgba(148, 163, 184, 0.4);
}

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

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--bg) 0%, #0f1729 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  animation: rotate 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#app {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* 屏幕切换 */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

/* 通用隐藏类 */
.hidden {
  display: none !important;
}

.screen.hidden {
  display: none;
}

.container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

/* 标题 */
.title {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-md);
  animation: glow 3s ease-in-out infinite;
  letter-spacing: 0.05em;
  text-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: 400;
  text-align: center;
  letter-spacing: 0.02em;
}

.role-selection-title {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: var(--spacing-xl);
  font-weight: 600;
  text-align: center;
}

/* 角色选择网格布局 */
.role-selection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
  margin: var(--spacing-2xl) 0;
  padding: var(--spacing-lg);
}

/* 角色卡片 */
.role-card {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid rgba(71, 85, 105, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  position: relative;
  overflow: hidden;
  min-height: 340px;
}

.role-card:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.3);
  transform: translateY(-4px);
}

.role-card:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.role-card-header {
  position: absolute;
  top: var(--spacing-lg);
  left: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(167, 139, 250, 0.2));
  backdrop-filter: blur(10px);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.role-card-label {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 老板卡片的标签 */
.role-card[data-role="boss"] .role-card-header {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.25));
  border-color: rgba(251, 191, 36, 0.5);
}

.role-card[data-role="boss"] .role-card-label {
  color: var(--gold);
}

/* 打手卡片的标签 */
.role-card[data-role="dashou1"] .role-card-header,
.role-card[data-role="dashou2"] .role-card-header {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(100, 116, 139, 0.25));
  border-color: rgba(148, 163, 184, 0.5);
}

.role-card[data-role="dashou1"] .role-card-label,
.role-card[data-role="dashou2"] .role-card-label {
  color: rgba(203, 213, 225, 1);
}

.role-card-avatar-container {
  position: relative;
  margin-top: var(--spacing-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
}

.role-card-avatar {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent);
  object-fit: cover;
  background: var(--primary-dark);
  display: none;
  position: absolute;
  top: 0;
  left: 0;
}

.role-card-avatar.visible {
  display: block;
}

.role-card-icon {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-full);
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  position: absolute;
  top: 0;
  left: 0;
}

.boss-icon {
  border-color: var(--gold);
  color: var(--gold);
}

.dashou-icon {
  border-color: rgba(148, 163, 184, 0.8);
  color: rgba(148, 163, 184, 1);
}

.role-card-nickname {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  margin-top: var(--spacing-md);
}

.role-card-status {
  margin-top: auto;
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--success);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
  max-width: 200px;
}

.role-card:disabled .role-card-status {
  background: var(--error);
}

/* 旧样式保留用于兼容 */
.room-status-display {
  display: none;
}

.role-buttons {
  display: none;
}

.role-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  position: relative;
}

.role-btn[data-role="boss"] .role-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
  color: var(--primary-dark);
}

.role-btn[data-role="dashou1"] .role-icon,
.role-btn[data-role="dashou2"] .role-icon {
  background: linear-gradient(135deg, var(--silver), var(--silver-dark));
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
  color: var(--primary-dark);
}

.role-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.role-btn[data-role="boss"] .role-name {
  color: var(--gold);
}

.role-btn[data-role="dashou1"] .role-name,
.role-btn[data-role="dashou2"] .role-name {
  color: var(--silver-light);
}

.role-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* 按钮 */
.btn {
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--text);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn.hidden {
  display: none;
}

/* 房间列表 */
.room-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  margin: var(--spacing-xl) 0;
}

.create-room-section,
.join-room-section {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.room-id-input-group {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  transition: all 0.3s ease;
}

.room-id-input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.room-id-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin: 0 var(--spacing-sm);
}

.room-id-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  padding: var(--spacing-sm);
  width: 220px;
  letter-spacing: 0.05em;
}

.room-id-input::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--spacing-xl) 0;
  color: var(--text-secondary);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--primary-light);
}

.divider span {
  padding: 0 var(--spacing-lg);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  max-height: 60vh;
  overflow-y: auto;
}

.room-card {
  background: var(--surface);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.room-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.room-card.full {
  opacity: 0.6;
  cursor: not-allowed;
}

.room-card.full:hover {
  transform: none;
  box-shadow: none;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.room-id {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
}

.room-status {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.room-status.waiting {
  background: var(--warning);
  color: var(--bg);
}

.room-status.playing {
  background: var(--success);
  color: var(--bg);
}

.room-status.paused {
  background: var(--gold);
  color: var(--bg);
  animation: pulse-glow 2s ease-in-out infinite;
}

.room-status.full {
  background: var(--error);
  color: white;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
  }
}

/* 房间提示信息 */
.room-hint {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 500;
}

.room-players {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.room-player-slot {
  padding: var(--spacing-md);
  background: var(--primary-dark);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.75rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.room-player-slot.filled {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-color: var(--accent-light);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.slot-label {
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  color: var(--text);
}

.slot-status {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.room-player-slot.filled .slot-status {
  color: var(--accent-light);
}

.empty-rooms {
  text-align: center;
  color: var(--text-secondary);
  padding: var(--spacing-xl);
  grid-column: 1 / -1;
}

/* 等待界面 */
.players-status {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  margin: var(--spacing-2xl) 0;
}

.player-slot {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.player-slot.joined {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.slot-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.boss-icon {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--primary-dark);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.dashou-icon {
  background: linear-gradient(135deg, var(--silver), var(--silver-dark));
  color: var(--primary-dark);
  box-shadow: 0 0 15px rgba(148, 163, 184, 0.3);
}

.player-slot .status {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-full);
  background: var(--primary-dark);
}

.player-slot.joined .status {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

/* 游戏界面 */
#game-screen {
  display: block;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

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

/* 退出按钮 */
.exit-btn {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--error);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

.exit-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* 保底显示 */
.baodi-display {
  position: absolute;
  top: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  box-shadow: var(--shadow-glow-gold);
  z-index: 100;
  backdrop-filter: blur(10px);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-sm);
}

.baodi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.baodi-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-info-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  margin-left: var(--spacing-xs);
}

.settings-info-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  border-color: var(--primary);
}

/* 规则设置信息弹窗 */
.settings-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.settings-info-modal.hidden {
  display: none;
}

.settings-info-content {
  background: rgba(26, 31, 58, 0.98);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 16px;
  padding: var(--spacing-xl);
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.2);
}

.settings-info-content h3 {
  margin: 0 0 var(--spacing-lg) 0;
  color: #e2e8f0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.settings-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: rgba(15, 18, 32, 0.8);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  border-right: 1px solid rgba(124, 58, 237, 0.2);
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.settings-label {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 500;
}

.settings-value {
  color: #e2e8f0;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 var(--spacing-xs);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #a78bfa, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-unit {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
}
.baodi-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}

/* 游戏主区域 */
.game-main-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--spacing-xl);
  padding-top: calc(var(--spacing-xl) + 60px);
}

/* 顶部对手区域 */
.opponents-area {
  display: grid;
  grid-template-columns: 0.32fr 0.32fr;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  justify-content: space-between;
}

.opponent-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

.opponent-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--primary-dark);
  border-radius: var(--radius-md);
}

.opponent-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.opponent-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.opponent-name-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.opponent-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.opponent-userid {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.opponent-nickname {
  font-size: 0.875rem;
  color: var(--accent-light);
  font-weight: 500;
}

.opponent-hp {
  font-size: 1.25rem;
  color: var(--error);
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

.opponent-cards {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  background: var(--primary-dark);
  border-radius: var(--radius-md);
}

.cards-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.cards-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  justify-content: center;
  min-height: 60px;
  align-items: center;
  padding: var(--spacing-xs);
}

/* 中间区域 */
.middle-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-xl);
}

.card-gain-area {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  min-width: 400px;
}

.card-gain-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--spacing-lg);
  letter-spacing: 0.05em;
}

/* 底部区域 */
.bottom-area {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--spacing-lg);
}

.shared-cards-area,
.personal-cards-area,
.personal-info-area {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

.area-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--spacing-md);
  text-align: center;
  letter-spacing: 0.05em;
}

.shared-cards-content {
  min-height: 120px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
}

.personal-info-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.personal-info-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--primary-dark);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
}

.personal-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.personal-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm);
  background: var(--primary-dark);
  border-radius: var(--radius-sm);
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-value {
  color: var(--text);
  font-weight: 700;
  font-size: 0.875rem;
}

.info-value.hp-hearts {
  font-size: 1.25rem;
  color: var(--error);
  display: flex;
  gap: 2px;
}

/* 行动按钮 */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
}

.action-btn {
  padding: var(--spacing-md) var(--spacing-xl);
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  letter-spacing: 0.05em;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-btn:hover::before {
  opacity: 1;
}

.action-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  border-color: var(--accent-light);
}

.action-btn span {
  position: relative;
  z-index: 1;
}

/* 卡牌 */
.card {
  width: 70px;
  height: 105px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

/* 移动端触摸反馈 */
@media (max-width: 768px) {
  .card:active {
    transform: translateY(-4px) scale(1.02);
    opacity: 0.9;
  }
  
  .btn:active,
  .action-btn:active,
  .role-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

.card.kill {
  background: var(--card-kill);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.card.kill:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.card.dodge {
  background: var(--card-dodge);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.card.dodge:hover {
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.card.peach {
  background: var(--card-peach);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.card.peach:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.card.selected {
  border-color: white;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
  transform: translateY(-12px) scale(1.1);
}

.card-type {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
}

.card-name {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-placeholder {
  width: 30px;
  height: 45px;
  background: var(--primary-dark);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.card-placeholder:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* 卡牌堆叠样式 */
.card-stack,
.card-stack-small {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card-stack {
  width: 90px;
  height: 135px;
  font-size: 1rem;
}

.card-stack-small {
  width: 40px;
  height: 60px;
  font-size: 0.625rem;
}

.card-stack::before,
.card-stack-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card-stack:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

.card-stack.kill,
.card-stack-small.kill {
  background: var(--card-kill);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.card-stack.kill:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.card-stack.dodge,
.card-stack-small.dodge {
  background: var(--card-dodge);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.card-stack.dodge:hover {
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.card-stack.peach,
.card-stack-small.peach {
  background: var(--card-peach);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.card-stack.peach:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.card-count {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
}

.card-stack-small .card-count {
  font-size: 0.625rem;
  padding: 1px 4px;
}

/* 手牌区 - 保留用于个人卡片区 */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
  min-height: 120px;
  align-items: center;
}

.cards-container .card {
  width: 70px;
  height: 105px;
  font-size: 0.875rem;
}

.cards-container .card .card-type {
  font-size: 1.5rem;
}

.cards-container .card .card-name {
  font-size: 0.875rem;
}

/* 行动按钮 - 已移到上面 */

/* 游戏结束界面 */
.game-over-title {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
}

.game-over-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--primary-light);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-secondary);
}

.result-value {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

/* 错误提示 */
.toast {
  position: fixed;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: white;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s ease;
  font-weight: 600;
}

.toast.hidden {
  display: none;
}

/* 目标选择弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-glow), var(--shadow-xl);
  animation: fadeIn 0.3s ease;
}

.modal-content h3 {
  margin-bottom: var(--spacing-xl);
  font-size: 1.5rem;
  color: var(--text);
  text-align: center;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.target-btn {
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.target-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  transform: translateX(8px);
  box-shadow: var(--shadow-glow);
}

.target-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.target-btn:disabled:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
  box-shadow: none;
}

.target-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.target-info {
  flex: 1;
  text-align: left;
}

.target-name {
  display: block;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-xs);
}

.target-hp {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

#cancel-target-btn {
  width: 100%;
}

/* 响应弹窗 */
.response-content {
  text-align: center;
}

.response-message {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  font-size: 1.125rem;
}

.response-timer {
  position: relative;
  height: 8px;
  background: var(--primary-dark);
  border-radius: var(--radius-full);
  margin-bottom: var(--spacing-xl);
  overflow: hidden;
}

.timer-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--error), var(--warning));
  border-radius: var(--radius-full);
  transition: width 1s linear;
  width: 100%;
}

.timer-text {
  position: absolute;
  top: -25px;
  right: 0;
  font-size: 0.875rem;
  color: var(--error);
  font-weight: 700;
}

.response-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
  margin-bottom: var(--spacing-xl);
  min-height: 120px;
  align-items: center;
}

.response-cards .card {
  width: 80px;
  height: 120px;
}

.response-cards .card.selected {
  transform: translateY(-12px) scale(1.1);
  border-color: white;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
}

.response-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

.response-buttons .btn {
  min-width: 120px;
}

/* 等待响应提示 */
.waiting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.waiting-overlay.hidden {
  display: none;
}

.waiting-content {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--warning);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  text-align: center;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.waiting-content h3 {
  color: var(--warning);
  margin-bottom: var(--spacing-md);
}

.waiting-content p {
  color: var(--text-secondary);
}

.waiting-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--warning);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: var(--spacing-lg) auto;
}

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

/* 重连提示遮罩 */
.reconnect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.reconnect-overlay.hidden {
  display: none;
}

.reconnect-content {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--error);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  text-align: center;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
  max-width: 400px;
}

.reconnect-content h3 {
  color: var(--error);
  margin-bottom: var(--spacing-md);
  font-size: 1.5rem;
}

.reconnect-content p {
  color: var(--text-secondary);
  margin: var(--spacing-sm) 0;
}

#reconnect-attempts {
  color: var(--warning);
  font-weight: 600;
  font-size: 1.1rem;
}

.reconnect-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--error);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: var(--spacing-lg) auto;
}

/* 暂停遮罩 */
.paused-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1800;
}

.paused-overlay.hidden {
  display: none;
}

.paused-content {
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 2px solid var(--warning);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  text-align: center;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.5);
  max-width: 400px;
}

.paused-content h3 {
  color: var(--warning);
  margin-bottom: var(--spacing-md);
  font-size: 1.8rem;
}

.paused-content p {
  color: var(--text-secondary);
  margin: var(--spacing-sm) 0;
  font-size: 1rem;
}

.paused-content button {
  margin: var(--spacing-sm);
}

/* 暂停遮罩玩家状态 */
.paused-player-status {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.paused-player-status p {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
}

.player-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: var(--spacing-sm);
}

.player-count span {
  color: var(--gold-light);
}

.paused-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.paused-buttons button {
  width: 100%;
  margin: 0;
}

/* 游戏控制按钮 */
.game-controls {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  width: 100%;
}

.control-btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
}

.control-btn .btn-icon {
  font-size: 1.2rem;
}

.control-btn .btn-text {
  font-size: 0.875rem;
}

.pause-btn {
  background: linear-gradient(135deg, var(--warning), #f59e0b);
  color: white;
}

.pause-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

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

.exit-btn {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
}

.exit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

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

.destroy-btn {
  background: linear-gradient(135deg, var(--error), #dc2626);
  color: white;
}

.destroy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

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

/* 响应式：小屏幕上垂直排列 */
@media (max-width: 768px) {
  .game-controls {
    flex-direction: column;
  }
  
  .control-btn {
    width: 100%;
  }
}

/* 房间状态样式 */
.room-status.paused {
  background: linear-gradient(135deg, var(--warning), #f59e0b);
  color: white;
}

/* 动画 */
@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.8));
  }
}

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

@keyframes numberIncrease {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8));
  }
  100% {
    transform: scale(1);
  }
}

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

.screen {
  animation: fadeIn 0.5s ease;
}

/* 移动端触摸优化 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* 防止移动端双击缩放 */
button, .card, .role-card, .room-card {
  touch-action: manipulation;
}

/* 优化移动端点击区域 */
@media (max-width: 768px) {
  button, .btn, .card, .role-card {
    min-height: 44px; /* iOS推荐的最小点击区域 */
    min-width: 44px;
  }
  
  /* 优化输入框在移动端的显示 */
  input, textarea {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .bottom-area {
    grid-template-columns: 1fr;
  }

  .opponents-area {
    grid-template-columns: 1fr;
  }

  .card-gain-area {
    min-width: auto;
    width: 100%;
  }

  .room-status-display {
    flex-direction: column;
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .title {
    font-size: 2.5rem;
  }
  
  .subtitle {
    font-size: 1.125rem;
  }
  
  .create-room-section,
  .join-room-section {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-md);
  }

  .room-id-input-group {
    width: 100%;
    justify-content: center;
  }

  .room-id-input {
    width: 100%;
    max-width: 200px;
    font-size: 16px; /* 防止iOS自动缩放 */
  }

  .create-room-section .btn,
  .join-room-section .btn {
    width: 100%;
    min-height: 48px; /* 优化触摸区域 */
    font-size: 1rem;
  }
  
  .role-buttons {
    flex-direction: column;
    gap: var(--spacing-lg);
  }

  .role-btn {
    max-width: 100%;
    min-width: 100%;
    min-height: 48px;
  }
  
  .role-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .game-main-area {
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-md) + 60px);
    overflow-x: hidden;
  }

  .opponent-section {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .baodi-display {
    top: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
  }

  .baodi-label {
    font-size: 0.625rem;
  }
  
  .baodi-value {
    font-size: 1.25rem;
  }
  
  .opponents-area {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  
  /* 优化对手信息显示 */
  .opponent-info {
    padding: var(--spacing-sm);
  }
  
  .opponent-avatar {
    width: 40px;
    height: 40px;
  }
  
  .opponent-role {
    font-size: 0.875rem;
  }
  
  .opponent-hp {
    font-size: 1rem;
  }
  
  .cards-container .card {
    width: 60px;
    height: 90px;
    min-width: 60px;
    min-height: 90px;
  }
  
  .cards-container .card .card-type {
    font-size: 1.25rem;
  }
  
  .cards-container .card .card-name {
    font-size: 0.75rem;
  }
  
  .action-buttons {
    gap: var(--spacing-sm);
    flex-wrap: wrap;
  }
  
  .action-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    min-height: 44px;
    flex: 1;
    min-width: calc(50% - var(--spacing-sm));
  }
  
  .rooms-list {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .room-card {
    min-height: 120px;
  }

  .exit-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    min-height: 44px;
  }
  
  /* 优化共享卡牌区 */
  .shared-cards-content {
    min-height: 100px;
    padding: var(--spacing-sm);
  }
  
  /* 优化个人信息区 */
  .personal-info-area {
    padding: var(--spacing-md);
  }
  
  .personal-info-content {
    gap: var(--spacing-sm);
  }
  
  .info-item {
    padding: var(--spacing-sm);
    font-size: 0.875rem;
  }
  
  /* 优化游戏控制按钮 */
  .game-controls {
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
  }
  
  .control-btn {
    min-height: 48px;
    font-size: 0.875rem;
    padding: var(--spacing-md);
  }
  
  /* 优化中间区域 */
  .card-gain-area {
    padding: var(--spacing-md);
    min-width: auto;
  }
  
  .card-gain-label {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .role-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .role-name {
    font-size: 1.125rem;
  }
  
  .cards-container .card {
    width: 50px;
    height: 75px;
    min-width: 50px;
    min-height: 75px;
  }
  
  .cards-container .card .card-type {
    font-size: 1rem;
  }
  
  .cards-container .card .card-name {
    font-size: 0.625rem;
  }

  .opponent-name {
    font-size: 1rem;
  }

  .opponent-hp {
    font-size: 0.875rem;
  }
  
  /* 超小屏幕优化 */
  .room-id-input {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  .btn {
    min-height: 48px;
    font-size: 0.9rem;
  }
  
  .role-card {
    padding: var(--spacing-md);
  }
  
  .role-card-avatar-container {
    width: 80px;
    height: 80px;
  }
  
  .role-card-avatar,
  .role-card-icon {
    width: 80px;
    height: 80px;
  }
  
  .role-card-icon {
    font-size: 1.5rem;
  }
  
  .role-card-nickname {
    font-size: 0.75rem;
  }
}

/* ==================== 横屏强制与提示 ==================== */

/* 竖屏提示遮罩 */
.orientation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.orientation-overlay.hidden {
  display: none;
}

.orientation-content {
  text-align: center;
  padding: var(--spacing-2xl);
  animation: pulse 2s ease-in-out infinite;
}

.rotate-icon {
  font-size: 5rem;
  margin-bottom: var(--spacing-lg);
  animation: rotate-device 2s ease-in-out infinite;
}

@keyframes rotate-device {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.orientation-content h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  color: var(--accent-light);
}

.orientation-content p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

/* 移动端横屏优化 */
@media screen and (max-width: 768px) {
  /* 竖屏时显示提示 */
  @media (orientation: portrait) {
    .orientation-overlay {
      display: flex !important;
    }
    
    #app {
      display: none;
    }
  }
  
  /* 横屏时优化布局 */
  @media (orientation: landscape) {
    body {
      overflow: hidden;
      position: fixed;
      width: 100%;
      height: 100%;
    }
    
    #app {
      height: 100vh;
      overflow: hidden;
    }
    
    .container {
      max-width: 100%;
      padding: var(--spacing-sm);
      height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    /* 游戏界面横屏优化 */
    #game-screen {
      height: 100vh;
      overflow: hidden;
      position: relative;
    }
    
    .game-main-area {
      height: 100vh;
      padding: var(--spacing-sm);
      padding-top: calc(var(--spacing-sm) + 50px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      display: flex;
      flex-direction: column;
    }
    
    .baodi-display {
      font-size: 0.875rem;
      padding: var(--spacing-xs) var(--spacing-sm);
      position: fixed;
      top: var(--spacing-xs);
      left: 50%;
      transform: translateX(-50%);
      z-index: 100;
    }
    
    .baodi-label {
      font-size: 0.625rem;
    }
    
    .baodi-value {
      font-size: 1.125rem;
    }
    
    /* 对手区域紧凑布局 */
    .opponents-area {
      gap: var(--spacing-xs);
      margin-bottom: var(--spacing-xs);
      flex-shrink: 0;
    }
    
    .opponent-section {
      padding: var(--spacing-xs);
      gap: var(--spacing-xs);
    }
    
    .opponent-info {
      padding: var(--spacing-xs);
    }
    
    .opponent-avatar {
      width: 32px;
      height: 32px;
    }
    
    .opponent-role {
      font-size: 0.75rem;
    }
    
    .opponent-hp {
      font-size: 0.875rem;
    }
    
    /* 中间区域 */
    .middle-area {
      flex-shrink: 0;
      margin-bottom: var(--spacing-xs);
    }
    
    .card-gain-area {
      padding: var(--spacing-sm);
      min-width: auto;
    }
    
    .card-gain-label {
      font-size: 0.875rem;
      margin-bottom: var(--spacing-sm);
    }
    
    /* 底部区域紧凑布局 */
    .bottom-area {
      gap: var(--spacing-xs);
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    
    .shared-cards-area,
    .personal-cards-area,
    .personal-info-area {
      padding: var(--spacing-sm);
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    .area-label {
      font-size: 0.875rem;
      margin-bottom: var(--spacing-xs);
    }
    
    /* 卡牌尺寸调整 */
    .card {
      width: 45px;
      height: 65px;
      font-size: 0.65rem;
      min-width: 45px;
      min-height: 65px;
    }
    
    .card-type {
      font-size: 1.25rem;
    }
    
    .card-name {
      font-size: 0.65rem;
    }
    
    .cards-container .card {
      width: 50px;
      height: 70px;
    }
    
    /* 按钮尺寸调整 */
    .btn, .action-btn {
      padding: var(--spacing-xs) var(--spacing-sm);
      font-size: 0.8rem;
      min-height: 40px;
    }
    
    .action-buttons {
      gap: var(--spacing-xs);
    }
    
    .action-btn {
      flex: 1;
      min-width: calc(50% - var(--spacing-xs));
      padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    /* 个人信息优化 */
    .personal-info-header {
      padding: var(--spacing-xs);
      margin-bottom: var(--spacing-xs);
    }
    
    .personal-avatar {
      width: 40px;
      height: 40px;
    }
    
    .info-item {
      padding: var(--spacing-xs);
      font-size: 0.75rem;
    }
    
    .info-value {
      font-size: 0.75rem;
    }
    
    .game-controls {
      margin-top: var(--spacing-xs);
      gap: var(--spacing-xs);
    }
    
    .control-btn {
      min-height: 40px;
      padding: var(--spacing-xs) var(--spacing-sm);
      font-size: 0.75rem;
    }
    
    /* 模态框优化 */
    .modal-content,
    .auth-modal-content {
      max-width: 95vw;
      max-height: 90vh;
      padding: var(--spacing-md);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    .settings-info-content {
      max-width: 95vw;
      padding: var(--spacing-md);
    }
    
    /* 响应弹窗优化 */
    .response-cards {
      gap: var(--spacing-xs);
    }
    
    .response-cards .card {
      width: 60px;
      height: 90px;
    }
    
    /* 目标选择弹窗优化 */
    .target-btn {
      padding: var(--spacing-sm);
      font-size: 0.875rem;
      min-height: 48px;
    }
  }
}

/* 平板横屏优化 */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .game-main-area {
    max-height: 100vh;
  }
  
  .card {
    width: 60px;
    height: 85px;
  }
}

/* 顶部导航栏 */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--accent-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 用户信息区域 */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(45, 53, 97, 0.5);
  border-radius: var(--radius-lg);
  transition: all 0.3s;
}

.user-info:hover {
  background: rgba(45, 53, 97, 0.8);
  box-shadow: var(--shadow-glow);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-nickname {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.user-link {
  font-size: 0.8rem;
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.user-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .header-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0.75rem;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .user-info {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
  }
  
  .user-nickname {
    font-size: 0.9rem;
  }
  
  .user-link {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-bar {
    padding: 0.75rem 0.5rem;
  }
  
  .title {
    font-size: 1.25rem;
  }
  
  .user-info {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .user-nickname {
    font-size: 0.85rem;
  }
}

/* ==================== 认证模态框样式 ==================== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(10px);
}

.auth-modal-content {
  position: relative;
  background: rgba(26, 31, 58, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(124, 58, 237, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.3s ease-out;
}

.profile-modal-content {
  max-width: 500px;
}

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

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

/* 关闭按钮 */
.auth-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: all 0.3s;
  z-index: 10;
}

.auth-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: rotate(90deg);
}

/* 标题 */
.auth-title {
  text-align: center;
  margin-bottom: 30px;
}

.auth-title h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.auth-title p {
  color: #94a3b8;
  font-size: 0.95rem;
}

/* 标签切换 */
.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: rgba(15, 18, 32, 0.5);
  padding: 6px;
  border-radius: 12px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #94a3b8;
  border-radius: 8px;
  transition: all 0.3s;
}

.auth-tab.active {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.auth-tab:hover:not(.active) {
  background: rgba(124, 58, 237, 0.1);
  color: #a78bfa;
}

/* 表单 */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: formFadeIn 0.3s ease-out;
}

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

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.9rem;
}

.auth-form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 18, 32, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  font-size: 15px;
  color: #e2e8f0;
  box-sizing: border-box;
  transition: all 0.3s;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #7c3aed;
  background: rgba(15, 18, 32, 0.8);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.auth-form-group input::placeholder {
  color: #64748b;
}

/* 提交按钮 */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  margin-bottom: 10px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  background: rgba(100, 116, 139, 0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-btn-secondary {
  background: rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
  box-shadow: none;
}

.auth-btn-secondary:hover {
  background: rgba(100, 116, 139, 0.5);
  transform: translateY(-2px);
}

/* 消息提示 */
.auth-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

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

.auth-error-message {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-success-message {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==================== 个人中心模态框样式 ==================== */
.profile-modal-container {
  position: relative;
  display: flex;
  background: rgba(26, 31, 58, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  max-height: 700px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(124, 58, 237, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

/* 左侧边栏 */
.profile-sidebar {
  width: 260px;
  background: rgba(15, 18, 32, 0.6);
  border-right: 1px solid rgba(124, 58, 237, 0.2);
  display: flex;
  flex-direction: column;
  padding: 30px 0;
}

.profile-sidebar-header {
  padding: 0 25px 25px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.profile-sidebar-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* 导航菜单 */
.profile-nav {
  flex: 1;
  padding: 20px 15px;
}

.profile-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 8px;
  text-align: left;
}

.profile-nav-item:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #a78bfa;
}

.profile-nav-item.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(167, 139, 250, 0.2));
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.nav-icon {
  font-size: 18px;
}

.nav-text {
  font-weight: 500;
}

/* 退出登录按钮 */
.profile-logout-btn {
  margin: 0 15px 10px;
  padding: 14px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* 右侧内容区 */
.profile-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.profile-content-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 30px;
}

/* 标签页内容 */
.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
  animation: formFadeIn 0.3s ease-out;
}

/* 用户信息卡片 */
.profile-user-card {
  background: rgba(15, 18, 32, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

.profile-user-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.profile-user-avatar-large {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid #7c3aed;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  object-fit: cover;
}

.profile-change-avatar-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.profile-change-avatar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.profile-user-info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-label {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.profile-info-value {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-info-editable {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-info-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: rgba(15, 18, 32, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s;
}

.profile-info-input:focus {
  outline: none;
  border-color: #7c3aed;
  background: rgba(15, 18, 32, 0.8);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.profile-edit-btn {
  padding: 6px 14px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 6px;
  color: #a78bfa;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.profile-edit-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.5);
  color: #7c3aed;
}

.profile-save-btn {
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  color: #6ee7b7;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.profile-save-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.profile-cancel-btn {
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.profile-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

/* 设置卡片 */
.profile-settings-card {
  background: rgba(15, 18, 32, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
}

.profile-settings-title {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.profile-hint-text {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 个人中心消息提示 */
#profileInfoMessage,
#avatarMessage,
#nicknameMessage {
  margin-top: 15px;
}

#profileInfoMessage .auth-message,
#avatarMessage .auth-message,
#nicknameMessage .auth-message {
  animation: slideDown 0.3s ease-out;
}

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

/* 响应式 */
@media (max-width: 768px) {
  .auth-modal-content,
  .profile-modal-container {
    width: 95%;
    max-width: 95vw;
    padding: var(--spacing-md);
  }
  
  .profile-modal-container {
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
  }

  .profile-sidebar {
    width: 100%;
    flex-direction: row;
    padding: 15px;
    border-right: none;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    flex-shrink: 0;
  }

  .profile-sidebar-header {
    display: none;
  }

  .profile-nav {
    flex: 1;
    display: flex;
    padding: 0;
    gap: 10px;
  }

  .profile-nav-item {
    flex: 1;
    padding: 10px;
    margin-bottom: 0;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
  }

  .nav-text {
    font-size: 12px;
  }

  .profile-logout-btn {
    margin: 0;
    padding: 10px;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
  }

  .profile-content {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-user-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-md);
  }

  .profile-info-row {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .profile-user-avatar-large {
    width: 100px;
    height: 100px;
  }
  
  .auth-title h1 {
    font-size: 1.5rem;
  }
  
  .auth-form-group input {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  .auth-submit-btn {
    min-height: 48px;
  }
}

/* 响应式 */
@media (max-width: 480px) {
  .auth-modal-content {
    padding: 30px 20px;
  }

  .auth-title h1 {
    font-size: 1.5rem;
  }

  .profile-avatar img {
    width: 100px;
    height: 100px;
  }

  .profile-form-section {
    padding: 15px;
  }
}

/* 角色选择界面响应式 */
@media (max-width: 1024px) {
  .role-selection-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
  }
  
  .role-card {
    padding: var(--spacing-lg);
    min-height: 300px;
  }
  
  .role-card-avatar-container {
    width: 120px;
    height: 120px;
  }
  
  .role-card-avatar,
  .role-card-icon {
    width: 120px;
    height: 120px;
  }
  
  .role-card-icon {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  .role-selection-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .role-card {
    min-height: auto;
  }
  
  .role-card-avatar-container {
    width: 100px;
    height: 100px;
  }
  
  .role-card-avatar,
  .role-card-icon {
    width: 100px;
    height: 100px;
  }
  
  .role-card-icon {
    font-size: 2rem;
  }
  
  .role-card-nickname {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .role-selection-title {
    font-size: 1.25rem;
  }
  
  .role-card {
    padding: var(--spacing-md);
  }
  
  .role-card-avatar-container {
    width: 80px;
    height: 80px;
  }
  
  .role-card-avatar,
  .role-card-icon {
    width: 80px;
    height: 80px;
  }
  
  .role-card-icon {
    font-size: 1.5rem;
  }
  
  .role-card-nickname {
    font-size: 0.75rem;
  }
  
  .role-card-status {
    font-size: 0.75rem;
    padding: var(--spacing-xs) var(--spacing-md);
  }
}


/* ==================== 卡牌操作菜单 ==================== */
.card-action-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.card-action-menu.hidden {
  display: none;
}

.card-action-content {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: var(--spacing-xl);
  min-width: 300px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.card-action-content h3 {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--accent-light);
  font-size: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.card-action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.action-menu-btn {
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--accent);
  color: white;
}

.action-menu-btn:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.action-menu-btn:active {
  transform: translateY(0);
}

.action-menu-btn.discard-btn {
  background: var(--error);
}

.action-menu-btn.discard-btn:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.action-menu-btn.cancel-btn {
  background: var(--text-secondary);
}

.action-menu-btn.cancel-btn:hover {
  background: var(--silver-light);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

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

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