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

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部样式 */
.header {
  background-color: #4a90e2;
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
}

.header h1 {
  margin-bottom: 15px;
  font-size: 28px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 主要内容样式 */
.main {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.step-card {
  text-align: center;
  padding: 20px;
}

.step-card h2 {
  margin-bottom: 20px;
  color: #4a90e2;
}

.hidden {
  display: none !important;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.input-field {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 10px;
}

.input-field:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 5px;
}

.btn-primary {
  background-color: #4a90e2;
  color: white;
}

.btn-primary:hover {
  background-color: #357abd;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-lottery {
  background-color: #e74c3c;
  color: white;
  font-size: 18px;
  padding: 15px 30px;
  margin: 20px 0;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-lottery:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

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

/* 消息样式 */
.message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 欢迎文本 */
.welcome-text {
  font-size: 18px;
  margin-bottom: 20px;
  color: #4a90e2;
}

/* 抽奖信息 */
.lottery-info {
  margin-bottom: 30px;
}

.highlight {
  color: #e74c3c;
  font-weight: bold;
  font-size: 18px;
}

/* 结果样式 */
.result-box {
  background-color: #f8f9fa;
  padding: 30px;
  border-radius: 8px;
  margin: 20px 0;
  border: 2px dashed #4a90e2;
}

.result-label {
  margin-bottom: 10px;
  font-size: 16px;
}

.result-code {
  font-size: 36px;
  font-weight: bold;
  color: #e74c3c;
  letter-spacing: 2px;
}

.result-actions {
  margin-top: 30px;
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 记录页面样式 */
.records-container {
  max-width: 1000px;
  margin: 0 auto;
}

.records-header {
  margin-bottom: 30px;
  text-align: center;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.records-table th,
.records-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.records-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.records-table tr:hover {
  background-color: #f5f5f5;
}

.records-table .code {
  font-weight: bold;
  color: #e74c3c;
}

/* 管理页面样式 */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
}

.admin-header {
  margin-bottom: 30px;
  text-align: center;
}

.admin-section {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.admin-section h3 {
  margin-bottom: 20px;
  color: #4a90e2;
}

.participants-list {
  list-style: none;
  margin-bottom: 20px;
}

.participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.participant-item:hover {
  background-color: #f5f5f5;
}

.admin-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.btn-delete {
  background-color: #e74c3c;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
}

.btn-delete:hover {
  background-color: #c0392b;
}

.btn-delete-all {
  background-color: #c0392b;
  color: white;
  font-size: 16px;
  padding: 12px 24px;
  margin-top: 10px;
}

.btn-delete-all:hover {
  background-color: #a93226;
}

.btn-reset-all {
  background-color: #e67e22;
  color: white;
  font-size: 16px;
  padding: 12px 24px;
  margin-top: 20px;
}

.btn-reset-all:hover {
  background-color: #d35400;
}

/* 页脚样式 */
.footer {
  text-align: center;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: #777;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .main {
    padding: 20px;
  }
  
  .nav {
    flex-direction: column;
    gap: 10px;
  }
  
  .nav-link {
    display: block;
  }
  
  .result-code {
    font-size: 24px;
  }
  
  .records-table {
    font-size: 14px;
  }
  
  .records-table th,
  .records-table td {
    padding: 8px;
  }
}