/* ============================================
   MODERN MINIMALIST DESIGN
   Based on Reference Image
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #F8F9FA;
  min-height: 100vh;
  padding: 0;
  color: #1A1A1A;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #FFFFFF;
  padding: 0;
  min-height: 100vh;
}

/* 页面头部 */
h1 {
  background: #FFFFFF;
  color: #1A1A1A;
  padding: 50px 40px 20px;
  margin: 0;
  font-size: 3em;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

h1::before {
  content: '🏆';
  font-size: 1.2em;
}

/* 副标题 */
h1 + .subtitle {
  text-align: center;
  color: #6B7280;
  font-size: 1.1em;
  padding: 0 40px 30px;
  font-weight: 400;
}

/* 统计信息 - 顶部徽章 */
.stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 20px 40px 40px;
  flex-wrap: wrap;
}

.stat-card {
  background: #F3F4F6;
  color: #1A1A1A;
  padding: 12px 24px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95em;
  font-weight: 600;
  border: 1px solid #E5E7EB;
}

.stat-card::before {
  font-size: 1.2em;
}

.stat-value {
  font-size: 1em;
  font-weight: 700;
  margin: 0;
}

.stat-label {
  font-size: 1em;
  font-weight: 600;
  color: #6B7280;
}

/* 区块标题 */
h2 {
  color: #1A1A1A;
  margin: 0;
  padding: 30px 40px 20px;
  font-size: 1.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
}

h2::before {
  font-size: 1.1em;
}

/* TOP3 排行榜区域 */
.leaderboard-section {
  background: #FFFFFF;
  padding: 20px 40px 40px;
  border-radius: 20px;
  margin: 0 20px 30px;
  border: 1px solid #E5E7EB;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.leaderboard-card {
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  padding: 30px;
  position: relative;
  transition: all 0.2s ease;
}

.leaderboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* TOP1 - 金色 */
.leaderboard-card.rank-1 {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
  border-color: #FFD700;
}

/* TOP2 - 银色 */
.leaderboard-card.rank-2 {
  background: linear-gradient(135deg, #F5F5F5 0%, #FAFAFA 100%);
  border-color: #C0C0C0;
}

/* TOP3 - 铜色 */
.leaderboard-card.rank-3 {
  background: linear-gradient(135deg, #FFF5F0 0%, #FFF8F5 100%);
  border-color: #E8B4A0;
}

.leaderboard-rank {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 0.9em;
  font-weight: 700;
  color: #6B7280;
}

.leaderboard-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2em;
}

.leaderboard-card.rank-1 .leaderboard-icon::before {
  content: '👑';
}

.leaderboard-card.rank-2 .leaderboard-icon::before {
  content: '🥈';
}

.leaderboard-card.rank-3 .leaderboard-icon::before {
  content: '🥉';
}

.leaderboard-name {
  font-size: 1.5em;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 10px;
  padding-top: 10px;
}

.leaderboard-votes {
  font-size: 2.5em;
  font-weight: 700;
  color: #1A1A1A;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.leaderboard-votes-label {
  font-size: 0.4em;
  color: #6B7280;
  font-weight: 600;
}

/* 所有候选人区域 */
.candidates-section {
  background: #FFFFFF;
  padding: 20px 40px 40px;
  border-radius: 20px;
  margin: 0 20px 30px;
  border: 1px solid #E5E7EB;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  padding: 0;
  margin: 0;
}

/* 候选人网格 */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.candidate-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.candidate-card:hover {
  border-color: #D70050;
  box-shadow: 0 4px 12px rgba(215, 0, 80, 0.1);
  transform: translateY(-2px);
}

.candidate-card.voted {
  background: linear-gradient(135deg, #FFF0F5 0%, #FFF5F8 100%);
  border-color: #D70050;
  border-width: 2px;
}

.candidate-info {
  flex: 1;
}

.candidate-rank {
  font-size: 0.85em;
  color: #6B7280;
  font-weight: 600;
  margin-bottom: 8px;
}

.candidate-name {
  font-size: 1.3em;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 8px;
}

.candidate-votes {
  font-size: 1.8em;
  font-weight: 700;
  color: #1A1A1A;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.candidate-votes-label {
  font-size: 0.5em;
  color: #6B7280;
  font-weight: 600;
}

/* 投票按钮 */
.vote-button {
  padding: 10px 24px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1A1A1A;
}

.vote-button::before {
  content: '☑️';
  font-size: 1.1em;
}

.vote-button:hover {
  background: #D70050;
  color: #FFFFFF;
  border-color: #D70050;
}

.candidate-card.voted .vote-button {
  background: #D70050;
  color: #FFFFFF;
  border-color: #D70050;
}

.candidate-card.voted .vote-button::before {
  content: '✓';
}

/* 按钮样式 */
button {
  padding: 12px 24px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 10px;
  margin-bottom: 10px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: inherit;
}

.btn-primary {
  background: #D70050;
  color: #FFFFFF;
  border-color: #D70050;
}

.btn-primary:hover {
  background: #B8003F;
  border-color: #B8003F;
}

.btn-danger {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-success {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
}

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 输入区域 */
.input-section {
  margin: 0 20px 20px;
  padding: 30px;
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1A1A1A;
  font-size: 0.95em;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #FFFFFF;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #D70050;
  box-shadow: 0 0 0 3px rgba(215, 0, 80, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* 用户信息栏 */
.user-info {
  background: #1F2937;
  color: #FFFFFF;
  padding: 20px 40px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 3px solid #D70050;
}

.user-info strong {
  font-size: 1em;
  font-weight: 600;
}

/* 提示信息 */
.alert {
  padding: 16px 20px;
  margin: 0 20px 20px;
  border-radius: 12px;
  font-size: 0.95em;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert::before {
  font-size: 1.3em;
}

.alert-info {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}

.alert-info::before {
  content: 'ℹ️';
}

.alert-success {
  background: #F0FDF4;
  color: #166534;
  border-color: #BBF7D0;
}

.alert-success::before {
  content: '✓';
}

.alert-warning {
  background: #FFFBEB;
  color: #92400E;
  border-color: #FDE68A;
}

.alert-warning::before {
  content: '⚠️';
}

.alert-danger {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.alert-danger::before {
  content: '⚠️';
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: #6B7280;
}

.empty-state-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1.2em;
  font-weight: 600;
}

/* 加载动画 */
.loading {
  text-align: center;
  padding: 60px;
  font-size: 1.2em;
  color: #6B7280;
  font-weight: 600;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

/* 链接样式 */
a {
  color: #D70050;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
}

a:hover {
  background: #FFF0F5;
  color: #B8003F;
}

/* 响应式设计 */
@media (max-width: 768px) {
  h1 {
    font-size: 2em;
    padding: 30px 20px 15px;
  }

  h1 + .subtitle {
    font-size: 0.95em;
    padding: 0 20px 20px;
  }

  h2 {
    font-size: 1.4em;
    padding: 20px;
  }

  .stats {
    padding: 15px 20px 25px;
  }

  .leaderboard-section,
  .candidates-section,
  .input-section {
    margin: 0 10px 20px;
    padding: 20px;
    border-radius: 12px;
  }

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

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

  .candidate-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .vote-button {
    width: 100%;
    justify-content: center;
  }

  button {
    width: 100%;
    margin-right: 0;
  }

  .user-info {
    padding: 15px 20px;
  }

  .alert {
    margin: 0 10px 15px;
  }
}

/* 打印样式 */
@media print {
  body {
    background: #FFFFFF;
  }

  button,
  .vote-button {
    display: none;
  }
}
