/* 活动报名系统 - 样式 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

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

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

.header h1 {
  font-size: 24px;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-outline {
  background: transparent;
  border: 1px solid #007bff;
  color: #007bff;
}

.btn-outline:hover {
  background: #007bff;
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-secondary {
  background: #e9ecef;
  color: #6c757d;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

/* 活动列表 */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.activity-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.activity-info {
  padding: 16px;
}

.activity-info h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.activity-desc {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.activity-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.count {
  color: #666;
  font-size: 14px;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.modal-content {
  background: white;
  margin: 40px auto;
  padding: 24px;
  border-radius: 8px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: #333;
}

/* 状态提示 */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.error {
  text-align: center;
  padding: 40px;
  color: #dc3545;
}

.empty {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty .tip {
  font-size: 14px;
  color: #999;
  margin-top: 8px;
}

/* 我的报名 */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.activity-group {
  background: white;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.group-header {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  background: #f8f9fa;
}

.group-header h3 {
  flex: 1;
  font-size: 16px;
}

.group-header .badge {
  margin-right: 8px;
}

.arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

.arrow.collapsed {
  transform: rotate(-90deg);
}

.group-content {
  padding: 0 16px;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
}

.group-content.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.registration-item {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}

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

.reg-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.reg-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.reg-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.field-tag {
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.reg-time {
  font-size: 12px;
  color: #999;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status-badge.confirmed {
  background: #d4edda;
  color: #155724;
}

.status-badge.cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* 响应式 */
@media (max-width: 480px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .activity-meta {
    flex-direction: column;
    gap: 4px;
  }
  
  .modal-content {
    margin: 20px;
    max-height: 85vh;
  }
}
