:root {
  --primary: #c41e3a;
  --primary-hover: #a3182f;
  --green: #10b981;
  --green-light: #d1fae5;
  --green-dark: #065f46;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --blue-dark: #1e40af;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --orange-dark: #92400e;
  --red-light: #fee2e2;
  --red-dark: #991b1b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --sidebar-bg: #1a1d23;
  --sidebar-hover: #2a2d35;
  --sidebar-active: #c41e3a;
  --sidebar-text: #9ca3af;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  /* 游戏模块主题色 */
  --destiny-primary: #6c3fff;
  --destiny-light: #f5f3ff;
  --destiny-gradient: linear-gradient(135deg, #6c3fff, #9b59b6);
  --wheel-primary: #9b59b6;
  --wheel-light: #f5f0ff;
  --wheel-gradient: linear-gradient(135deg, #9b59b6, #8e44ad);
  --bingo-primary: #e74c3c;
  --bingo-light: #fef2f2;
  --bingo-gradient: linear-gradient(135deg, #e74c3c, #c0392b);
  --maze-primary: #60a5fa;
  --maze-light: #eff6ff;
  --maze-gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
  --flipcard-primary: #d4af37;
  --flipcard-light: #fff8e1;
  --flipcard-gradient: linear-gradient(135deg, #d4af37, #f5c443);
  --guess-primary: #f59e0b;
  --guess-light: #fef9e7;
  --guess-gradient: linear-gradient(135deg, #f59e0b, #d97706);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif; background: #f0f2f5; color: #1a1d23; min-height: 100vh; font-size: 14px; }

/* ========== Login ========== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1d23 0%, #2d1f2f 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; width: 380px; text-align: center; box-shadow: var(--shadow-lg); }
.login-box .logo { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: var(--sidebar-bg); }
.login-box .logo-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 32px; }
.login-box input { width: 100%; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; transition: border-color .2s; }
.login-box input:focus { border-color: var(--primary); outline: none; }
.login-box .login-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background .2s; }
.login-box .login-btn:hover { background: var(--primary-hover); }
.login-err { color: var(--primary); font-size: 13px; margin-top: 10px; min-height: 20px; }

/* ========== Layout ========== */
#app { display: none; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); background: var(--sidebar-bg); z-index: 50; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ========== 房间详情弹窗统一样式 ========== */
.room-detail-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.room-detail-code-card { background: linear-gradient(135deg, #6c3fff, #9b59b6); border-radius: 14px; padding: 16px 22px; color: #fff; flex-shrink: 0; box-shadow: 0 4px 12px rgba(108,63,255,0.25); }
.room-detail-code-card .label { font-size: 11px; opacity: 0.85; margin-bottom: 4px; }
.room-detail-code-card .code { font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.room-detail-info { background: #f5f3ff; border: 1px solid #e9e3f5; border-radius: 12px; padding: 14px 18px; flex-shrink: 0; }
.room-detail-info .label { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }
.room-detail-info .value { font-weight: 600; color: #333; font-size: 15px; }
.room-detail-info.gold { background: #fff8e1; border-color: #ffe082; }
.room-detail-info.gold .value { color: #d97706; font-weight: 700; }
.room-detail-info.blue { background: #eff6ff; border-color: #bfdbfe; }
.room-detail-info.blue .value { color: #2563eb; }
.room-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.room-status-badge.waiting { background: #fef3c7; color: #d97706; }
.room-status-badge.playing, .room-status-badge.spinning { background: #d1fae5; color: #059669; }
.room-status-badge.done { background: #f3f4f5; color: #6b7280; }
.room-log-entry { background: #f8f9fa; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid #e5e7eb; transition: all 0.2s; }
.room-log-entry:hover { border-color: var(--primary); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.room-log-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.room-log-badge { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); border-radius: 8px; padding: 8px 14px; color: #fff; display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.room-log-badge .index { font-size: 15px; font-weight: 700; }
.room-log-badge .time { font-size: 10px; opacity: 0.8; margin-top: 2px; }
.room-log-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.room-log-item-card { background: #fff; border: 1px solid #e0ddf5; border-radius: 8px; padding: 10px 14px; min-width: 85px; text-align: center; transition: all 0.2s; }
.room-log-item-card:hover { border-color: var(--primary); background: #fef2f2; }
.room-log-item-card .cat { font-size: 10px; color: var(--gray-500); margin-bottom: 4px; }
.room-log-item-card .name { font-size: 12px; font-weight: 600; color: #333; word-break: break-word; }
.room-logs-empty { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.room-logs-empty .emoji { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.room-logs-empty .text { font-size: 16px; }
@media (max-width: 768px) { .room-detail-card { flex-direction: column; align-items: stretch; } .room-detail-code-card, .room-detail-info { flex: 1; } .room-log-header { flex-direction: column; align-items: flex-start; } }

/* ========== 响应式设计优化 ========== */
/* 平板设备 (768px) */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main { margin-left: 0; }
  .topbar { position: relative; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .game-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .form-row > * { min-width: 100%; }
  .modal { width: 95%; max-width: none; }
  .modal-body { max-height: 60vh; }
}

/* 手机设备 (480px) */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .stat-icon { float: none; margin-bottom: 10px; }
  .login-box { width: 95%; padding: 32px 24px; }
  .topbar { flex-direction: column; height: auto; padding: 12px 16px; gap: 8px; }
  .topbar-title { font-size: 14px; }
  .content { padding: 12px; }
  .card-head { flex-direction: column; gap: 10px; align-items: flex-start; }
  .card-head .btn { width: 100%; justify-content: center; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .item-grid, .item-grid-sm, .item-grid-lg { grid-template-columns: repeat(2, 1fr); }
  .room-detail-code-card .code { font-size: 16px; letter-spacing: 2px; }
  .room-log-badge { min-width: 50px; padding: 6px 10px; }
  .room-log-badge .index { font-size: 13px; }
}

/* 小大屏设备 (1400px+) */
@media (min-width: 1400px) {
  .content { max-width: 1600px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
.sidebar-logo { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-logo h1 { font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-logo p { font-size: 11px; color: var(--sidebar-text); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title { padding: 10px 20px 4px; font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--sidebar-text); cursor: pointer; transition: all .15s; font-size: 13px; text-decoration: none; border-left: 3px solid transparent; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: rgba(196,30,58,0.15); color: #fff; border-left-color: var(--primary); }
.nav-item.disabled { opacity: 0.35; cursor: not-allowed; }
.nav-item .nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-footer .admin-info { display: flex; align-items: center; gap: 10px; }
.sidebar-footer .admin-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.sidebar-footer .admin-name { font-size: 13px; color: #fff; }
.sidebar-footer .admin-role { font-size: 11px; color: var(--gray-500); }
.sidebar-footer .logout-btn { margin-top: 10px; width: 100%; padding: 7px; border: 1px solid rgba(255,255,255,0.1); background: none; color: var(--sidebar-text); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-family: inherit; transition: all .2s; }
.sidebar-footer .logout-btn:hover { border-color: var(--primary); color: var(--primary); }

.main { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--gray-200); padding: 0 28px; height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--gray-500); }
.content { padding: 24px 28px; max-width: 1400px; }

/* ========== 模块隐藏类 ========== */
/* 隐藏刮刮乐、扫雷、大富翁模块 */
/* 导航菜单 */
.nav-group.hide, .nav-item.hide { display: none !important; }
/* 游戏卡片 */
.game-card.hide { display: none !important; }
/* 筛选标签 */
.filter-tab.hide { display: none !important; }
/* 页面 */
.page.hide { display: none !important; }
/* 设置页面中的区块 */
.settings-section.hide { display: none !important; }
/* 模态框 */
.modal-overlay.hide { display: none !important; }

