/* CTF系统 - 完整样式 */

/* 基础重置 */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f8fafc;
  color: #334155;
  line-height: 1.6;
}

/* 布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 间距 */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

/* 导航栏 */
.nav {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav h1 {
  margin: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  font-weight: 500;
}

.nav a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-link.active {
  background: #475569;
  color: white;
}

.nav-link.admin-link {
  color: #fbbf24;
}

/* 用户区域 */
.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
  white-space: nowrap;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar-default {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.logout-link {
  color: #f87171;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.logout-link:hover {
  background: rgba(248, 113, 113, 0.1);
}

.auth-link {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.login-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.register-link {
  background: #3b82f6;
  color: white;
  font-weight: 600;
}

.register-link:hover {
  background: #2563eb;
}

/* 卡片 */
.card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h2, .card h3 {
  margin: 0 0 1rem 0;
  color: #1e293b;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #3b82f6;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-secondary {
  background: #64748b;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-success {
  background: #10b981;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #f59e0b;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-info {
  background: #06b6d4;
}

.btn-info:hover {
  background: #0891b2;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

/* 表单 */
.input, .select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
  background: white;
}

.input:focus, .select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input:disabled, .input[readonly], .select:disabled {
  background-color: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

/* 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: #374151;
  font-size: 0.875rem;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.table tr:hover td {
  background: #f8fafc;
}

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

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-success {
  background: #d1fae5;
  color: #059669;
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-secondary {
  background: #f1f5f9;
  color: #64748b;
}

/* Flash消息 */
.flash {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.flash-success {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.flash-error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* 后台布局 */
.layout-admin {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar h2 {
  margin: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #d1d5db;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  margin: 0 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-weight: 500;
}

.sidebar a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar a.active {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-content {
  flex: 1;
  padding: 2rem;
  background: #f9fafb;
}

/* 轮播图 */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
}

.slide-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.2), rgba(0,0,0,0.1));
  z-index: 2;
}

.slide-content {
  position: relative;
  z-index: 10;
  color: white;
  text-align: center;
  max-width: 800px;
  padding: 0 2rem;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(0,0,0,0.3);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-control:hover {
  background: rgba(0,0,0,0.5);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
  left: 1rem;
}

.carousel-control.next {
  right: 1rem;
}

.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 20;
}

.carousel-indicators .indicator {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicators .indicator.active,
.carousel-indicators .indicator:hover {
  background: white;
  border-color: white;
}

/* 题目页面布局 */
.challenges-main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.categories-sidebar {
  align-self: start;
  position: sticky;
  top: 2rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.category-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #475569;
  background: white;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.category-item:hover a {
  background: #f8fafc;
  border-color: #3b82f6;
}

.category-item.active a {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.category-count {
  margin-left: auto;
  background: rgba(0,0,0,0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.category-item.active .category-count {
  background: rgba(255,255,255,0.2);
}

/* Challenge grid - 3x2 layout for pagination */
.challenge-grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Legacy grid for backward compatibility */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* 紧凑的题目卡片样式 */
.challenge-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.challenge-card-compact {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.challenge-card-compact:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.challenge-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
  flex: 1;
  margin-right: 0.5rem;
}

.attachment-indicator {
  color: #6b7280;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.challenge-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.challenge-meta-row, .challenge-stats-row, .challenge-event {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.challenge-stats-row {
  justify-content: space-between;
  margin-top: auto;
}

.challenge-score {
  font-weight: 600;
  color: #059669;
  font-size: 0.875rem;
}

.challenge-solved {
  color: #6b7280;
  font-size: 0.875rem;
}

.badge-category {
  background: #f3f4f6;
  color: #374151;
}

.badge-difficulty {
  font-size: 0.75rem;
}

.badge-event {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
}

/* 保留原有卡片样式用于其他地方 */
.challenge-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.challenge-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Pagination styles */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #3b82f6;
}

.pagination-btn.pagination-current {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.pagination-btn.pagination-current:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  color: #9ca3af;
  font-weight: 500;
}

.pagination-info {
  color: #6b7280;
  font-size: 0.875rem;
}

/* 题目详情页面样式 */
.challenge-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.challenge-detail-card {
  margin-bottom: 2rem;
}

.challenge-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.challenge-title-section {
  flex: 1;
}

.challenge-detail-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.challenge-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.challenge-stats {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
  margin-left: 2rem;
}

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

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.challenge-description {
  margin-bottom: 2rem;
}

.challenge-description h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.description-content {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
}

.challenge-actions-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

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

.solve-history-section {
  margin-top: 2rem;
}

.solve-history-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.solve-list {
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.solve-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

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

.solve-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-name {
  color: #6b7280;
  font-size: 0.875rem;
}

.solve-score {
  font-weight: 600;
  color: #059669;
  font-size: 0.875rem;
}

.solve-time {
  color: #6b7280;
  font-size: 0.875rem;
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.challenge-card h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.challenge-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.challenge-description .description-content {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 4px solid #3b82f6;
  line-height: 1.5;
  color: #475569;
  margin-bottom: 1rem;
}

.challenge-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

/* 排行榜 */
.scoreboard-section {
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  max-width: 800px;
  margin: 0 auto;
}

.scoreboard-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scoreboard-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.scoreboard-stats {
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.scoreboard-list {
  max-height: 600px;
  overflow-y: auto;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.3s ease;
}

.rank-item:hover {
  background: #f8fafc;
  transform: translateX(5px);
}

.rank-item.top-rank {
  background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%);
}

.rank-number {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.rank-crown, .rank-medal {
  font-size: 1.5rem;
}

.rank-num {
  background: #f1f5f9;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #64748b;
}

.rank-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e2e8f0;
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder, .team-avatar {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.rank-info {
  flex: 1;
}

.rank-name {
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.rank-stats {
  display: flex;
  gap: 1rem;
}

.stat-item {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}

.rank-progress {
  width: 4rem;
  height: 0.5rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  transition: width 0.5s ease;
}

/* 实时动态 */
.realtime-feed {
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.feed-item:hover {
  background: rgba(255,255,255,0.1);
}

.feed-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-text {
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  color: rgba(255,255,255,0.95);
}

.team-tag {
  background: rgba(255,255,255,0.2);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  margin: 0 0.25rem;
}

.blood-badge {
  background: rgba(255,215,0,0.2);
  color: #ffd700;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.feed-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination .btn {
  min-width: 2.5rem;
  justify-content: center;
}

/* 工具类 */
.success { color: #10b981; }
.error { color: #ef4444; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.hidden { display: none; }
.text-danger { color: #ef4444; }

/* 响应式 */
@media (max-width: 1024px) {
  .challenge-grid-3x2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .nav .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .nav-user {
    justify-content: center;
  }
  
  .user-area {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  
  .auth-area {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  
  .nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .user-info {
    padding: 0.375rem 0.75rem;
  }
  
  .user-avatar,
  .user-avatar-default {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  .user-name {
    font-size: 0.75rem;
  }
  
  .logout-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .auth-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .challenges-main-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .categories-sidebar {
    position: static;
    order: 2;
  }
  
  .challenge-grid {
    grid-template-columns: 1fr;
  }
  
  .challenge-grid-3x2 {
    grid-template-columns: 1fr;
  }
  
  /* 题目详情页面移动端样式 */
  .challenge-detail-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .challenge-stats {
    margin-left: 0;
    justify-content: center;
  }
  
  .challenge-detail-title {
    font-size: 1.5rem;
  }
  
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .actions-row .btn {
    width: 100%;
    justify-content: center;
  }
  
  .carousel-wrapper {
    height: 18rem;
    margin: 0 -1rem 1rem -1rem;
    border-radius: 0;
  }
  
  .carousel-control {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .carousel-control.prev {
    left: 0.5rem;
  }
  
  .carousel-control.next {
    right: 0.5rem;
  }
  
  .layout-admin {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  
  .admin-content {
    padding: 1rem;
  }
}

/* ========================================
   现代化导航栏样式
   ======================================== */

.nav-modern {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  padding: 0;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  height: 72px;
}

/* Logo和品牌 */
.nav-brand-modern {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-icon:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand-title {
  margin: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 导航链接 */
.nav-links-modern {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-link-modern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  background: rgba(255, 255, 255, 0);
  border: 1px solid transparent;
}

.nav-link-modern .link-icon {
  font-size: 1.1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-modern:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-link-modern:hover .link-icon {
  transform: scale(1.2);
}

.nav-link-modern.active {
  background: rgba(255, 255, 255, 0.95);
  color: #2563eb;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-weight: 700;
}

.nav-link-modern.active .link-icon {
  filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.5));
}

.admin-link-modern {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
}

.admin-link-modern:hover {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

.admin-link-modern.active {
  background: #fbbf24;
  color: #1e293b;
  border-color: #fbbf24;
}

/* 用户区域 */
.nav-user-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  flex: 1;
}

.user-info-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.user-info-modern:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.user-avatar-modern {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
}

.user-info-modern:hover .user-avatar-modern {
  transform: scale(1.05);
  border-color: white;
}

.user-avatar-default-modern {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  transition: all 0.3s;
}

.user-info-modern:hover .user-avatar-default-modern {
  transform: scale(1.05);
  border-color: white;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.user-name-modern {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.user-role-modern {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
}

.logout-link-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.logout-link-modern:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-icon {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(239, 68, 68, 0.9);
}

/* 认证按钮 */
.auth-buttons-modern {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.login-btn-modern,
.register-btn-modern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.login-btn-modern {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.login-btn-modern:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.register-btn-modern {
  color: #2563eb;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.register-btn-modern:hover {
  background: white;
  border-color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.auth-icon {
  font-size: 1.1rem;
}

/* Flash消息 */
.flash-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.flash-success-modern {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #10b981;
}

.flash-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
  .nav-container {
    gap: 1rem;
    padding: 0 3rem;
  }
  
  .nav-brand-modern {
    min-width: auto;
  }
  
  .brand-subtitle {
    display: none;
  }
  
  .nav-links-modern {
    gap: 0.25rem;
  }
  
  .nav-link-modern {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .user-info-text {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    height: auto;
    flex-wrap: wrap;
    padding: 1rem 2rem;
  }
  
  .nav-links-modern {
    order: 3;
    width: 100%;
    justify-content: space-around;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .nav-link-modern .link-text {
    display: none;
  }
  
  .nav-link-modern .link-icon {
    font-size: 1.5rem;
  }
  
  .nav-link-modern {
    padding: 0.5rem;
  }
  
  .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  
  .brand-title {
    font-size: 1.1rem;
  }
}