/* ============================================================
   专家库抽签系统 - Global Styles
   Theme: Deep Space Dark + Gold Accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&family=Rajdhani:wght@400;600;700&display=swap');

:root {
  --bg-primary: #070b18;
  --bg-secondary: #0d1428;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.4);
  --accent-gold: #ffd700;
  --accent-gold-dim: rgba(255, 215, 0, 0.15);
  --accent-purple: #7c3aed;
  --accent-purple-light: #a78bfa;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --nav-width: 240px;
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
  height: 100%;
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
  background-attachment: fixed;
}

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple-light);
}

/* ======================== ANIMATIONS ======================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.6), 0 0 60px rgba(124, 58, 237, 0.2);
  }
}

@keyframes pulse-gold {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.3);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes marquee-scroll {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-50%);
  }
}

@keyframes winner-reveal {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  60% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes particle {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-80px) scale(0);
    opacity: 0;
  }
}

/* ======================== LOGIN PAGE ======================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

.login-bg-orb.orb1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.login-bg-orb.orb2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  bottom: 10%;
  right: -5%;
  animation-delay: 2s;
}

.login-bg-orb.orb3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation-delay: 4s;
}

.login-card {
  background: rgba(13, 20, 40, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 56px 48px;
  width: 420px;
  max-width: 95vw;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeIn 0.6s ease-out;
  position: relative;
  z-index: 10;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4);
  animation: pulse-glow 3s ease-in-out infinite;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.form-group .input-wrapper {
  position: relative;
}

.form-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Noto Sans SC', sans-serif;
  transition: all var(--transition);
  outline: none;
}

.form-group .input-wrapper .form-control {
  padding-left: 44px;
}

.form-control:focus {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-control:focus+.input-icon,
.form-group .input-wrapper:focus-within .input-icon {
  color: var(--accent-purple-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #5b21b6);
  color: white;
  width: 100%;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  margin-top: 8px;
}

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

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

.btn-gold {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  color: #1a1400;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple-light);
  background: rgba(124, 58, 237, 0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

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

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

/* ======================== DASHBOARD LAYOUT ======================== */
.dashboard {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ======================== SIDEBAR ======================== */
.sidebar {
  width: var(--nav-width);
  background: rgba(7, 11, 24, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width var(--transition);
}

.sidebar-brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand .brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.sidebar-brand h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  line-height: 1.4;
}

.sidebar-brand p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.1));
  color: var(--accent-purple-light);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent-purple-light);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-info .user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

/* ======================== MAIN CONTENT ======================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.topbar {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 11, 24, 0.6);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 150;
}

.mobile-menu-backdrop.show {
  display: block;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ======================== CARDS ======================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ======================== STATS CARDS ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.zonghe {
  background: rgba(124, 58, 237, 0.2);
}

.stat-icon.jiaoxue {
  background: rgba(59, 130, 246, 0.2);
}

.stat-icon.xunlian {
  background: rgba(16, 185, 129, 0.2);
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
}

/* ======================== LOTTERY PAGE ======================== */
.lottery-header {
  text-align: center;
  padding: 20px 0 32px;
  animation: fadeIn 0.5s ease-out;
}

.lottery-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), #f59e0b, var(--accent-gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  margin-bottom: 8px;
}

.lottery-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.lottery-config {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 40px;
  padding: 10px 18px;
}

.config-item label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.config-count {
  width: 60px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.config-count:focus {
  border-color: var(--accent-purple);
}

.lottery-pools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.pool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.pool-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.pool-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pool-dot.zonghe {
  background: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple);
}

.pool-dot.jiaoxue {
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
}

.pool-dot.xunlian {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.pool-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.pool-count-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text-secondary);
}

/* ===== MARQUEE / DRUM ROLL EFFECT ===== */
.pool-display {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
}

.pool-display::before,
.pool-display::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 2;
  pointer-events: none;
}

.pool-display::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-card) 0%, transparent 100%);
}

.pool-display::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
}

.drum-highlight {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 6px;
  z-index: 1;
  pointer-events: none;
}

.drum-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.06s linear;
}

.drum-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  padding: 0 16px;
  text-align: center;
}

.drum-item.center {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.pool-result {
  padding: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-sm);
  animation: winner-reveal 0.5s ease-out both;
}

.result-item:nth-child(1) {
  animation-delay: 0.1s;
}

.result-item:nth-child(2) {
  animation-delay: 0.2s;
}

.result-item:nth-child(3) {
  animation-delay: 0.3s;
}

.result-item:nth-child(4) {
  animation-delay: 0.4s;
}

.result-item:nth-child(5) {
  animation-delay: 0.5s;
}

.result-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
  color: #1a1400;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.result-extra {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.lottery-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 16px;
}

.btn-lottery {
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 50px;
  box-shadow: 0 4px 30px rgba(255, 215, 0, 0.4);
  animation: pulse-gold 2.5s ease-in-out infinite;
}

.btn-lottery.running {
  animation: pulse-glow 1s ease-in-out infinite;
  background: linear-gradient(135deg, var(--accent-purple), #5b21b6);
  color: white;
  box-shadow: 0 4px 30px rgba(124, 58, 237, 0.5);
}

/* ======================== EXPERTS PAGE ======================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-purple-light);
  border-bottom-color: var(--accent-purple);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-panel.active {
  display: block;
}

.upload-zone {
  border: 2px dashed rgba(124, 58, 237, 0.3);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(124, 58, 237, 0.03);
  margin-bottom: 20px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.06);
  transform: translateY(-2px);
}

.upload-zone .upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.upload-zone h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ======================== TABLE ======================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* ======================== HISTORY PAGE ======================== */
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: all var(--transition);
  animation: fadeIn 0.3s ease-out;
}

.history-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-time {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-id {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  color: var(--text-muted);
}

.history-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.history-pool {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.history-pool-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-pool-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.name-tag.zonghe {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple-light);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.name-tag.jiaoxue {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.name-tag.xunlian {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ======================== ALERTS / TOASTS ======================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 260px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

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

.toast.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ======================== LOADING ======================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 24, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  flex-direction: column;
  gap: 16px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin-slow 0.8s linear infinite;
}

/* ======================== BADGE ======================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-purple {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-purple-light);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* ======================== MODAL ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

/* ======================== PAGINATION ======================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px 0 4px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple-light);
}

.page-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 900px) {
  :root {
    --nav-width: 200px;
  }

  .lottery-pools {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-results {
    grid-template-columns: 1fr;
  }
}

.mobile-only {
  display: none !important;
}

@media (max-width: 640px) {
  .mobile-only {
    display: block !important;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 200;
  }

  .content-area {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lottery-config {
    gap: 12px;
    flex-direction: column;
  }

  .config-item {
    width: 100%;
    justify-content: space-between;
  }

  .lottery-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .lottery-actions button {
    width: 100%;
    margin-bottom: 10px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block;
    margin-left: auto;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 200;
    transition: left var(--transition);
  }

  .sidebar.sidebar-open {
    left: 0;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
  }
}

/* ======================== FIREWORK PARTICLE ======================== */
.particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: particle 1.5s ease-out forwards;
}