:root {
  --bg: #f7f8fa;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #fff;
  --primary: #2563eb;
  --border: #e5e7eb;
  --badge: #0ea5e9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

/* 🔹 Navbar */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-link {
  text-decoration: none;
  color: var(--text);
  opacity: 0.8;
}
.nav-link:hover {
  opacity: 1;
}

/* 🔹 Hero section */
.hero {
  background: linear-gradient(180deg, #eef2ff, #fff);
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero h1 {
  margin-bottom: 10px;
}
.muted {
  color: var(--muted);
}

/* 🔹 Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.badge {
  display: inline-block;
  background: var(--badge);
  color: white;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

/* 🔹 Buttons */
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(.95);
}
.btn-secondary {
  background: #9ca3af;
}

/* 🔹 Error box */
.error {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 8px;
}

/* 🔹 Loading */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

/* 🔹 表单样式 */
.search-form, .login-form, .register-form {
  background: #fff;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: .3rem;
  font-weight: 600;
}

.form-group input, .form-group select {
  width: 100%;
  padding: .6rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: .8rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* 🔹 活动详情页面样式 */
.event-wrapper {
  background: #f8fafc;
  min-height: 100vh;
}

.event-card {
  background: #fff;
  max-width: 800px;
  margin: 40px auto;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 32px;
}

.event-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin-bottom: 10px;
}

.event-info {
  text-align: center;
  color: #475569;
  font-size: 1rem;
  margin-bottom: 16px;
}

.event-date {
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 16px;
}

.btn-register {
  display: block;
  margin: 0 auto 24px;
  padding: 10px 18px;
  font-size: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.btn-register:hover {
  background: #1e40af;
  transform: scale(1.03);
}

.register-form {
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.register-form h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #334155;
}

.success-message {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin: 20px 0;
}

.reg-section {
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.reg-section h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #334155;
}

.reg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #334155;
}

.reg-item span {
  color: #64748b;
  font-size: 0.9rem;
}

.reg-item i {
  color: #2563eb;
}

.hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}

.no-results, .no-registrations {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.login-link, .register-link {
  text-align: center;
  margin-top: 16px;
}

.login-link a, .register-link a {
  color: var(--primary);
  text-decoration: none;
}

.login-link a:hover, .register-link a:hover {
  text-decoration: underline;
}

/* 🔹 Footer */
.footer {
  background: #f3f4f6;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .nav-menu {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .event-card {
    margin: 20px;
    padding: 20px;
  }
}
