﻿/* ============================================
   大湾区音乐报名系统 — 全局样式
   ============================================ */

:root {
  --primary: #1a56db;
  --primary-light: #e8effd;
  --secondary: #7c3aed;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
}

/* ── Nav ───────────────────────────────────── */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 32px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-tab:hover { background: var(--gray-100); color: var(--gray-700); }
.nav-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ── Container ─────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Hero ──────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 48px 32px;
  border-radius: 12px;
  margin-bottom: 32px;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero p { opacity: 0.9; font-size: 15px; }

/* ── Card ─────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-900);
}

/* ── Form ─────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-control {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.15s;
  background: white;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--gray-500); }
.form-error { font-size: 12px; color: var(--danger); }

select.form-control { appearance: auto; }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1648c0; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-outline {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ── Status badges ────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-unpaid { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* ── Table ────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { font-weight: 600; color: var(--gray-500); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--gray-50); }

/* ── Page ─────────────────────────────────── */
.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Result / Alert ───────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Payment QR ───────────────────────────── */
.payment-qr {
  width: 200px; height: 200px;
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  color: var(--gray-500);
  font-size: 13px;
  background: var(--gray-50);
}

.payment-code-card {
  padding: 16px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  margin: 12px 0;
  text-align: center;
  background: #fff;
}

.payment-code-title {
  margin: 0 0 12px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
}

.payment-code-image {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  touch-action: manipulation;
}

.payment-code-tip {
  margin: 12px 0 6px;
  color: #166534;
  font-size: 14px;
  font-weight: 600;
}

.payment-code-link {
  display: inline-block;
  padding: 6px 0;
  color: var(--primary);
  font-size: 13px;
  text-decoration: underline;
}

/* ── Schedule card ────────────────────────── */
.schedule-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 12px;
}
.schedule-date {
  text-align: center;
  min-width: 60px;
}
.schedule-date .day { font-size: 24px; font-weight: 700; color: var(--primary); display: block; }
.schedule-date .month { font-size: 12px; color: var(--gray-500); }
.schedule-info { flex: 1; }
.schedule-info .time { font-weight: 600; }
.schedule-info .venue { color: var(--gray-500); font-size: 13px; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 22px; }
  .nav-inner { gap: 12px; padding: 0 12px; }
  .nav-tab { padding: 6px 12px; font-size: 13px; }
}

/* ── Loading spinner ──────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 40px; gap: 8px; align-items: center; color: var(--gray-500); }
